MyBB Community Forums

Full Version: difference between newreply_end and newreply_do_newreply_end?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi all

can any body a bit guide that what is difference between newreply_end and newreply_do_newreply_end?
The order of newreply hooks:

1. newreply_start
2. newreply_do_newreply_start
3. newreply_do_newreply_end
4. newreply_end

The above was the basic order.

Now, the first hook, i.e. newreply_start runs as soon as newreply.php is loaded. Then, when you wrote up your reply and click Post reply button, newreply_do_newreply_start and newreply_do_newreply_end hooks comes in effect.

And in the end, newreply_end takes effect.
3 more questions, if any one can guide?

1. any page or tutorial showing order of all hooks running order like
hooks run for new forum
hooks run for new thread.
etc

2. if i want to modify post content before saving / insert which hook is needed?

3. if post is published and i want to generate email to admin that a post is generated, which hook is most suitable between 3. newreply_do_newreply_end and 4. newreply_end ?

i have made a plugin which emails admin for new post or reply.

i am not sure which hook is to use

$plugins->add_hook("newreply_do_newreply_end", "email_new_reply");
$plugins->add_hook("newreply_end", "email_new_reply");

function email_new_reply()
{
my_mail('[email protected]', 'new post published','hi admin \n a new post is published.' , '[email protected]');
}