A simple example plugin.
From the source of this page:
<?plugin HelloWorld salutation="Hello," name="WikiUser" ?>
PhpWiki's plugin architecture allows you to add custom page elements to your wiki. All you have to do is extend (subclass) the WikiPlugin class and craft your output via the run() method.
/**
* A simple demonstration WikiPlugin.
*
* Usage:
* <?plugin HelloWorld?>
* <?plugin HelloWorld
* salutation="Greetings, "
* name=Wikimeister
* ? >
* <?plugin HelloWorld salutation=Hi ? >
* <?plugin HelloWorld name=WabiSabi ? >
*/
// Constants are defined before the class.
if (!defined('THE_END'))
define('THE_END', "!");
class WikiPlugin_HelloWorld
extends WikiPlugin
{
// Five required functions in a WikiPlugin.
function getName () {
return _("HelloWorld");
}
function getDescription () {
return _("Simple Sample Plugin");
}
function getVersion() {
return preg_replace("/[Revision: $]/", '',
"\$Revision: 1.1 $");
}
// Establish default values for each of this plugin's arguments.
function getDefaultArguments() {
return array('salutation' => "Hello,",
'name' => "World");
}
function run($dbi, $argstr, $request) {
extract($this->getArgs($argstr, $request));
// Any text that is returned will not be further transformed,
// so use html where necessary.
$html = HTML::tt(fmt('%s: %s', $salutation, WikiLink($name, 'auto')),
THE_END);
return $html;
}
};
<small>P
mature lesbiche amateur lesbo tettone lesbiche lesbiche in calore
lesbo show lesbo galleries
swedish lesbians hot lesbians hot nude lesbians hot lesbian
nude lesbian lesbian lovers
sex animal horse sex horse movie sex with horses horse sex
sex animal horse horse sex
lingerie feminine sexy flirt lingerie lingerie shops playboy intimates
xxx lingerie lingerie amateur
nurses uniforms japan uniforms police uniform schoolgirl uniforms
girl scout uniforms uniform xxx
reality porn virtual reality sex reality porn reality usa
reality show reality site
facial first facial redhead la face facial movie
face fuck facial massive
cruel fucking cruel stories trample cruel cruel drawing
cruel fucking cruel drawing
</small>
lib/pear/DB/common.php:741: Notice[8]: Only variable references should be returned by reference
lib/WikiUser.php:59: Notice[8]: Only variables should be assigned by reference
lib/pear/DB/common.php:741: Notice[8]: Only variable references should be returned by reference
lib/pear/DB/common.php:741: Notice[8]: Only variable references should be returned by reference
lib/pear/DB/common.php:741: Notice[8]: Only variable references should be returned by reference
lib/Template.php:112: Notice[8]: Only variables should be assigned by reference
lib/Template.php:114: Notice[8]: Only variables should be assigned by reference
lib/Template.php (In template 'html'):112: Notice[8]: Only variables should be assigned by reference
lib/Template.php (In template 'html'):114: Notice[8]: Only variables should be assigned by reference
lib/Template.php (In template 'html'):112: Notice[8]: Only variables should be assigned by reference
lib/Template.php (In template 'html'):114: Notice[8]: Only variables should be assigned by reference
lib/Template.php (In template 'body') (In template 'html'):112: Notice[8]: Only variables should be assigned by reference
lib/Template.php (In template 'body') (In template 'html'):114: Notice[8]: Only variables should be assigned by reference
lib/Template.php (In template 'top') (In template 'body') (In template 'html'):112: Notice[8]: Only variables should be assigned by reference
lib/Template.php (In template 'top') (In template 'body') (In template 'html'):114: Notice[8]: Only variables should be assigned by reference
lib/pear/DB/common.php (In template 'navbar') (In template 'top') (In template 'body') (In template 'html'):741: Notice[8]: Only variable references should be returned by reference
lib/Template.php (In template 'body') (In template 'html'):112: Notice[8]: Only variables should be assigned by reference
lib/Template.php (In template 'body') (In template 'html'):114: Notice[8]: Only variables should be assigned by reference
lib/CachedMarkup.php (In template 'browse') (In template 'body') (In template 'html'):427: Notice[8]: Only variables should be assigned by reference
lib/pear/DB/common.php (In template 'browse') (In template 'body') (In template 'html'):741: Notice[8]: Only variable references should be returned by reference
lib/pear/DB/common.php (In template 'browse') (In template 'body') (In template 'html'):741: Notice[8]: Only variable references should be returned by reference
lib/CachedMarkup.php (In template 'browse') (In template 'body') (In template 'html'):427: Notice[8]: Only variables should be assigned by reference
lib/pear/DB/common.php (In template 'browse') (In template 'body') (In template 'html'):741: Notice[8]: Only variable references should be returned by reference
lib/pear/DB/common.php (In template 'browse') (In template 'body') (In template 'html'):741: Notice[8]: Only variable references should be returned by reference
lib/Template.php (In template 'browse') (In template 'body') (In template 'html'):112: Notice[8]: Only variables should be assigned by reference
lib/Template.php (In template 'browse') (In template 'body') (In template 'html'):114: Notice[8]: Only variables should be assigned by reference
lib/Template.php (In template 'browse-footer') (In template 'browse') (In template 'body') (In template 'html'):112: Notice[8]: Only variables should be assigned by reference
lib/Template.php (In template 'browse-footer') (In template 'browse') (In template 'body') (In template 'html'):114: Notice[8]: Only variables should be assigned by reference
lib/Template.php (In template 'actionbar') (In template 'browse-footer') (In template 'browse') (In template 'body') (In template 'html'):112: Notice[8]: Only variables should be assigned by reference
lib/Template.php (In template 'actionbar') (In template 'browse-footer') (In template 'browse') (In template 'body') (In template 'html'):114: Notice[8]: Only variables should be assigned by reference
lib/Template.php (In template 'body') (In template 'html'):112: Notice[8]: Only variables should be assigned by reference
lib/Template.php (In template 'body') (In template 'html'):114: Notice[8]: Only variables should be assigned by reference