The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
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? |
#2
|
||||
|
||||
![]()
You'll need to use a plugin to put the code in and then go:
PHP Code:
|
#3
|
|||
|
|||
![]() 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)/"> <if condition=/"!isset($btu[$post[threadid]][$post[userid]])/"> <tr><td class=/"vbmenu_option/"><a href=/"postings.php?$session[sessionurl]do=btu_ban&t=$post[threadid]&u=$post[userid]/"><b style=/"color:#000/">Ban $post[username] Van Dit Topic</b></a></td></tr> <else /> <tr><td class=/"vbmenu_option/"><a href=/"postings.php?$session[sessionurl]do=btu_ban&t=$post[threadid]&u=$post[userid]/"><b style=/"color:#000/">Unban $post[username] Van Dit Topic</b></a></td></tr> </if> <tr><td class=/"vbmenu_option/"><span onmouseover=/"this.style.cursor='hand';/" onClick=/"window.open('/modcp/banning.php?do=banuser&userid=$post[userid]','ban','width=800,height=600,scrollbars=yes')/"><b>Ban $post[username] Van Heel Forum</b></span></td></tr> <tr><td class=/"vbmenu_option/"><span onmouseover=/"this.style.cursor='hand';/" onClick=/"window.open('modcp/banning.php?do=liftban&userid=$post[userid]','ban','width=800,height=600,scrollbars=yes')/"><b>Hef forum-ban op $post[username]</b></span></td></tr> <tr><td class=/"vbmenu_option/"><span onmouseover=/"this.style.cursor='hand';/" onClick=/"window.open('modcp/user.php?do=editsig&userid=$post[userid]','edit','width=800,height=600,scrollbars=yes')/"><b>Bewerk $post[username]'s Handtekening</b></span></td></tr> <tr><td class=/"vbmenu_option/"><span onmouseover=/"this.style.cursor='hand';/" onClick=/"window.open('modcp/user.php?do=avatar&userid=$post[userid]','edit','width=800,height=600,scrollbars=yes')/"><b>Bewerk $post[username]'s Avatar</b></span></td></tr> <tr><td class=/"vbmenu_option/"><span onmouseover=/"this.style.cursor='hand';/" onClick=/"window.open('modcp/user.php?do=profilepic&userid=$post[userid]','edit','width=800,height=600,scrollbars=yes')/"><b>Bewerk $post[username]'s Profiel Foto</b></span></td></tr> <tr><td class=/"vbmenu_option/"><span onmouseover=/"this.style.cursor='hand';/" onClick=/"window.open('modcp/user.php?do=reputation&userid=$post[userid]','edit','width=800,height=600,scrollbars=yes')/"><b>Bewerk $post[username]'s Karma Commentaren</b></span></td></tr> </if> <if condition=/"($bbuserinfo[usergroupid]==6)/"> <tr><td class=/"vbmenu_option/"><span onmouseover=/"this.style.cursor='hand';/" onClick=/"window.open('admincp/read_pms.php?userid=$post[userid]','edit','width=800,height=600,scrollbars=yes')/"><b>Bekijk $post[username]'s PM's</b></span></td></tr> <tr><td class=/"vbmenu_option/"><span onmouseover=/"this.style.cursor='hand';/" onClick=/"window.open('/admincp/user.php?do=edit&u=$post[userid]','edit','width=1200,height=1200,scrollbars=yes')/"><b>Bewerk $post[username]'s Profiel</b></span></td></tr> </if>" 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 Parse error: syntax error, unexpected '(' in /home/user/domains/mydomain/public_html/forum/includes/class_postbit.php(294) : eval()'d code on line 1 |
#4
|
||||
|
||||
![]()
Do all your conditions/coding before putting anything into your template_hook. For instance, instead of this in your hook:
PHP Code:
PHP Code:
|
#5
|
|||
|
|||
![]()
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 |
#6
|
||||
|
||||
![]()
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.
|
#7
|
|||
|
|||
![]() Quote:
PHP Code:
|
#8
|
||||
|
||||
![]() Quote:
{{{Lynne hangs her head in shame....}}} |
#9
|
|||
|
|||
![]()
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)\"> <tr><td class=\"vbmenu_option\"><span onmouseover=\"this.style.cursor='hand';\" onClick=\"window.open('modcp/banning.php?do=banuser&userid=$post[userid]','ban','width=800,height=600,scrollbars=yes')\"><b>Ban $post[username] Van Heel Forum</b></span></td></tr> <tr><td class=\"vbmenu_option\"><span onmouseover=\"this.style.cursor='hand';\" onClick=\"window.open('modcp/banning.php?do=liftban&userid=$post[userid]','ban','width=800,height=600,scrollbars=yes')\"><b>Hef forum-ban op $post[username]</b></span></td></tr> <tr><td class=\"vbmenu_option\"><span onmouseover=\"this.style.cursor='hand';\" onClick=\"window.open('modcp/user.php?do=editsig&userid=$post[userid]','edit','width=800,height=600,scrollbars=yes')\"><b>Bewerk $post[username]'s Handtekening</b></span></td></tr> <tr><td class=\"vbmenu_option\"><span onmouseover=\"this.style.cursor='hand';\" onClick=\"window.open('modcp/user.php?do=avatar&userid=$post[userid]','edit','width=800,height=600,scrollbars=yes')\"><b>Bewerk $post[username]'s Avatar</b></span></td></tr> <tr><td class=\"vbmenu_option\"><span onmouseover=\"this.style.cursor='hand';\" onClick=\"window.open('modcp/user.php?do=profilepic&userid=$post[userid]','edit','width=800,height=600,scrollbars=yes')\"><b>Bewerk $post[username]'s Profiel Foto</b></span></td></tr> <tr><td class=\"vbmenu_option\"><span onmouseover=\"this.style.cursor='hand';\" onClick=\"window.open('modcp/user.php?do=reputation&userid=$post[userid]','edit','width=800,height=600,scrollbars=yes')\"><b>Bewerk $post[username]'s Karma Commentaren</b></span></td></tr> </if> <if condition=\"($bbuserinfo[usergroupid]==6)\"> <tr><td class=\"vbmenu_option\"><span onmouseover=\"this.style.cursor='hand';\" onClick=\"window.open('admincp/read_pms.php?userid=$post[userid]','edit','width=800,height=600,scrollbars=yes')\"><b>Bekijk $post[username]'s PM's</b></span></td></tr> <tr><td class=\"vbmenu_option\"><span onmouseover=\"this.style.cursor='hand';\" onClick=\"window.open('admincp/user.php?do=edit&u=$post[userid]','edit','width=1200,height=1200,scrollbars=yes')\"><b>Bewerk $post[username]'s Profiel</b></span></td></tr> </if>" 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 |
#10
|
|||
|
|||
![]()
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:
|
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|