Admin Latest menu, adding a plugin to

From e107 Wiki
Jump to: navigation, search

e107 Wiki: English | Русский | Deutsch | Français | Magyar | Português | Български | Česky | Nederlands | Ελληνικά | Italiano | Norske | Polska | Slovenščina | Español | Svenska | Translate: Wiki | Page

logo_wiki.png

Current Release 1.0.4 | e107.org | Download | Changelog | Forum | Plugins | Themes | RSS Feed of Latest Changes | Atom Feed of Latest Changes


How to write a plugin
Main page > I : First Aid > II : Development > III : Administration > IV : How To's > V : Plugin Writing > VI : Theming & Shortcodes


As of e107 0.7 a plugin can add it's own information to the Latest menu displayed in the admin area.

There are two steps to this process.

First off is to register the use of these features with core when the plugin is installed by inserting the following line to your plugin.php:

Code: plugin.php snippet
$eplug_latest = TRUE;

The next step is to create the file e_latest.php your plugins root folder.

You can place any code in here you wish, depending on the information you want to display, noting that everything these files output must be in the $text variable in an appended form (ie. with '.=' not'='). Below is an example of the e_latest.php taken from the cores Links Page plugin:

Code: e_latest from links_page plugin
$submitted_links = $sql->db_Select("tmp", "*", "tmp_ip='submitted_link' ");

$text .= "
<div style='padding-bottom: 2px;'>
   <img src='".e_PLUGIN."links_page/images/linkspage_16.png' 
        style='width:16px; height:16px; vertical-align:bottom' />".
   ($submitted_links ? " <a href='".e_PLUGIN."links_page/admin_config.php?sn'>"
                         .ADLAN_LAT_5.": $submitted_links</a>" 
                     : " ".ADLAN_LAT_5.": ".$submitted_links
   )
."</div>"; 


The Forum plugin also contains an example of an e_latest.php file.