To install a plugin one should copy its file to /admin/plugins/ folder; the plugin name will appear at the plugins' list in the administrative interface.
Example of a plugin is located at /sample/plugins/ folder.
Note: Any text editor can be used for a plugin creation.
Below is an example of a plugin, which displayes links sorted by the administrator's vote:
- <?php
- /* PLUGIN: This is title of example plugin; */
- chdir("..");
- $ADLINK="../";
- /* Authorization */
- include "./auth.php";
- /* Administrative interface - upper part of the page */
- include "./_top.php";
- /* Main form */
- ?>
- <table align=center cellspacing=1 cellpadding=6 border=0><form action=example.php method=get>
- <th colspan=2 background=../../cat/tablebg.gif>Plugin example</th></tr>
- <tr><td>Minimum moderator vote<td><input type=text name=min value='8'></td></tr>
- <tr><td>Maximum moderator vote<td><input type=text name=max value='10'></td></tr>
- <tr><td colspan=2 align=right><input type=submit value='Show'></td></tr>
- </form></table>
- <?php
- /* Result */
- if (isset($_GET["max"]))
- {
- $max=intval($_GET["max"]);
- $min=intval($_GET["min"]);
- $r=mysql_query("SELECT url FROM ".$db["prefix"]."main WHERE moder_vote<=".$max." AND moder_vote>='".$min."' LIMIT 1000;") or die(mysql_error());
- while ($a=mysql_fetch_array($r))
- print "<a href='".$a["url"]."'>".$a["url"]."</a><br>\n";
- }
- /* Administrative interface - bottom part of the page */
- include "./_bottom.php";
- ?>