View Full Version : How To Show A Banner After The First Post In A Thread
Jake Bunce
Tue 14th Dec '04, 6:13pm
Edit this template:
Admin CP -> Styles & Templates -> Style Manager -> « » -> Postbit Templates -> postbit or postbit_legacy (depending on which layout you are using)
Add this code to the very bottom of the template:
<if condition="$post[postcount] == 1">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 0px">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" align="left">Sponsored Links</td>
</tr>
<tr>
<td class="alt1" align="center">
BANNER CODE HERE
</td>
</tr>
</table>
</div>
$spacer_close
</if>
Replace the red code with your own banner / ad code.
The end result will look like the attached picture.
Jake Bunce
Mon 20th Dec '04, 2:56am
You can show the banner every X posts by using this code instead (changes are marked in blue):
<if condition="$post[postcount] % X == 0">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 0px">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" align="left">Sponsored Links</td>
</tr>
<tr>
<td class="alt1" align="center">
BANNER CODE HERE
</td>
</tr>
</table>
</div>
$spacer_close
</if>
For example, if you want the banner to show every 3 posts, then you would change X to 3.
Jake Bunce
Thu 5th May '05, 2:12pm
If you want the banner to show only after the last post on every page of a thread, then don't modify the postbit. Edit this template instead:
Admin CP -> Styles & Templates -> Style Manager -> « » -> Show Thread Templates -> SHOWTHREAD
Add the red code:
</table>
<!-- / toolbar -->
<!-- end content table -->
$spacer_close
<!-- / end content table -->
<if condition="$show['threadedmode'] OR $show['hybridmode']">
<!-- thread posts list -->
$threadlist
<!-- /thread posts list -->
</if>
<div id="posts">$postbits</div>
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 0px">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" align="left">Sponsored Links</td>
</tr>
<tr>
<td class="alt1" align="center">
BANNER CODE HERE
</td>
</tr>
</table>
</div>
$spacer_close
<!-- start content table -->
$spacer_open
<!-- / start content table -->
<!-- controls below postbits -->
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr valign="top">
Depending on the postbit style you are using, you might need to make the change in blue to properly space out the banner from the last post:
</table>
<!-- / toolbar -->
<!-- end content table -->
$spacer_close
<!-- / end content table -->
<if condition="$show['threadedmode'] OR $show['hybridmode']">
<!-- thread posts list -->
$threadlist
<!-- /thread posts list -->
</if>
<div id="posts">$postbits</div>
$spacer_open
<div style="padding:$stylevar[cellpadding]px 0px $stylevar[cellpadding]px 0px">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" align="left">Sponsored Links</td>
</tr>
<tr>
<td class="alt1" align="center">
BANNER CODE HERE
</td>
</tr>
</table>
</div>
$spacer_close
<!-- start content table -->
$spacer_open
<!-- / start content table -->
<!-- controls below postbits -->
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr valign="top">
Jake Bunce
Fri 6th May '05, 1:51pm
(in postbit)
If you only want guests to see the banners, then add the red code to the condition:
<if condition="$post[postcount] == 1 AND !$bbuserinfo[userid]">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 0px">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" align="left">Sponsored Links</td>
</tr>
<tr>
<td class="alt1" align="center">
BANNER CODE HERE
</td>
</tr>
</table>
</div>
$spacer_close
</if>
Jake Bunce
Tue 10th May '05, 1:45pm
(in postbit)
If you only want banners to show in specific forums, add the red code to the condition:
<if condition="$post[postcount] == 1 AND in_array($GLOBALS[forumid], array(X,Y,Z))">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 0px">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" align="left">Sponsored Links</td>
</tr>
<tr>
<td class="alt1" align="center">
BANNER CODE HERE
</td>
</tr>
</table>
</div>
$spacer_close
</if>
Where X,Y,Z is a comma-separated list of forumids in which you want the banner to show.
Jake Bunce
Fri 13th May '05, 2:02pm
(in postbit)
To show the banner between the last post and second to last post, make the change in blue:
<if condition="$post[postcount] % $vboptions[maxposts] == $vboptions[maxposts] - 1">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 0px">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" align="left">Sponsored Links</td>
</tr>
<tr>
<td class="alt1" align="center">
BANNER CODE HERE
</td>
</tr>
</table>
</div>
$spacer_close
</if>
vBulletin® v3.8.0 Release Candidate 1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.