MyBB Community Forums

Full Version: I have a question about the plugin system
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I wonder how it works!
I mean when u put a plugin in plugins folder and acivate it does it modify files cuz it cant just add extras like that without editing files(not just inserting a query or two)
It's the 8th wonder of the world. Government Conspiracy...we're not supposed to know. Wink
They're called hooks. Code in the plugin makes the forum perform tasks by using those hooks, which is how they work without having to modify code in original mybb files...at least most of the time no core file modifications are needed.
I have another question whenever i find add_hooks("some plugin"); this plugin isnt at the plugin folder, where is it?
The hook isn't the plugin, so you won't find it in that directory. It's the name of the hook itself, which is just another line of code that the plugin uses to function.
The code that handles the plugins are in inc/class_plugins.php

Basically, in the MyBB code, there are a bunch of $plugins->run_hooks('name of hook'); These commands run any functions that have been "hooked" in by $plugins->add_hook('name of hook'); in the plugins.