The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Regarding hooks
hii..
can anyone tell me how do we identify hook from the template. like we have $template_hook[profile_ministats_list] in memberinfo_block_ministats template. Now, I don't see any hook with that name in the hooks list. So, how to code at that part ? |
#2
|
|||
|
|||
Template hooks at PHP hooks are different...you need to use a PHP hook to hook template code into a template hook. (If that makes sense.)
So, if I wanted to add some display code to the postbit without a template edit, I'd add a plugin to the postbit_display_complete hook (I believe off the top of my head.) and utilize one of the template hooks in the postbit. I'll post some specific code if no one else does by the time I get back to my dorm. |
#3
|
||||
|
||||
These are two plugin examples from this thread - Template Hook
Using the $template_hook['navbar_buttons_left'] to insert stuff directly using html: PHP Code:
PHP Code:
|
#4
|
||||
|
||||
thank you so much lynne !
btw, do I always have to use global_start hook to use template hooks ? for eg. for $template_hook[profile_ministats_list] in memberinfo_block_ministats template, which php hook should I use ? |
#5
|
||||
|
||||
You don't want to run your code on every page load unless it will need to be used every page load.
Choose a hook that will always be run when the template you are hooking into is running as well. |
#6
|
||||
|
||||
yes I do not want to run my code on every page load.
that is what I asked:- "for $template_hook[profile_ministats_list] in memberinfo_block_ministats template, which php hook should I use ?" |
#7
|
||||
|
||||
Why don't you have a look yourself?
|
#8
|
||||
|
||||
oh sir that is what i asked in my first post !!
"how do we identify hook from the template?" I DID tried to check it from the hooks list but I do not found any for $template_hook[profile_ministats_list] |
#9
|
|||
|
|||
First do a "Search in Templates" find out which template uses that template hook.
Look at the name of the hook it tells you. PROFILE - This means the members profile page so member.php ? MINISTAT - Mini-statistics block LIST - The list section vBulletin make sure they name each one to give as much information. So know you know what file it will probably execute in you can choose a hook from there. |
#10
|
||||
|
||||
thanks opserty !
Now, I find 5 hooks in member.php:- member_start member_start_fetch_user member_execute_start member_build_blocks_start member_complete I tried the following code at all the above 5 hooks but none of them show the output in the Mini Statistics Box. PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|