The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
|||
|
|||
OK Lynne, It's registered now, However the first post condition doesn't work and If I remove the If tag it's working and rendering the template.
HTML Code:
<vb:if condition="$post[postcount] == 1"> {vb:raw arp_var} </vb:if> PHP Code:
|
#12
|
||||
|
||||
To see if it's the first post, use this condition:
HTML Code:
<vb:if condition="$post['postid'] == $thread['firstpostid']"> {vb:raw arp_var} </vb:if> |
#13
|
|||
|
|||
Could it be that you are using 1, the boolean value for true?
Have you tried: Code:
<vb:if condition="$post[postcount] == '1'">{vb:raw arp_var}</vb:if> |
#14
|
|||
|
|||
shouldnt you also register post variable in your template?
Code:
$arp_var = "{vb:raw thread.title}"; $templater = vB_Template::create('ARP_TEMPLATE'); $templater->register('arp_var', $arp_var); $templater->register('post', $post); $template_hook["postbit_end"] .= $templater->render(); F. |
#15
|
|||
|
|||
Quote:
Also all other suggests doesn't work. |
#16
|
||||
|
||||
There is no bug, you must register any variables used in the template, including those in the conditionals (certain ones like $show are auto available).
In you case, you must register both $post and $thread (in blue). Code:
$arp_var = "{vb:raw thread.title}"; $templater = vB_Template::create('ARP_TEMPLATE'); $templater->register('arp_var', $arp_var); $templater->register('post', $post); $templater->register('thread', $thread); $template_hook["postbit_end"] .= $templater->render(); Also, I dont know what the line is red is for, but all you will output is the text {vb:raw thread.title} |
#17
|
||||
|
||||
You haven't registered the $thread variable for use in your template, so it's not going to work.
Any variable array you want to use in a template must be registered. |
#18
|
|||
|
|||
Quote:
Thanks All is working now. --------------- Added [DATE]1264763223[/DATE] at [TIME]1264763223[/TIME] --------------- Thanks Lynne for your help and your great support. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|