MyBB Community Forums

Full Version: Hook Requests
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello every body~
i have some suggestions~
when i work on a plugin for avatars i find that some of functions can program better and this version of them has not any ability to develope!
i want to use upload_avatar() function to upload avatars that my plugin fetched from a remote url . but this function only works with browser uploaded ($_FILE array) files. i think that this function must break into two functions! first check that it is a really uploaded file and second checks dimantion and size of it! this way we can use second function directly in my plugin case and mybb it self can use two functions in sequence.
and also~ i find that functions_upload.php file does not run any hook !! i think functions of this file have potential for runing hooks!
for e.g.:
upload_file_started
remove_file_started (for loging for instance)
or etc.
aloso in functions.php this functions can run hooks
mymail
getposticons
mysetcookie
myunsetcookie
mygetarraycookie
mysetarraycookie
pageheaders
and etc

you know that hooks and plugins are most developing tool for this software! its better to work more in this section .
bests
imei
$plugins->run_hooks("newreply_do_newreply_process");

newreply.php

That is only called when the user creates a new reply. There doesn't seem to be one when they update their post (the if statement above it). I'd much rather use this than "newreply_do_newrpely_end" (lol just noticed typo in the handle) because it saves me executing a new query every new/updated reply.

I'll be bumping this topic a lot over the next few weeks me thinks. Working with the posting functions and pages Smile
As a former vBulletin user, I really enjoy the plugin system standard with MyBB since it requires a lot less code editing (even more so with mods like EasyInstall) than it's counterparts, save a few applications. It is more than what comes stock with a lot of BBS applications.

Although, from a coder's stand point, I have yet to see real depth in locations of the actual hooks internally in the software. Although the system is good, it completely lacks plugins in the area of Forum Displaying (I found 3 locations, which is less than what I need), and as far as I can tell, there are NO locations in the admin control panel (this is what would make administrating custom plugins with options a LOT easier).

That being said, I would like to see a hook in forumdisplay.php right before the execution of the query which retrieves the thread list from the database so that it can be manipulated. I also would like to see hooks in the actual admincp which would allow you to, at the very least, add your own links to the admincp menu listing without having to specify code modification. I would also like to move for an official thread where users and coders can request hook locations rather than creating erratic, vaguely titled threads (yes, I see the irony in this) throughout several forums.

Oh, great job on this forum application. I have to say, it is easily one of the best forum applications I have seen this early in development...ever.
I would just add your own hook for now Smile

Then put in your instructions where the hook is needed. Most people should have no problem pasting a single line of code into one of the files.

Although I agree that a few more official hooks in important places would be good.
For the next version, we will look into adding more hooks into some places where there currently are few or none. Thank you for your suggestion Smile
Shochu Wrote:I would just add your own hook for now Smile

Then put in your instructions where the hook is needed. Most people should have no problem pasting a single line of code into one of the files.

Although I agree that a few more official hooks in important places would be good.

That certainly is a logical answer. Nevertheless, I am trying to veer away from requiring the end-user to have to manually make file edits. Although EasyInstall does help that, if the mod calls for a modification to an already heavily modifed file, the user (and EI-like script) will not be able to change the file if the do not have any coding experience and/or do not understand exactly what the modification does and how it does it. Although more hooks would not completely remedy that, with some structural changes (such as placing queries to be run in variables before they are executed, and placing a hook in a spot before the actual query execution and variable declaration), you could change how much file editing the end-user actually has to do and subsequently decrease the chance of user-created error.

Edit: Additionally, although I am not exactly clear where MyBB stands with this, most developers will not officially support their software if the files have been manually edited by the end-user. I can understand this and side with the developer, because frankly, it is hard to find fix things when you (the developer) and the end-user are running different batches of code (as slight as the changes may be). With plugins, you can disable all the custom code leaving only the original, un-altered code so that you may determine if the bug is actually in the original software or in custom code that may be misformed or conflicts with current code.
http://community.mybboard.net/showthread.php?tid=5131

Maybe a sticky of hook requests? You (MyBB team) could look over them and see if they are worth adding?
Bump.

editpost.php - editpost_deletepost - Useless. I'm tracking down all the places I can delete a thread. Moderation.php was ok but this one editpost.php is useless. It's before any checks (such as permissions) . So unless I want to perform my own checks (copy/paste of MyBB code = redundancy) I can't do anything.

I want to get the information from each post in a thread. I can use moderation_do_deletethread in moderation.php ok, but I can't do anything in editpost.php. delete_thread in inc/functions.php is useless as well as it only returns the thread information _after_ every trace of the thread has been removed.

Any chance of getting it moved or anyone has ideas on what to do?


EDIT: Ok. They are like 4 places to delete a thread or a topic and some you aren't sure until you figure out if it's the first post. Most of the handles occur before this has all happened. An extra handle (or move the one there) in inc/functions.php in the function deletethread would be nice. One between getting the information and deleting it. Then you can have one at the end if you want as well.
decswxaqz Wrote:http://community.mybboard.net/showthread.php?tid=5131

Maybe a sticky of hook requests? You (MyBB team) could look over them and see if they are worth adding?

Merged that thread into this one.
Is there going to be any feedback on this?

Found another handle problem. do_multideleteposts in moderation.php does not have any handles associated with it, nor does do_multideletethreads. If anyone deletes threads/posts via inline moderation, I can't tell or use any of the data before it's deleted. The delete_post is called but as I have said above, it's called after the information has been deleted and I can't access it from the plugin.

A simple "No we won't do anything you have asked" is fine. I'll ask people to add my own plugin handles but if you plan on introducing them (and releasing new code) soon then i'll just say it's compatible with version x.y.


EDIT same for moving threads - do_multimovethreads
Pages: 1 2