PDA

View Full Version : Integration with vBulletin - Adsense Leaderboard on Non-Index Pages


Kaelon
09-14-2007, 10:00 PM
After reading some of the great Google Adsense template modifications on this forum, I decided to contribute one of my own. Special thanks go to StarBuG (https://vborg.vbsupport.ru/member.php?u=3512), whose Adsense template modifications have been tremendous inspiration.

What does it do?
This modification places a Google Adsense 728 x 90 leaderboard under the navigation bar (navbar) on all vBulletin-powered pages that call the navbar, except for the Forumhome (index). The integration of the Google Adsense is placed in a simple, elegant, style-compliant box.

How to Install

In Admin CP > Styles & Templates > Style Manager > Edit Templates, edit the navbar template. Search for:

<!-- / nav buttons bar -->

And add underneath:

<if condition="THIS_SCRIPT != 'index'">
<!-- Google Adsense Headers, Non Index -->
<br />
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center" style="border-bottom-width: 0px">
<tr><td class="alt1" align="center">
<script type="text/javascript"><!--
google_ad_client = "your pub id here";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_color_border = "222222";
google_color_bg = "222222";
google_color_link = "FFB019";
google_color_text = "D7CEA4";
google_color_url = "D7CEA4";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td></tr>
</table>
<!-- / Google Adsense Headers, Non Index -->
</if>

Simply customize the google_color scheme to match the link, text, and background colors of your site (preferrably matching up with the link, alt1 text, and alt1 background). Then, you're all set! Feel free to mark this as installed if you use it on your site.

Demo
Aelyria.com (http://www.aelyria.com/forums) - just enter any forum/area.

hnjco
09-15-2007, 09:46 PM
Installed, thanks for it.

Is there way for Adsense not to shown on forumhome?

profanitytalker
09-16-2007, 12:20 AM
Thanks. Great mod. Installed.

Kaelon
09-16-2007, 04:10 AM
Installed, thanks for it.

Is there way for Adsense not to shown on forumhome?
Yes, the default configuration of this template mod is that it will show on all pages but not on forumhome (/forums/index.php). The conditional takes care of that:

<if condition="THIS_SCRIPT != 'index'">

If you want this ad to appear everywhere, including forumhome, just get rid of the first and last lines (the if-statements/conditionals).

Thanks, guys. :)

Magnumutz
09-16-2007, 07:28 AM
I don't think you were supposed to remove the vBulletin copyrights from the footer...

Kaelon
09-16-2007, 12:51 PM
I don't think you were supposed to remove the vBulletin copyrights from the footer...
I have a branding-free license for vBulletin, and all of my products.

momo2
09-17-2007, 02:28 PM
Excellent, thanks.........

glutenfree
01-22-2008, 10:40 AM
Anybody help me how to make a condition so that this does not appear on non-content pages? ... User CP, search, new thread..etc.

Any help would be appreciated.

I tried mimicking the original condition that stops it from showing on index but I must be doing something wrong.:confused:

Mythotical
05-06-2008, 05:17 PM
glutenfree: change the if condition from
<if condition="THIS_SCRIPT != 'index'">

to
<if condition="THIS_SCRIPT != 'usercp'">

An array may be needed so that you can have it not display on usercp, search, new thread, etc.

hnjco
05-18-2008, 02:57 AM
Is there anyway of not to have ads on few sections but all rest?

like i have sports, image, jokes etc and don't want ads on image section but on all rest of sections?