![]() |
How to use a hook?
Hello,
Instead of editing a template every time i've done an update, I would like to use the hook system so this is done automatically. But I'm not sure how I can use this system. For instance, let's say I want to include some HTML at this hook location: $template_hook[postbit_user_popup] I would also like to use the <if condition=" statement in the hook... How could I achieve this then? |
You'll need to use a plugin to put the code in and then go:
PHP Code:
|
Quote:
Now I've made a plugin at the hook location postbit_display_complete since I could not find postbit_user_popup... The code I used in the plugin: Code:
$template_hook[postbit_user_popup] .= "<if condition=/"($bbuserinfo[usergroupid]==5 || $bbuserinfo[usergroupid]==6 || $bbuserinfo[usergroupid]==7)/"> Code:
Parse error: syntax error, unexpected '(' in /home/user/domains/mydomain/public_html/forum/includes/class_postbit.php(294) : eval()'d code on line 1 |
Do all your conditions/coding before putting anything into your template_hook. For instance, instead of this in your hook:
PHP Code:
PHP Code:
|
Ok done. Now I get this:
Code:
Parse error: syntax error, unexpected T_STRING in /home/user/domains/mydomain/public_html/forum/includes/class_postbit.php(294) : eval()'d code on line 3 |
Since I have no idea what is now in your plugin, I can't possibly suggest what may be wrong. You would have to change a lot more than what I just posted. You need to have all your conditions done outside of the template_hook code.
|
Quote:
PHP Code:
|
Quote:
{{{Lynne hangs her head in shame....}}} |
Ok I changed that, so this is what I have now:
Plugin information: 1) Hook Location: postbit_display_complete 2) Plugin PHP Code: Code:
$template_hook[postbit_user_popup] .= "<if condition=\"($bbuserinfo[usergroupid]==5 || $bbuserinfo[usergroupid]==6 || $bbuserinfo[usergroupid]==7)\"> Result in showthread.php: Code:
Parse error: syntax error, unexpected T_IF in /home/user/domains/mydomain/public_html/forum/includes/class_postbit.php(294) : eval()'d code on line 14 |
is there a real coder in the house who can assist Lynne as she assist another guy?
hum, oh... i am ok, here is how you do it: PHP Code:
|
All times are GMT. The time now is 06:54 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|