PHP-Nuke Addons & Modules System
================================
Since PHP-Nuke 5.0 you can add new modules, addons or plugins simply
copying the addons files into a directory. With this feature, PHP-Nuke
gains modularity and you, the webmaster, the choice to install and/or
unistall the modules you want with an easy step.
This document has two main parts, one for webmasters/users and other
for Addons developers.
Please read it carefully and remember that this system, as the whole
PHP-Nuke comes without any warranty and all you do from here is under
your own responsability and risk. Always remember to backup your
database and all your files before doing anything.
====================================
1.- Information for Webmasters/Users
====================================
We start on the "modules" directory where you can add or delete all the
modules, addons or plugins you want.
The directories names under /modules/ dir have a rule to work properly:
a) All spaces are filled with "_", so if you have a module called for example
Web Links, your directory name need to be Web_Links
Modules links will be automaticaly added to the Main Menu block at the end
of your entries. The selected list method, instead of the use of LI html tag,
is:
· Module Name
This is because we want to provide HTML 4.0 Transitional compatibility, if you
want to change this, just edit mainfile.php file on the function mainblock(), but
try to stay under the HTML standards and eliminate any
Welcome
to redesign Website of Hajduk Split in english. Here you can find many basic
informations about club, their supporters, and everything other coneceted to
club. If you have some questions feel free to connect to forum and ask.
There is special part of forum for foreign visitors so you don't need to be
registered there to post your question.p, for example.
d) On the Addon directory name do not use blank spaces, instead use the character
"_". For example if you want to create an addon called "The Web Ring", the
directory name will be "The_Web_Ring".
e) Any link on the addons files need to have the following syntax:
http://www.yoursite.com/modules.php?mop=modload&name=The_Web_Ring&file=index
where "modules.php?mop=modload" is required as is, "&name=The_Web_Ring" is the
directory name of the addon and "&file=index" declares the file name to access,
without the .php extension. The extension will be added automaticaly.
Easy, no? Ok, if you need to link to a specified function to any file of your
addon, to the above URL just add:
&switchname=name
So, if you declared a switch like:
switch(http://www.torcida-online.com/spacer.gif) {
case "func-one":
funct-one();
break;
}
you will call it:
http://www.yoursite.com/modules.php?mop=modload&name=The_Web_Ring&file=index&func=func-one
if your function need to receive variables values, your switch will look like:
switch(http://www.torcida-online.com/spacer.gif) {
case "func-one":
funct-one($xid, $xname);
break;
}
your link need to be:
http://www.yoursite.com/modules.php?mop=modload&name=The_Web_Ring&file=index&func=func-one&xid=$xid&xname=$xname
If you need to use forms in your addon, use this method:
but remember to not use reserved variables names like "name" and/or "file" and use a switch
variable different of "$mop".
Hope that this rules are clear.
Another important note is that you need to know that modules system have
reserved variables, they are:
$name: Used to declare the addon name
$file: Used to declare the filename in use
$mop: Used for the modules.php switch
$index: Used to add or remove the right blocks
$modload: The call
$mod_active: Used to check modules' status
As an additional and interesting note, you can make that your addon show left
and right blocks by using the $index variable. At the begining of your file
just declare the varibale:
$index = 1;
If the value is "1" your addon will show the right blocks, if the value is "0"
will only show the left blocks, of course with the default or user selected
theme layout.
Remember that you can also use your own language translation file, called
for example lang-english.php so we can create language compatibility with
the rest of the site using the $language variable taken from config.php
Well, this was not a very big documentation but a basic one to let you start
using and/or making your addons/modules/plugins. Hope that you enjoy this new
feature of PHP-Nuke.
=============================================================================
NOTE: To stay under HTML 4.01 Transitional standard is very important that
you substitute all "&" characters in the URLs with "&" tag. So, for
example, the URL:
need to be written:
without this, your pages will not validate as HTML 4.01 compatible.
=============================================================================
COPYRIGHT WARNING!!!
Since PHP-Nuke is licensed under the GNU/GPL License, whatever module,
addon, plugin, theme, block, etc. that needs any PHP-Nuke part of code
to properly run need to be released under a GPL compatible license.
Please read the GPL License carefully, it's in the included COPYING file
=============================================================================
Have fun now!