Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 3 Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
UKBL ~ Google Adsense in Navbar
UKBusinessLive
Join Date: Sep 2008
Posts: 1,637

Work like a donkey at work, love chillin on VB.org. Work Hard - Play Hard! - Try it you'll love it

Essex, United Kingdom
Show Printable Version Email this Page Subscription
UKBusinessLive UKBusinessLive is offline 04-26-2009, 10:00 PM

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 Images
File Type: png google.png (34.2 KB, 0 views)
Attached Files
File Type: zip google.zip (32.8 KB, 35 views)
Reply With Quote
  #12  
Old 09-17-2009, 11:25 AM
Cplkaos Cplkaos is offline
 
Join Date: May 2009
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have copied the script and have inserted my own google code.

When I leave the users as X, Y, Z as per your code, I get webpage not displayed.

When I change XYZ for my relevent usergroups (6 Being ADMIN) there is nothing in the navbar, even after 10 mins.

I have switched of the Adsense I had running in the ADMIN CP incase there was a conflict.

Any help would be sooooooooooooooooooooooo helpful.

Cheers.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:09 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03561 seconds
  • Memory Usage 2,226KB
  • Queries Executed 17 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (1)postbit
  • (2)postbit_attachment
  • (2)postbit_onlinestatus
  • (2)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete