Log in

View Full Version : How do I Remove ad after first postbit


ski diva
08-11-2006, 05:43 PM
Right now I have each forum set up so that there's a banner ad below the first post on each thread. How do I keep this from happening in one specific forum, without affecting the others?

Can anyone help?

Kirk Y
08-11-2006, 06:09 PM
Try wrapping the whole adsense code block with this:
<if condition="$forum[forumid] != XX">ADSENSE CODE</if>

Be sure to replace XX with the ForumID of whichever forum you don't want the ads to show in.

ski diva
08-11-2006, 11:53 PM
That seems like a great solution! I'm just not sure about where to put the code. Here's what I have. Maybe you can tell me where to put it? Thanks!

</div>
<!-- / post $post[postid] popup menu -->

<if condition="$show['spacer']">
</div>
$spacer_close
</if>
<!-- / post #$post[postid] -->
<if condition="$post[postcount] % $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">
<script type="text/javascript"><!--
google_ad_client = "NUMBER HERE";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "FFFFFF";
google_color_bg = "F4F4FF";
google_color_link = "4B548B";
google_color_text = "000000";
google_color_url = "4B548B";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
</tr>
</table>

</div>
$spacer_close

</if>

Kirk Y
08-12-2006, 12:28 AM
</div>
<!-- / post $post[postid] popup menu -->

<if condition="$show['spacer']">
</div>
$spacer_close
</if>
<!-- / post #$post[postid] -->
<if condition="$post[postcount] % $vboptions[maxposts] == 1">

$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 0px">

<if condition="$forum[forumid] != XX">
<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 = "NUMBER HERE";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "FFFFFF";
google_color_bg = "F4F4FF";
google_color_link = "4B548B";
google_color_text = "000000";
google_color_url = "4B548B";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
</tr>
</table>
</if>

</div>
$spacer_close

</if>

Give that a try -- replace the XX.

ski diva
08-12-2006, 06:49 PM
Now that's a puzzle. I copied your code EXACTLY (and I was sure to replace the XX with the forum name) and it didn't work. Any thoughts? Greatly appreciate your help. This is driving me nuts!

Kirk Y
08-12-2006, 08:23 PM
You're sure you entered the right forum id? Because it worked on my test board.

peterska2
08-12-2006, 08:52 PM
you need to use the forumid number, not the forum name. For example, this forum that we are in now is forumid=97

ski diva
08-12-2006, 08:53 PM
Yep. The forum ID is "Ask The Expert," so I entered the following:
Ask_The_Expert

Here's the code I used:

</div>
$spacer_close
</if>
<!-- / post #$post[postid] -->
<if condition="$post[postcount] % $vboptions[maxposts] == 1">

$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 0px">

<if condition="$forum[forumid] != Ask_The_Expert">
<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 = "NUMBER HERE";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "FFFFFF";
google_color_bg = "F4F4FF";
google_color_link = "4B548B";
google_color_text = "000000";
google_color_url = "4B548B";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
</tr>
</table>
</if>

</div>
$spacer_close

</if>

So what am I doing wrong?

peterska2
08-12-2006, 08:58 PM
The forumid is a number.

hover your mouse over the forum title and the url will have a number in it.

eg, hovering your mouse over the text vbulletin discussions in the navbar here will display a url ending in 97 that number is what you need to place in there, NOT the forum name.

peterska2
08-12-2006, 08:59 PM
Also, this code is more accurate, and won't give you grief later.


</div>
$spacer_close
</if>
<!-- / post #$post[postid] -->
<if condition="$post[postcount] % $vboptions[maxposts] == 1">
<if condition="$forum[forumid] != Ask_The_Expert">
$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 = "NUMBER HERE";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "FFFFFF";
google_color_bg = "F4F4FF";
google_color_link = "4B548B";
google_color_text = "000000";
google_color_url = "4B548B";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
</tr>
</table>


</div>
$spacer_close
</if>
</if>

ski diva
08-12-2006, 09:41 PM
Well, whaddya know, it worked! You guys must shake your head over newbies like me! Don't know what I'd do without you. Thanks so so much!

Now I have one more question -- one more knot in this tangled web. Now that I've eliminated the adsense ad after the first postbit, what if I wanted to replace it with a banner that was targeted to this specific forum and this forum alone?

Kirk Y
08-12-2006, 09:45 PM
Find:
$spacer_close
</if>

Replace with:
$spacer_close
<else />
<img src="path/to/your/image.gif" />
</if>

ski diva
08-12-2006, 09:55 PM
Found it at the very end of the code, so I hope that's right.

Again, thanks so so much!

Kirk Y
08-12-2006, 10:01 PM
Yep, that's where it goes. No problem.

ski diva
08-13-2006, 11:58 PM
Just when I thought all was well.... I added that code to the end, and ended up with no adsense ads after the first postbit on any of my other forums, PLUS an empty space for an ad after each post in a thread. So I took it out. Now I'm not getting adsense at all on my other forums (though I am getting the space for it after the first post in a thread, and I'm no longer getting the empty space after each post), and there's no targeted ad (or even adsense) to on my "Ask The Expert" forum at all. (God, I hope this is clear!). I have no idea what could possibly have gone wrong. Help, please!

Here's my code:

</div>
$spacer_close
</if>
<!-- / post #$post[postid] -->
<if condition="$post[postcount] % $vboptions[maxposts] == 1">
<if condition="$forum[forumid] != 26">
$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"><!--
<script type="text/javascript"><!--
google_ad_client = "NUMBER HERE";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "FFFFFF";
google_color_bg = "F4F4FF";
google_color_link = "4B548B";
google_color_text = "000000";
google_color_url = "4B548B";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
</tr>
</table>


</div>
$spacer_close
</if>
</if>

peterska2
08-14-2006, 12:02 AM
</div>
$spacer_close
</if>
<!-- / post #$post[postid] -->
<if condition="$post[postcount] % $vboptions[maxposts] == 1">
<if condition="$thread[forumid] != 26">
$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"><!--
<script type="text/javascript"><!--
google_ad_client = "NUMBER HERE";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "FFFFFF";
google_color_bg = "F4F4FF";
google_color_link = "4B548B";
google_color_text = "000000";
google_color_url = "4B548B";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
</tr>
</table>


</div>
$spacer_close
</if>
</if>

ski diva
08-14-2006, 12:21 AM
Sorry for not wrapping the code, all. I'll make sure to do it next time.

Nope, that didn't work, either.

peterska2
08-14-2006, 12:27 AM
Do you mind trying something?

Can you add, right at the end of your postbit template

<if condition="($post[postcount] % $vboptions[maxposts] == 1) && ($thread[forumid] != 26)">Conditional Checker</if> and provide the link to your site then I can see what is going on.

Thanks

peterska2
08-14-2006, 12:49 AM
ok, well that works, so the conditionals are right. The next bit is the easy bit, getting the banners to show in the right forum only.

delete the code from the previous post, and overwrite the code in post #16 with
</div>
$spacer_close
</if>
<!-- / post #$post[postid] -->
<if condition="$post[postcount] % $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">

<!-- not forum 26 so show google -->
<if condition="$thread[forumid] != 26">
<!-- not forum 26 so show google -->

<script type="text/javascript"><!--
<script type="text/javascript"><!--
google_ad_client = "NUMBER HERE";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "FFFFFF";
google_color_bg = "F4F4FF";
google_color_link = "4B548B";
google_color_text = "000000";
google_color_url = "4B548B";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

<!-- this is forum 26 so show other banner -->
<else />
<!-- this is forum 26 so show other banner -->

Your other banner here

<!-- / forum checker -->
</if>
<!-- / forum checker -->

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


</div>
$spacer_close

</if>

I've put quite a few comments in there too so that it is easy to know what is what.

For now it will show Your other banner here in the ask the expert forum, which you can replace the text with the appropraite banner code for use there.

ski diva
08-14-2006, 12:56 AM
Well, we're making some progress. I do get 'Your Other Banner Here" where in the "Ask The Expert" forum, but still no adsense in the other forums.

peterska2
08-14-2006, 12:58 AM
ok, now in the code, we have some text NUMBER HERE that should actually be a number, so try getting your code from google adsense again and overwriting the adsense code with that. It can take a few mins to update once you change it, but that should solve the problem.

ski diva
08-14-2006, 01:01 AM
It worked!

Thank you thank you!!! You are the best!!!

peterska2
08-14-2006, 01:09 AM
No problem :)

Glad it's sorted :)