Support Forums

Full Version: How should I get started with Mybb plugins?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm really wanting to get started with making plugins for Mybb and I've read Omni's tutorial on Mybbcentral, and the Mybboard.net wiki on authoring plugins. I still haven't grasped the concept. Can somebody let me know what I need to do to get started with this. And don't say something like "Learn PHP" because that's way to broad. What do I specifically need to know?
Start by viewing some plugins and how they work. Do easy plugins that use one hook and are simple. You can obtain a lot of GNU/GPL plugins at Mybboard Mods section.
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.
Alright, I'm going to start looking into some basic plugins and see if I can figure something out.
Lol I'm still pulling a white screen for my twitter plugin Sad I'll get it though, I have all day tomorrow and sunday to work on it. I hope to get it released, it'd be nice to have something next to the little away man with your twitter ID.
(12-18-2009, 06:36 PM)Grizzly Wrote: [ -> ]Lol I'm still pulling a white screen for my twitter plugin Sad I'll get it though, I have all day tomorrow and sunday to work on it. I hope to get it released, it'd be nice to have something next to the little away man with your twitter ID.

And who's idea was that...Whistle
Feel free to PM me the code and I'll have a look Smile
Well, it's a wasted effort now, it was for a twitter plugin and Omni already did what I was going to do lol.