downloadsuk
07-26-2010, 12:31 AM
{vb:raw template_hook.navtab_start}
I thought about putting this in my old thread, but I thought I would put this here. This is a question but also to see if I have my own understanding correct.
In vBulletin, I think I finally get why hooks are in some places - so you don't have to edit the code, you can call blobs of your own code down from somewhere and use them in context at pre-defined events in the code without having to include a PHP file globally at the head of every template.
However, see my previous post here (https://vborg.vbsupport.ru/showthread.php?t=247289). I want to know if the hooks import any other code when they are called?
Is there a way to find out what code is called by these hooks, or are they exclusively for bringing in arbitrary code from plugins?
This would be incredibly helpful to know and is not included anywhere in the documentation.
For example
{vb:raw template_hook.header_userinfo}
<vb:comment><p>{vb:rawphrase last_visited_x_at_y, {vb:raw pmbox.lastvisitdate}, {vb:raw pmbox.lastvisittime}}</p></vb:comment>
I found this in the header template. And I also found a bug report from a while back with a guy asking for a hook in the header, which got added. It was meant to replace the comment code? So WTF?
I am so confused right now. Is there is some hidden meaning to the hooks, and what variables are available in scope / context when they are called.
Any help you can give is really appreciated. I have tried searching, but as I can tell, this hasn't really been asked before.
I thought about putting this in my old thread, but I thought I would put this here. This is a question but also to see if I have my own understanding correct.
In vBulletin, I think I finally get why hooks are in some places - so you don't have to edit the code, you can call blobs of your own code down from somewhere and use them in context at pre-defined events in the code without having to include a PHP file globally at the head of every template.
However, see my previous post here (https://vborg.vbsupport.ru/showthread.php?t=247289). I want to know if the hooks import any other code when they are called?
Is there a way to find out what code is called by these hooks, or are they exclusively for bringing in arbitrary code from plugins?
This would be incredibly helpful to know and is not included anywhere in the documentation.
For example
{vb:raw template_hook.header_userinfo}
<vb:comment><p>{vb:rawphrase last_visited_x_at_y, {vb:raw pmbox.lastvisitdate}, {vb:raw pmbox.lastvisittime}}</p></vb:comment>
I found this in the header template. And I also found a bug report from a while back with a guy asking for a hook in the header, which got added. It was meant to replace the comment code? So WTF?
I am so confused right now. Is there is some hidden meaning to the hooks, and what variables are available in scope / context when they are called.
Any help you can give is really appreciated. I have tried searching, but as I can tell, this hasn't really been asked before.