PDA

View Full Version : Hook behaviour


pxd
09-17-2010, 12:40 PM
Hello,

I am trying to unserstand the hooks that are used to add extra functionality without applying changes to the php files.

The way I see it, any code inserted into a plugin attached to a hook location, for instance "threadbit_display", which is part of a while loop, would be executed right after the following line inside forumdisplay.php file:

($hook = vBulletinHook::fetch_hook('threadbit_display')) ? eval($hook) : false;

If this is correct, then would someone please clarify the following situation:

If I add a "continue;" directly in the forumdisplay.php file right after the $hook call, then it works properly. If I insert "continue;" via a plugin hooked to the threadbit_display location, then a fatal error comes up:

Fatal error: Cannot break/continue 1 level in public_html\forumdisplay.php(1036) : eval()'d code on line 41.

This shouldn't be happening if I got the hooks functionality right. Oh well, it does have to do with the limitations of the eval() statement there. Sadly I cannot achieve what I'm after in a way that would not require file edits.