How to write a MyBB Plugin Base - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Webmaster Support (https://www.supportforums.net/forumdisplay.php?fid=36) +---- Forum: Website Development (https://www.supportforums.net/forumdisplay.php?fid=43) +---- Thread: How to write a MyBB Plugin Base (/showthread.php?tid=19269) |
How to write a MyBB Plugin Base - 0xE9 - 06-03-2011 >>To create a plugin you will need PHP and SQL knowledge.<< Right first things first, to prevent any possible problems we only want our plugin to run when mybb runs it and to prevent users from running it directly. Code: <?php This is just the array of info that will be displayed to the admin on the plugin managment page. Code: function <yourpluginname>_info() Right now we need the install function, This is what will happen when that admin clicks install in the plugin manager. Just a side note some of the functions (ones that are <yourpluginname>_function) will require the name of your plugin file. So replace <yourpluginname> With the name of your php file (without .php). Code: function <yourpluginname>_install() Now incase your install function does anything you dont want being run twice, We need a function to stop them installing it twice without clicking uninstall. Code: function <yourpluginname>_is_installed() Now we add the code for what happens when the plugin is activated (this should probably edit templates you need) Code: function <yourpluginname>_activate() Now we add the deactivate and uninstall functions. Code: function <yourpluginname>_deactivate() This is just the base, In my next tutorial I will Write about how to make the plugin do something and how to use mybb hooks & classes. RE: How to write a MyBB Plugin Base - Иinja - 06-03-2011 Thanks for this... I'm interested in learning how to make a MyBB plugin... I will take this and learn from it. ^^ RE: How to write a MyBB Plugin Base - begginer - 06-04-2011 Thanks a lot. I am learning PHP now. Just bookmarked your tutorial RE: How to write a MyBB Plugin Base - Invincible - 06-04-2011 Indeed a very nice contribution to the forum. Keep it up. RE: How to write a MyBB Plugin Base - Laughynose - 06-04-2011 Hi, this is a very nice contribution to the forum but I have one problem, it's not PHP and MYSQL(UNLESS NEEDED BY PLUGIN) but I'll say you'll need to know MyBB coding, since that's quite different to PHP. RE: How to write a MyBB Plugin Base - 0xE9 - 06-04-2011 (06-04-2011, 11:43 AM)Laughynose Wrote: Hi, this is a very nice contribution to the forum but I have one problem, it's not PHP and MYSQL(UNLESS NEEDED BY PLUGIN) but I'll say you'll need to know MyBB coding, since that's quite different to PHP.True but you will need to know some PHP for functions and maybe SQL if you concider something big. But mybb has its own built in SQL class for use. RE: How to write a MyBB Plugin Base - Laughynose - 06-04-2011 Yes, but MYSQL is not needed for every single plugin, a big majority yes. RE: How to write a MyBB Plugin Base - 0xE9 - 06-04-2011 (06-04-2011, 12:04 PM)Laughynose Wrote: Yes, but MYSQL is not needed for every single plugin, a big majority yes.Yeah, I'll take out the bit about SQL. The next tut I make will be about making a plugin that requires SQL. |