]> jfr.im git - irc/unrealircd/unrealircd-webpanel-plugins.git/commitdiff
Update example_plugin.php with more description
authorValerie Pond <redacted>
Wed, 21 Jun 2023 23:55:52 +0000 (00:55 +0100)
committerGitHub <redacted>
Wed, 21 Jun 2023 23:55:52 +0000 (00:55 +0100)
example_plugin/example_plugin.php

index cdcf38c3b747410e8023cd9e2bd3aae6937fd343..80335b972560b0015bf6d8bb50e2a7a8c6ac8370 100644 (file)
@@ -1,5 +1,15 @@
 <?php
+/*
+  --======-- Example Plugin --=======--
 
+  Below are the credentials needed.
+  You must specify them in this format.
+  The only things that are not mandatory
+  are icons and screenshots. the rest
+  are mandatory or your plugin will not
+  be accepted.
+
+*/
 /**
   @title Example Plugin
   @author Valware
 
 class example_plugin
 {
-       public $name = "Example plugin";
-       public $author = "Valware";
-       public $version = "1.0";
-       public $description = "An example plugin to show how to make stuff";
-       public $email = "v.a.pond@outlook.com";
+       /* You must specify these here for internal use
+        * All of these are mandatory or your plugin will not work.
+       */
+       public $name = "Example plugin"; // Name of your plugin
+       public $author = "Valware"; // Name or handle of your lovely self
+       public $version = "1.0"; // Version of this plugin
+       public $description = "An example plugin to show how to make stuff"; // Description of your beautiful plugin
+       public $email = "v.a.pond@outlook.com"; // An email people can contact you with in case of problems
 
+       /** This is run on plugin load. You can add hooks and initialize whatever databases
+        * that you think you might need.
+       */
        function __construct()
        {
+               /**The hook for the navigation bar.
+                * The first argument is the HOOKTYPE we're using. In this case
+                * we're using NAVBAR to add our page to the navigation bar.
+                * For a full list of hooks, see this page:
+                * https://github.com/unrealircd/unrealircd-webpanel/blob/main/Classes/class-hook.php
+                *
+                * The second argument references the function you want to include
+                * in your hooked function. In this example we are referencing a
+                * method (function) in this class (example_plugin)
+               */
                Hook::func(HOOKTYPE_NAVBAR, 'example_plugin::add_navbar'); 
        }
 
+       /** This is the method (function) that we have hooked.
+        * Now we can do things. Make sure to check the relevant hooks
+        * for the right variables to use.
+        * We use variable reference (&) on this hook
+       */
        public static function add_navbar(&$pages)
        {
                $page_name = "Example";