MyBB Community Forums

Full Version: More hooks needed
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I know there is some spots that there is no hooks in the 1.6 series that there really should be. There is only 1 hook in the file xmlhttp.php and that isn't going to help if you are using a plugin that modifies a message in a way. Right before it sends back the message, I believe there should be a hook so if a plugin author wanted to use it, they can. In 1.6 I resorted to using a file edit due to a lack of a hook.

I'm sure there are other spots hooks are needed. Maybe others can suggest them in this thread.
While we're here, I'll reiterate a request I made whilst on the team: post insert hooks within datahandlers. I'm just interested to see how much support it gets (if any).
@Euan Any special reason you want to do or use that? Smile
We can access data details as well as their IDs within the database after insert. This is useful for example in MyAlerts where I want to reference the content ID and also store some details (eg: PM title, post excerpt) but don't want to run queries.
Euan, yes, that's indeed very useful. The two custom plugins that I run utilizes that function too and it is indeed PITA for me to opt the other way around. Too much messy and unproductive code as well as extra queries. So yes I think a hook there will be indeed very useful.
I agree with Euan and also, http://community.mybb.com/thread-140337.html -- "global_templates" <-- would've saved me a lot of anguish on my last plugin job Dodgy
There are several hooks I would like to see added:

-A polls_start at the beginning of the polls.php file.
-A reputation_vote hook just before the eval("\$reputation_votes .= \"".$templates->get("reputation_vote")."\";"); in the reputation.php file.
-A hook in the admin/module/home/index.php file that allows you to output a notice on the Admin CP index page.
-A hook somewhere around the login function of the Admin CP.
-Several others I was going to make a pull request for.
I'd also certainly agree with having a hook around ACP login. Very useful.
Quote:-A hook in the admin/module/home/index.php file that allows you to output a notice on the Admin CP index page.

Yes, definitely would be useful.
Sorry to bump this, but another place hooks should be added is at the end of the various forms in the Admin CP. This would make it much easier to add to those forms.

The hooks could be placed just before $form_container->end(); in the Admin files.
Pages: 1 2