MyBB Community Forums

Full Version: Coder: Difference between archive_thread_post and archive_thread_end?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi
I intend to modify a plugin myself since the original author told me that he is too busy. The plugin is http://mods.mybb.com/view/hide-to-guests
$plugins->add_hook('showthread_end', 'HideToGuests_post');
$plugins->add_hook('archive_thread_post', 'HideToGuests_archive');

whats the Difference between archive_thread_post and archive_thread_end

and Whats the hook function for RSS and ATOM?

Do I have to something like this:
$plugins->add_hook('misc_syndication_end', 'HideToGuests_rss');

And whats the hook for posts preview?

Thanks a lot!

References: http://wiki.mybb.com/index.php/MyBB_Plugin_Hooks
archive_thread_post is called for every post

However, the archive has very different behaviour to full mode in general. The full mode collects all contents and prints the whole content out at the end (usually along with pre/post_output_page hooks).

The archive on the other hand spits things out as it goes. So at the archive_thread_end hook all the posts will most likely already be on the road so to speak. So if the plugin does something to the output it might have to do so earlier in the archive mode than in the full version.

Just a guess, without looking at any code, it's really not possible to tell for sure.

When trying to find a hook for a specific something, I just add a debug message in the inc/class_plugin.php that prints out every hook that's called (run_hook and run_hook_by_ref functions). If you really want to work with hooks and plugins you have to get your hands dirty anyway, if you don't look at whats calling the hook you only get half the picture...