The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Question about using the template hooks
I was updating to the latest version and all went quickly as I have all code mods as plugins. But I still had to fix modded templates one by one. I noticed the template_hooks and thought I might be able to save myself some time in the future by using some of these. So I decided I could try this out on my postbit_legacy template where I have this code at the end to display an ad after the first post:
HTML Code:
<if condition="!$GLOBALS['FIRSTPOSTID']"> <br> <table id="post$post[postid]" class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center"> <tr> <td class="thead" style="font-weight:normal; border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]" colspan="2"> Sponsored Links </td> </tr> <tr> <td class="alt2" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px"> <Ad code goes here> </td> </tr> </table> </if> Code:
eval('$template_hook[postbit_end] .= " ' . fetch_template('custom_postbit_ad_at_end') . '";'); My problem is that it shows the ad after every post, not just the first. So I'm guessing that my conditional is coming up TRUE every time because $GLOBALS['FIRSTPOSTID'] is empty every time. Can somebody throw me a clue as to what I'm doing wrong? Is there a way to make this work? Seemed like it should be simple, but.... Thanks |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|