Cactiusers.org


It is currently Thu May 17, 2012 7:26 am




Post new topic Reply to topic  [ 4 posts ] 
 Docs plugin 
Author Message
New User

Joined: Mon Feb 26, 2007 1:57 pm
Posts: 18
Post Docs plugin
Anyway to tie this plugin into the Superlinks plugin? So i can edit files in that dir? I haven't looked into it yet

http://wotsit.thingy.com/haj/cacti/superlinks-plugin.html


Mon Oct 29, 2007 12:33 pm
User

Joined: Thu Jan 19, 2006 2:59 pm
Posts: 62
Post 
I just had a play, and here's a superlinks page that will include the contents of a Docs document, so it adds access-control and a tab/menu-item to any Docs document. You'll need to have one per Docs document you want to use this way.

Just edit the top line to put the right document ID in. You can see the document ID in the URL when you edit the document in Docs.

Code:
<?php
        $document_id_to_show=2;

// include the appropriate config file, depending on the Cacti version

$cacti_base = dirname(__FILE__)."..". DIRECTORY_SEPARATOR."..";

if( file_exists($cacti_base."/include/global.php") )
{
        include_once($cacti_base."/include/global.php");
}
elseif (file_exists($cacti_base."/include/config.php") )
{
        include_once($cacti_base."/include/config.php");
}

include_once($config["library_path"] . "/database.php");

$SQL = "select * from plugin_docs where id=".intval($document_id_to_show);

$queryrows = db_fetch_assoc($SQL);

        if(count($queryrows)!=1)
        {
                print "The document is not defined.";
        }
        else
        {
                print "<h1>". $queryrows[0]['title']. "</h1>";
                print "<h3>Last updated ".date(DATE_RFC822,$queryrows[0]['updated'])."</h3>";
                print $queryrows[0]['data'];
        }

?>


So you copy that code into a new file in the plugins/superlinks/content/ folder, edit the ID, and then add it in the SuperLinks console item. It pulls the Docs document from the database, so your edits should show up straight away.

I'll add this example to the next SuperLinks release, since it seems like a pretty handy combination.


Wed Oct 31, 2007 4:30 pm
New User

Joined: Mon Feb 26, 2007 1:57 pm
Posts: 18
Post 
AWESOME thanks


This allows me to keep a news page to keep customers and the noc. updated on new things added to cacti. And a easy faq for customers on how to use cacti!


Im sure i will come up with more.


Thu Nov 01, 2007 8:24 am
New User

Joined: Mon Feb 26, 2007 1:57 pm
Posts: 18
Post 
View php action in docs?

Would like to have un editable links into docs. Mostly for weathermap host info.


Mon Nov 05, 2007 2:01 pm
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for: