vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=155)
-   -   Google Adsense In Navbar (https://vborg.vbsupport.ru/showthread.php?t=102668)

dieselpowered 12-09-2005 10:00 PM

Google Adsense In Navbar
 
This is a really quick template change, just an additional location for those of you looking to add google adsense to your board.

In your navbar template find (there are multiple instances of this code, use the first instance):
Code:

<if condition="$show['member']">
Above this add:
Code:

<!-- start adsense code -->
<td class="alt2">
Your adsense code
</td>
<!-- /end adsense code -->

Thats it, your all done :)

Hope this helps someone out, I am far from a coder, however, wanted to atleast attempt to give back to the community :) If you happen to use, please CLICK INSTALL

AshokForums.com 12-10-2005 10:04 PM

Installed thanks :)

dieselpowered 12-10-2005 10:15 PM

Quote:

Originally Posted by AshokForums.com
Installed thanks :)

Glad it was something you could use :)

.Tim 12-11-2005 12:45 AM

Nice!

Qwest 12-11-2005 01:54 AM

Quote:

Originally Posted by AshokForums.com
Installed thanks :)

on a phpbb board?

Xplorer4x4 12-11-2005 02:08 AM

I just used the Adsence after first post hack minues the <if> condition, and spacers, like so:

PHP Code:

<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 
</tr
<
tr
    <
td class="alt1" align="center"
        <
adsense code here
</if> 
    </
td
</
tr
</
table

</
div

Link is in sig for an example. ;)

BTW Technically your mod edits the breadcrubm i believe. :p

ugmphelon 12-11-2005 08:21 AM

doesnt work at all for me

imranbaig 12-11-2005 11:23 AM

nice,.. Im going to use it on my forums,..

steven s 12-11-2005 11:24 AM

Quote:

Originally Posted by ugmphelon
doesnt work at all for me

<if condition="$show['member']"> is used several times in the navbar template. You must place your adsense before the first <if condition="$show['member']">

Mine looks like:
<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>
<!-- google ads -->
<td class="alt2" valign="top" nowrap="nowrap">

<script type="text/javascript"><!--
google_ad_client = "";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel ="";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- /google ads -->

<if condition="$show['member']">

<td class="alt2" valign="top" nowrap="nowrap">
<div class="smallfont">

Snake 12-11-2005 11:35 AM

Good idea there!

dieselpowered 12-11-2005 03:43 PM

Quote:

Originally Posted by ugmphelon
doesnt work at all for me

Not to ask the obvious, however, do you have a google adsense account? As mentioned, you are looking for the first instance of <if condition="$show['member']">

Let me know :)

ugmphelon 12-11-2005 07:33 PM

yes i do, but i also have the "double navbar" feature, but blah. I donno.

ugmphelon 12-11-2005 07:39 PM

got it, my code is alot diff. thanks

/me installs

mholtum 12-12-2005 12:41 AM

easy money.. Nice job Mike!

dieselpowered 12-12-2005 04:06 AM

Quote:

Originally Posted by mholtum
easy money.. Nice job Mike!

Thanks Mike :)

bluecat 12-12-2005 04:55 AM

Pretty slick. ;)

edbri871 12-12-2005 05:11 AM

This is interesting as weve had our Google in the Nav bar for a ver long time now although hadnt thought of it to be a hack. Its was just a thought as that space always looked unused to me so one of the admins put it there. Of course it changes size based on screen resolution also...

dieselpowered 12-12-2005 05:25 AM

Quote:

Originally Posted by edbri871
This is interesting as weve had our Google in the Nav bar for a ver long time now although hadnt thought of it to be a hack. Its was just a thought as that space always looked unused to me so one of the admins put it there. Of course it changes size based on screen resolution also...

You actually have it under your navbar and above it. Regardless, this is in no way some sort of special super secret hack, it was simply meant as another alternative to adsense placement. :)

dieselpowered 12-12-2005 05:28 AM

Quote:

Originally Posted by bluecat
Pretty slick. ;)

Nice site you have there :)

edbri871 12-12-2005 06:31 AM

Quote:

Originally Posted by xtremeoff-road
You actually have it under your navbar and above it. Regardless, this is in no way some sort of special super secret hack, it was simply meant as another alternative to adsense placement. :)

Not the right one and also I wasnt putting this down its a great alternative...

MrNase 12-12-2005 11:30 AM

Where did you get THAT idea from :D

I'am using this for 4 months now ;)

steven s 12-12-2005 11:54 AM

Quote:

Originally Posted by MrNase
Where did you get THAT idea from :D

I'am using this for 4 months now ;)

I've been using it for a few months too. I did not want my page to be any taller and it looked like wasted real estate anyway.
I also use an add in the forumdisplay, but it hasn't been doing well.

dieselpowered 12-12-2005 02:42 PM

Quote:

Originally Posted by edbri871
Not the right one and also I wasnt putting this down its a great alternative...

Oh I did not think you were :)

dieselpowered 12-12-2005 02:43 PM

Quote:

Originally Posted by MrNase
Where did you get THAT idea from :D

I'am using this for 4 months now ;)

LOL I really do not know...was bored and thought I would mess around in the templates on my dev board :)

CSS59 12-20-2005 02:02 AM

can you help me arange it like this please?

993ti 12-20-2005 10:21 PM

How to show it only on the portal, forum and topic pages?
I don't like it on search pages (also against ToS).

CSS59 12-31-2005 05:19 PM

Quote:

Originally Posted by CSS59
can you help me arange it like this please?


so noone knows how to do this?

The Chief 01-16-2006 02:54 AM

installed it, its awesome and looks great ;)

[high]* The Chief clicks install[/high]

mholtum 01-16-2006 06:03 AM

Great trick Mike.. I love it!

ba3698 01-24-2006 10:49 AM

I think this might be against TOS..."No Google ad may be placed on any non-content-based pages." as this ad will show up on reply/login pages etc. which have no content.

I think a link unit might be ok though.

linkwavescom 03-19-2006 02:37 AM

<font color="Red">work good </font>

mattyk72 03-27-2006 01:36 AM

does anyone know if this is a TOS violation??

Any way to have it turn off in non-content pages?

Magle 03-30-2006 06:59 PM

Quote:

Originally Posted by mattyk72
Any way to have it turn off in non-content pages?

Yes, simply add this code before the hack:
Code:

<if condition="(THIS_SCRIPT == 'forumdisplay' OR THIS_SCRIPT == 'showthread' OR THIS_SCRIPT == 'index')">
and this one after:
Code:

</if>
Now it only shows up on the content pages - thus, no TOS violtation :)

pbradish 04-04-2006 04:54 PM

Great mod, thank you :)

shortbus1662 04-06-2006 07:18 PM

it is no longer a TOS violation from what I understand.

I believe the modified the TOS to better work with forums.

mattyk72 04-10-2006 06:01 PM

Quote:

Originally Posted by Magle
Yes, simply add this code before the hack:
Code:

<if condition="(THIS_SCRIPT == 'forumdisplay' OR THIS_SCRIPT == 'showthread' OR THIS_SCRIPT == 'index')">
and this one after:
Code:

</if>
Now it only shows up on the content pages - thus, no TOS violtation :)

thank you so much!

Better to be safe than sorry with Google I say.

thanks again

BlueDevil98 05-13-2006 01:08 PM

I have vbadvanced and vblinks, so I did

Code:

<if condition="(THIS_SCRIPT == 'newthread')">

<else />

before the code suggested

and
Code:

</if>
after. That way it shows on all the vbadvanced pages too. Are there other pages that google wouldn't approve of that I should be excluding?

Dr.Viggy 05-14-2006 09:03 PM

Quote:

<if condition="is_member_of($bbuserinfo, 6)">ADSENSE CODE HERE</if>
here's a little something to show the adsense for only the usergroups you want. Just change the "6" to the usergroups that you want to see it (separated by commas)

Harley D 08-04-2006 04:27 PM

THANKS >clicks install<

Darwa 08-08-2006 07:44 AM

I'm missing something silly here. Please help :)

This is the complete code from my header. Where am I going wrong?

Quote:

<!-- logo -->
<a name="top"></a>
<table border="0" width="90%" cellpadding="0" cellspacing="0" align="center" background="$stylevar[imgdir_misc]/head_back.gif">
<tr>

<td align="left" valign="top"><img src="$stylevar[imgdir_misc]/head_left.gif" alt="" /></td>
<td align="right" valign="middle"><img src="$stylevar[imgdir_misc]/banner.gif" alt="" /></td>

<td align="$stylevar[center]">
&nbsp;
</td>
</tr>
</table>
<!-- /logo -->
<!-- Navigation bar -->
<table width="90%" style="background-image:url($stylevar[imgdir_misc]/nav.gif)" align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top" height="45">

<table width="50%" align="right" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="top" width="102" height="45"><a href="$vboptions[forumhome].php$session[sessionurl_q]" accesskey="1"><img src="$stylevar[imgdir_misc]/nav_home.gif" width="102" height="45" border="0" alt="" /></a></td>
<if condition="$show['registerbutton']">
<td width="102" height="45"><a href="register.php$session[sessionurl_q]" rel="nofollow"><img src="$stylevar[imgdir_misc]/nav_reg.gif" width="102" height="45" border="0" alt="" /></a></td>
<else />
<td width="102" height="45" id="usercptools"><a href="$show[nojs_link]#usercptools"><img src="$stylevar[imgdir_misc]/nav_link.gif" width="102" height="45" border="0" alt="" /></a><script type="text/javascript"> vbmenu_register("usercptools" ,1); </script></td>
</if>
<td align="left" valign="top" width="102" height="45"><a href="memberlist.php$session[sessionurl_q]"><img src="$stylevar[imgdir_misc]/nav_member.gif" width="102" height="45" border="0" alt="" /></a></td>
<td align="left" valign="top" width="102" height="45"><a href="usercp.php$session[sessionurl_q]"><img src="$stylevar[imgdir_misc]/nav_usercp.gif" width="102" height="45" border="0" alt="" /></a></td>
<td align="left" valign="top" width="102" height="45"><a href="calendar.php$session[sessionurl_q]"><img src="$stylevar[imgdir_misc]/nav_cal.gif" width="102" height="45" border="0" alt="" /></a></td>
<td align="left" valign="top" width="102" height="45" id="navbar_search"><a href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow"><img src="$stylevar[imgdir_misc]/nav_search.gif" width="102" height="45" border="0" alt="" /></a><script type="text/javascript"> vbmenu_register("navbar_search" ,1); </script></td>
<td align="left" valign="top" width="102" height="45"><a href="faq.php$session[sessionurl_q]" accesskey="5"><img src="$stylevar[imgdir_misc]/nav_faq.gif" width="102" height="45" border="0" alt="" /></a></td>

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

<if condition="$show['popups']">
<!-- NAVBAR POPUP MENUS -->

<if condition="$show['searchbuttons']">
<!-- header quick search form -->
<div class="vbmenu_popup" id="navbar_search_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr>
<td class="thead">$vbphrase[search_forums]</td>
</tr>
<tr>
<td class="vbmenu_option" title="nohilite">
<form action="search.php" method="post">
<input type="hidden" name="do" value="process" />
<input type="hidden" name="showposts" value="0" />
<input type="hidden" name="quicksearch" value="1" />
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="text" class="bginput" name="query" size="20" />&nbsp;$gobutton<br />
</form>
</td>
</tr>
<tr>
<td class="vbmenu_option"><a href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow">$vbphrase[advanced_search]:</a></td>
</tr>
<!-- start adsense code -->
<td class="alt2">
<script type="text/javascript"><!--
google_ad_client = "pub-3443198473457595";
google_ad_width = 234;
google_ad_height = 60;
google_ad_format = "234x60_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "4C4C4C";
google_color_bg = "333333";
google_color_link = "FFFF66";
google_color_text = "B47B10";
google_color_url = "008000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
<!-- /end adsense code -->

<if condition="$show['member']">
<tr>
<td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getnew" accesskey="2">$vbphrase[new_posts_nav]:</a></td>
</tr>
<else />
<tr>
<td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily" accesskey="2">$vbphrase[todays_posts]:</a></td>
</tr>
</if>
</table>
</div>
<!-- / header quick search form -->
</if>

<if condition="$show['member']">
<!-- user cp tools menu -->
<div class="vbmenu_popup" id="usercptools_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">

<tr><td class="thead">$vbphrase[quick_links]</td></tr>
<if condition="$vboptions['enablesearches']"><tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily">$vbphrase[todays_posts]</a></td></tr></if>
<tr><td class="vbmenu_option"><a href="forumdisplay.php?$session[sessionurl]do=markread">$vbphrase[mark_forums_read]</a></td></tr>
<tr><td class="vbmenu_option"><a href="#" onclick="window.open('misc.php?$session[sessionurl]do=buddylist&amp;focus=1','buddylist','statusbar=n o,menubar=no,toolbar=no,scrollbars=yes,resizable=y es,width=250,height=300'); return false;">$vbphrase[open_buddy_list]</a></td></tr>

<tr><td class="thead"><a href="usercp.php$session[sessionurl_q]">$vbphrase[user_control_panel]</a></td></tr>
<if condition="$show['siglink']"><tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=editsignature">$vbphrase[edit_signature]</a></td></tr></if>
<!--<if condition="$show['avatarlink']"><tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=editavatar">$vbphrase[edit_avatar]</a></td></tr></if>-->
<tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=editprofile">$vbphrase[edit_profile]</a></td></tr>
<tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=editoptions">$vbphrase[edit_options]</a></td></tr>

<tr><td class="thead">$vbphrase[miscellaneous]</td></tr>
<if condition="$show['pmstats']"><tr><td class="vbmenu_option"><a href="private.php$session[sessionurl_q]" rel="nofollow">$vbphrase[private_messages]</a></td></tr></if>
<tr><td class="vbmenu_option"><a href="subscription.php$session[sessionurl_q]" rel="nofollow">$vbphrase[subscribed_threads]</a></td></tr>
<tr><td class="vbmenu_option"><a href="member.php?$session[sessionurl]u=$bbuserinfo[userid]">$vbphrase[my_profile]</a></td></tr>
<if condition="$show['wollink']"><tr><td class="vbmenu_option"><a href="online.php$session[sessionurl_q]">$vbphrase[whos_online]</a></td></tr></if>
<tr><td class="vbmenu_option"><a href="billspaypal.php">Donate!</a></td></tr>

</table>
</div>
<!-- / user cp tools menu -->
</if>
<!-- / NAVBAR POPUP MENUS -->

<!-- PAGENAV POPUP -->

<div class="vbmenu_popup" id="pagenav_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr>
<td class="thead" nowrap="nowrap">$vbphrase[go_to_page]</td>
</tr>
<tr>
<td class="vbmenu_option" title="nohilite">
<form action="$vboptions[forumhome].php" method="get" onsubmit="return this.gotopage()" id="pagenav_form">
<input type="text" class="bginput" id="pagenav_itxt" style="font-size:11px" size="4" />
<input type="button" class="button" id="pagenav_ibtn" value="$vbphrase[go]" />
</form>
</td>
</tr>
</table>
</div>

<!-- / PAGENAV POPUP -->
</if>
<!-- / Navagation bar -->

<!-- content table -->
$spacer_open

$_phpinclude_output
Thanks :)


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

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01465 seconds
  • Memory Usage 1,872KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_code_printable
  • (1)bbcode_php_printable
  • (16)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete