PDA

View Full Version : Show Thread Enhancements - Show Adsense After post number "x" and "x"


mcyates
08-05-2008, 10:00 PM
Works With Vbulletin V3.7.2

This is a very simple template modification have similar to absence hack and the random postbit advert hack. But you have more control with this hack as you change the option for where the adverts will appear "after which message"

Add one of these codes to the bottom of your postbit template.

Here are the codes:


<if condition="$post[postcount]==1">
<p align="center">

[AD CODE GOES HERE]

</p>
</if>


The above code would show an ad after the first post on every thread. Change this number to show the advert under a different post. Or use loads together like this:


<if condition="$post[postcount]==1">
<p align="center">

[AD CODE GOES HERE]

</p>
</if>

<if condition="$post[postcount]==10">
<p align="center">

[AD CODE GOES HERE]

</p>
</if>

<if condition="$post[postcount]==20">
<p align="center">

[AD CODE GOES HERE]

</p>
</if>


The above will show adverts after the 1st, 10th and 20th post in every thread.

Also there is another way for doing this:


<if condition="in_array($post['postcount'], array(1, 5, 10, 15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95 ,100))">
<if condition="in_array($bbuserinfo['usergroupid'], array(1, 2, 3, 4,5,6,7,8, 9))">
$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 (<a href=/payments.php>No Ads</a>)</td>
</tr>
<tr>
<td class="alt1" align="center">

[AD CODE GOES HERE]

</td>
</tr>
</table>

</div>
$spacer_close

</if></if>


Enjoy!! :D

Madlike
08-06-2008, 09:36 AM
it's Template Modification isn't it ?

kaptanblack
08-06-2008, 11:09 AM
it's Template Modification isn't it ?

Yes :S it is template modification...

jlew24asu
08-06-2008, 12:19 PM
thank you for this.

Chris B
08-06-2008, 09:16 PM
Anyway to make this show just for certain usergroups/guests?

GaiLoan
08-06-2008, 09:31 PM
Yes :S it is template modification...

just a small template modify why its go here => vBulletin 3.7 Add-ons

mcyates
08-06-2008, 09:40 PM
Anyway to make this show just for certain usergroups/guests?

<if condition="in_array($post['postcount'], array(1, 5, 10, 15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95 ,100))">
<if condition="in_array($bbuserinfo['usergroupid'], array(1, 2, 3, 4,5,6,7,8, 9))">
$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 (<a href=/payments.php>No Ads</a>)</td>
</tr>
<tr>
<td class="alt1" align="center">

[AD CODE GOES HERE]

</td>
</tr>
</table>

</div>
$spacer_close

</if></if>


Use the above code, the code below is the part which selects which usergroupd see the ad:


<if condition="in_array($bbuserinfo['usergroupid'], array(1, 2, 3, 4,5,6,7,8, 9))">

Chris B
08-07-2008, 11:44 AM
Can this go anywhere in the posbit template? Or is it a specific line?

mcyates
08-07-2008, 01:04 PM
It can go anywhere you want it to be shown.

KevinGupta
05-22-2009, 03:01 PM
it doesnt show in the adsense sometimes?

alishahbazi
07-13-2009, 05:58 PM
this code work in vb 3.8.x ?

Brandon Sheley
07-13-2009, 07:45 PM
Here are some more vBulletin Template Conditions (https://vborg.vbsupport.ru/showthread.php?t=215032) if you wanted to expand on this tut a little :)