PDA

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


mcyates
03 Feb 2007, 09:23
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

rezapci
03 Feb 2007, 18:28
awesome Reserved

2 FN LOW
02 Mar 2007, 20:58
any idea how to get rid of this space?

http://img250.imageshack.us/img250/3032/untitled8cj1.th.jpg (http://img250.imageshack.us/my.php?image=untitled8cj1.jpg)

heres the code i added at the bottom

<if condition="in_array($post['postcount'], array(5,15,25, 35,45,55,65,75,85,95,100,115,125,135,145,155,165,175,185,195,205))">
<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</td>
</tr>
<tr>
<td class="alt1" align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-5795442351285075";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "34383C";
google_color_bg = "34383C";
google_color_link = "FFFFFF";
google_color_text = "999999";
google_color_url = "999999";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
</tr>
</table>
</div>
$spacer_close
</if></if>

would like to click install if i can get this space removed and have it sit flush like it does on the top..Either that or give it a space at the top like the bottom...I would prefer no space at all though :D

JJH35
05 Mar 2007, 20:39
that screenshot is hardly viewable...

cddw.ltd
09 Mar 2007, 11:13
that screenshot is hardly viewable...

Take the .th. out before the .jpg and you get the full image -



https://www.vbulletin.org/forum/

mcyates
10 Mar 2007, 10:04
The space is the natural space that happens between each post. I'll try to add a space to the top of the advert for you.

Smoothie
10 Mar 2007, 15:26
$spacer_open and $spacer_close is the problem.

mcyates
11 Mar 2007, 08:42
I tried to remove them but it didn't help. There was still a gap on the bottom side.

Xtrm2Matt
14 Mar 2007, 19:23
Simply add <br /> before $spacer_open. Example:
<br />
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 0px">

starww
14 Mar 2007, 21:45
its really a useful stuff !

thanks for sharing :)

SaN-DeeP
14 Mar 2007, 22:56
thanks for sharing

proxx
20 Mar 2007, 14:48
does anyone know how to get rid of that space on the left and right of the ad box?

http://img250.imageshack.us/img250/3032/untitled8cj1.jpg

Chris-777
22 Mar 2007, 21:58
At a guess (I don't have this installed), change:

google_ad_width = 468;


To whatever your default template scaling is. So something like:

google_ad_width = 95%;

Xplorer4x4
23 Mar 2007, 05:54
<!-- controls -->
<if condition="in_array($post['postcount'], array(1,10,20,21,30))">
<span style="float:$stylevar[left]">
[ad code]
</span>
</if>
</if>

I through the <!-- controls --> part in for reference as to where I am using the code. I actually tried both if conditions referring to post count(not worried about the user group condition)
and neither condition worked for anything but the first post.

Atakan KOC
26 Mar 2007, 07:57
Thanks...

imk
28 Mar 2007, 20:20
at last thanks man

nethelp
25 Apr 2008, 23:06
I'm trying to set a subscription for my mebers. I want thoose who pay a small fee to have no ads when they are logged. How do I do that?

I did placed this code, but still have ads upon payment complete:
<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">

MY ADSENSE CODE

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

</div>
$spacer_close

</if></if>

LAJAURIA
08 Jul 2008, 18:25
any way of exclude some forums ID??

I tryed this conditional:

<if condition="$post[postcount]==1 AND !in_array($forumid, array(20,32,34,40,135,136,70,25,26,73,124,27,137,66,164,3,4,54,42,43,116))">
<p align="center">

ADSENSE CODE

</p>
</if>


but it doesn't work.


any ideas??