Back to vBulletin 3 Articles

UKBL ~ Google Adsense in Navbar
by UKBusinessLive 27 Apr 2009
Rating: (2 votes - 4.50 average)

UKBL ~ Google Adsense in Navbar

Want to display some adsense ads in the navbar?? Want ads to show for guests and other chosen usergroups? Well now you can


This is a really easy and simple edit, should take no longer than a few minutes

Lets Start

Go to edit the following template in your admin CP

AdminCP > Styles & Templates> Style Manager> Your Chosen Style> All style options> Edit templates> Navigation / Breadcrumb Templates> navbar

In template NAVBAR find

Code:
<div class="navbar" style="font-size:10pt"><a href="$vboptions[forumhome].php$session[sessionurl_q]" accesskey="1"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_start.gif" alt="" border="0" /></a> <strong>$vboptions[bbtitle]</strong></div>
		</if>
	</td>
and below it add

Code:
<!--<UKBL Google links Start>----------------------------------------------------------------------->
<td class="alt2">
<DIV ALIGN=RIGHT>
<if condition="!is_member_of($bbuserinfo, X, Y, Z)">
<script type="text/javascript"><!--
google_ad_client = "pub-8086024447848308";
/* 468x60, created 26/04/09 */
google_ad_slot = "9913458159";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</DIV>
</td>
</if>
<!--<UKBL google links End>----------------------------------------------------------------------->
don't forget to add your own adsense code I've added mine but add yours to the above code, it should look something like this

Code:
<script type="text/javascript"><!--
google_ad_client = "pub-8086028887848308";
/* 468x60, created 26/04/09 */
google_ad_slot = "991655559";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

and dont forget to change the X,Y,Z here

Code:
<if condition="!is_member_of($bbuserinfo, X, Y, Z)">
for the usergroups that you want the adsense to show for.

Remember it takes time, upto 10 mins for the adsense code to activate, so keep refreshing your page

If you havn't got an adsense account for your forum sign up for one here https://www.google.com/adsense

Have fun



Please remember to click install and i'll support you 100%
Attached Thumbnails
Click image for larger version
Name:	google.png
Views:	84
Size:	34.2 KB
ID:	98411  
Attached Files
File Type: zip google.zip (32.8 KB, 37 views)

Similar Mods

Miscellaneous Hacks Non-Adsense Google site & web search for your navbar! vBulletin 3.8 Template Modifications
Add Google adsense search to your navbar dropdown vBulletin 3.5 Template Modifications
Google Adsense In Navbar vBulletin 3.5 Template Modifications
Mini Mods ... Modification Graveyard

vblts.ru supports vBulletin®, 2022-2024