MyBB Community Forums

Full Version: Mod CP Plugin Hooks
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'm sure this has been bought up before but there's not been any changes made yet for it.

The Mod CP is a great feature with loads of potential but it's nearly impossibly to write plugins for. There's only 5 hooks; 3 for reports, one for the ban list, one at the start. Most actions have no hooks at all, not including modcp_start which is obviously always available, but that hook is often just as unusable as having no hooks at all. I was going to write a quick plugin involving banning but gave up because I had to copy a load of code from modcp.php; I had to use modcp_start, so all the code to check the validity of the ban and whether you have permission to do it etc is after the hook has been called, so to make those same checks for my code I had to copy and paste everything, and then the same code, including queries, would be run again later on in the default code. If there was a hook somewhere in the action after these checks had been done it'd be so much easier and more efficient.

I wouldn't consider this a feature as it's not something that has to be thought about, designed, developed or tested, it'd be a 5 minute copy/paste/edit job. It'd be a shame to have to wait until 2.0 to have a plugin-able Mod CP, if every action had a start and edit hook it'd be so much better.
To make it consistent, I agree. It is a pain modifying the ModCP.
I would agree.

We just need a list of apart from the standard plugin hooks, is there any need for hooks in other mod cp areas?
The edit profile page would be good, I needed it when I was writing my mods can change username plugin.
Just at the start and end of all actions would be fine.
Actually come to think of it it could be good to have some in loops, i.e. when generating each row of the ban list, mod log etc; currently you can't add any extra information here.
(2010-07-18, 06:34 PM)MattRogowski Wrote: [ -> ]Actually come to think of it it could be good to have some in loops, i.e. when generating each row of the ban list, mod log etc; currently you can't add any extra information here.

+1
(2010-07-18, 06:36 PM)ralgith Wrote: [ -> ]
(2010-07-18, 06:34 PM)MattRogowski Wrote: [ -> ]Actually come to think of it it could be good to have some in loops, i.e. when generating each row of the ban list, mod log etc; currently you can't add any extra information here.

+1

+2 that could come in very handy Toungue
I'd like to see more AdminCP hooks as well. Right now its a PITA to add extra fields to existing settings types. Like adding new sorting to the user list.. I have to replace the user list file. PITA.
Will these sneak their way into Gold??
Pages: 1 2