[pLog-CVS] plog/plugins pluginhelloworld.class.php,NONE,1.1 pluginsinfeststrip.class.php,NONE,1.1
Brought to you by:
jondaley
From: <phu...@us...> - 2003-11-02 21:36:14
|
Update of /cvsroot/plog/plog/plugins In directory sc8-pr-cvs1:/tmp/cvs-serv31983/plugins Added Files: pluginhelloworld.class.php pluginsinfeststrip.class.php Log Message: user plugins can go now to the plugins/ folder in the root of plog, rather than having to be dropped in class/plugin which I thought was quite difficult to find for users. --- NEW FILE: pluginhelloworld.class.php --- <?php include_once( "class/plugin/pluginbase.class.php" ); include_once( "class/plugin/pluginmanager.class.php" ); /** * Implementation of a very simple plugin file. */ class PluginHelloWorld extends PluginBase { function PluginHelloWorld() { $this->PluginBase(); $this->desc = "This is a very simple plugin to show how to develop custom plugins"; $this->author = "The pLog team"; } function sayHello() { return( "Hello, world!" ); } } PluginManager::registerPlugin( "helloworld", "PluginHelloWorld" ); ?> --- NEW FILE: pluginsinfeststrip.class.php --- <?php include_once( "class/plugin/pluginbase.class.php" ); include_once( "class/plugin/pluginmanager.class.php" ); define( SINFEST_BASE, "http://sinfest.net/comics/" ); /** * Plugin that creates a url to see the day strip of sinfest, a * hilarious comic strip :) * It does not fetch it, it just returns the right url for today. * * It is exported with "sfstrip" as identifier. * * Usage: * * <img src="{$sfstring->SinfestStripUrl()" alt="Sinfest Strip"/> */ class PluginSinfestStrip extends PluginBase { function PluginSinfestStrip() { $this->PluginBase(); $this->desc = "Plugin that creates a url to see the day strip of sinfest, a hilarious comic strip :) It does not fetch it, it just returns the right url for today. It is exported with \"sfstrip\" as identifier.<br/> Usage:<br/><br/> <img src=\"{\$sfstring->SinfestStripUrl()\" alt=\"Sinfest Strip\"/>"; $this->author = "The pLog team"; } /** * Returns the url for the strip. * * @return The correct url for the strip. */ function SinfestStripUrl() { // with no parameters, timestamp has today's date $t = new Timestamp(); // name of the image is sfYYYYMMDD.gif $fileName = "sf".$t->getYear().$t->getMonth().$t->getDay(); return SINFEST_BASE.$fileName.".gif"; } } PluginManager::registerPlugin( "sfstrip", "PluginSinfestStrip" ); ?> |