UberBots Website Documentation
Modules
Content on the site is stored in modules. The main modules are BBCode modules and HTML modules. BBCode modules use BBCode for input (same as forums).
Module Creation
To create a module, you need to be sure that it will have a specific purpose, and its features will not be more useful in an already existing module.
- Edit /includes/module.php
In the function 'getModule,' add a new case to the switch statement. Make sure the case number is one higher than the previous highest number. This will become the module id.
In that case, add the line: 'return new mod_modName()'. Make note of modName, as this will be needed later. - Make module directory
- In the /modules directory, create a new subdirectory named mod_modName
- In that directory, create a PHP file named mod.php - In that PHP file, start with the basic module template (in Module Template.txt)
- Add an image named icon.png to the directory - This image is the module icon shown in the add module list. This image should be 16x16 - Create the Module
- Start from the Module Template - Make the following modifications to the template:- fill in header comment
- rename the class to mod_modName (make sure this is consistent!)
- make title, description, and path variables into what they should be
- in the setup function, make the sqlNames and sqlDefaults variables into whatever is appropriate
- add code as needed to the render, renderEdit, and edit functions (see comments for description of what goes where)
- make sure to comment your code so future webmasters can decipher it!