Plugins
From PunBB Resource Wiki
Admin plugins are modules for the PunBB admin interface that can be installed by simply dropping the plugin script in the plugins/ directory. See the example plugin for information on how to write your own plugin. Here are a few notes of interest for aspiring plugin authors:
- If you want to display a message via the message() function, you must do so before calling generate_admin_menu($plugin).
- Plugins are loaded by admin_loader.php and must not be terminated (e.g. by calling exit()). After the plugin script has finished, the loader script displays the footer, so don't worry about that. Please note that terminating a plugin by calling message() or redirect() is fine though.
- The action attribute of any and all <form> tags and the target URL for the redirect() function must be set to the value of $_SERVER['REQUEST_URI']. This URL can however be extended to include extra variables (like the addition of &foo=bar in the example plugin).
- If your plugin is for administrators only, the filename must have the prefix "AP_". If it is for both administrators and moderators, use the prefix "AMP_". The example plugin has the prefix "AMP_" and is therefore available for both admins and moderators in the navigation menu.
- Use _ instead of spaces in the file name.
- Since plugin scripts are included from the PunBB script admin_loader.php, you have access to all PunBB functions and global variables (e.g. $db, $pun_config, $pun_user etc).
- Do your best to keep the look and feel of your plugins' user interface similar to the rest of the admin scripts. Feel free to borrow markup and code from the admin scripts to use in your plugins.
- Plugins must be released under the GNU General Public License or a GPL compatible license. Copy the GPL preamble at the top of this file into your plugin script and alter the copyright notice to refrect the author of the plugin (i.e. you).

