Ok, lets start by writing a simple plugin. Basically, each plugin is a PHP class that inherits from the predefined class NucleusPlugin. Below is an example of a HelloWorld-plugin:
<?php
class NP_HelloWorld extends NucleusPlugin {
// name of plugin
function getName() {
return 'Hello World';
}
// author of plugin
function getAuthor() {
return 'Wouter Demuynck';
}
// an URL to the plugin website
// can also be of the form mailto:foo@bar.com
function getURL()
{
return 'http://nucleuscms.org/';
}
// version of the plugin
function getVersion() {
return '1.0';
}
// a description to be shown on the installed plugins listing
function getDescription() {
return 'Just a sample plugin.';
}
function doSkinVar($skinType) {
echo 'Hello World!';
}
}
?>
NP_HelloWorld.php, and put it in your plugins directory. Make sure that there are no spaces after the last ?> or before the first <?.. By the way, NP stands for "Nucleus Plugin" :-)
<%plugin(HelloWorld)%>
Some notes: the name (HelloWorld) is case sensitive!
plugin-skinvarSo, that wasn't so hard after all. Read on to find out more.