Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How should I get started with Mybb plugins?
#3
The thing that took me a while to grasp was hooks. This is how you use them:

PHP Code:
$plugins->add_hook('global_start''plugin_name'); 

Unsurprisingly, global_start is a hook run near the start of global.php... basically when global.php is run it runs the global_start hook, and find all plugins that use that hook. Then, in the plugins that use it, it just runs the function with the name you specified in the code above. So, here, it would look for a function called plugin_name and just run it whenever the global_start hook is run. There's a list of hooks here. Adding templates/settings is easy and you can pretty much copy that from other plugins, there's only really one way of doing those.
MyBB Support Team Lead
Reply


Messages In This Thread
RE: How should I get started with Mybb plugins? - by MattR - 12-18-2009, 04:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How To Install MyBB | MyBB Installation Guide BreShiE 2 1,417 03-10-2012, 06:33 AM
Last Post: BreShiE
  MYBB Plugins Crystal 11 2,556 09-16-2011, 11:44 PM
Last Post: Crystal
  What is your favorite mybb plugins? ELY_M 2 1,238 09-15-2011, 04:42 AM
Last Post: HaX420
  Creating Mybb Plugins Closed Account 5 2,185 09-12-2011, 08:45 PM
Last Post: AceInfinity
  MyBB question @OMNI or any other mybb Guru's 0xE9 13 29,617 07-28-2011, 01:29 PM
Last Post: Pompano

Forum Jump:


Users browsing this thread: 1 Guest(s)