diff -r 000000000000 -r f9ffdbd96607 punbb/plugins/AMP_Example.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/punbb/plugins/AMP_Example.php Wed Jul 11 21:01:48 2007 -0400 @@ -0,0 +1,145 @@ + 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 form of this example plugin). +## +## 4. 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_". This example plugin has the +## prefix "AMP_" and is therefore available for both admins and +## moderators in the navigation menu. +## +## 5. Use _ instead of spaces in the file name. +## +## 6. 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). +## +## 7. 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. If you create your own styles they need to be added to +## the "base_admin" style sheet. +## +## 8. 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). +## +## + + +// Make sure no one attempts to run this script "directly" +if (!defined('PUN')) + exit; + +// Tell admin_loader.php that this is indeed a plugin and that it is loaded +define('PUN_PLUGIN_LOADED', 1); + +// +// The rest is up to you! +// + +// If the "Show text" button was clicked +if (isset($_POST['show_text'])) +{ + // Make sure something something was entered + if (trim($_POST['text_to_show']) == '') + message('You didn\'t enter anything!'); + + // Display the admin navigation menu + generate_admin_menu($plugin); + +?> +
+

Example plugin

+
+
+

You said "". Great stuff.

+

Go back

+
+
+
+ +
+

Example plugin

+
+
+

This plugin doesn't do anything useful. Hence the name "Example".

+

This would be a good spot to talk a little about your plugin. Describe what it does and how it should be used. Be brief, but informative.

+
+
+ +

An example form

+
+
+
+
+ Enter a piece of text and hit "Show text"! +
+ + + + + +
Text to show
+ + The text you want to display. +
+
+
+
+
+
+
+