PDA

View Full Version : vBulletin Blog - Adsense below Recent Comments List on Blog Home


StarBuG
09-09-2007, 10:00 PM
Hi

To continue my Adsense modification series I decided to make my blog placements public.

What this hack does:
This hack adds a standard 468x60px Adsense Banner below the Recent Comments List on the Blog start page.

Install:

In template blog_home find:


<td class="alt2 smallfont" align="$stylevar[right]"><a href="blog.php?$session[sessionurl]do=comments">$vbphrase[find_more]</a></td>
</tr>
</table>
</div>
and add below:

<br />
<!-- 468x60 Banner after Recent Comments List on Blog Home -->
<div style="border: 2px dashed rgb(11, 25, 140); padding: 8px; background: rgb(245, 245, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; text-align: left; font-size: 80%;">
<center>
<script type="text/javascript"><!--
google_ad_client = "YOUR PUB ID HERE";
google_alternate_color = "E5EAEB";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
google_color_border = "F5F5FF";
google_color_bg = "F5F5FF";
google_color_link = "22229c";
google_color_text = "22229c";
google_color_url = "22229c2";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center>
</div><br />
<!-- 468x60 Banner after Recent Comments List on Blog Home -->Now you just need to customize the adsense code marked with:

<!-- 468x60 Banner after Recent Comments List on Blog Home -->

replace "YOUR PUB ID HERE" with your pub-ID
and change the colors to fit your forum colors

If you have the "Template Modification System" (TMS) installed, I have attached a TMS XML for you. Remember to do the changes!

DEMO: http://www.patientenfragen.net/blog.php

Please click install and leave feedback, if you use this mod. THX

StarBuG

If you did not register for an Adsense account yet but you plan to, feel free to contact me. If you register via my referral I am willing to help you get the most out of your adsense placement by assisting you during the setup process and implementing the best adsense modifications. Just write me a Private message.

PoetJA-1975
10-12-2007, 07:01 AM
Great - Thanx again for the sharing ;)

JAcquii.

yoyoyoyo
10-12-2007, 10:37 AM
hmm - thanks for sharing, but I did the manual edits indicated in blog_home and instead of coming out under the comments it is below the "recent entries" box on /forum/blog.php. When I go to /forum/blog.php?b=1#comment2 I don't see any adsense code listed

StarBuG
10-12-2007, 04:51 PM
it is on the blogs homepage not the comments of one specific entry.
Maybe my description is a little imprecise

yoyoyoyo
10-12-2007, 05:00 PM
ok - then it works perfectly ;) I was a bit confused by the description...

induslady
10-26-2007, 12:42 AM
Hello StarBug,

Thanks for this hack as well as the other hacks in blog navigation and blog show entry. They seem to be really good.

I have tried them in my test forums and yet to implement in live for want of some help.

My forum style color is a little purplish. I am attaching screenshots of my blog pages with your hacks installed. The hacks display Google ads in blue color that doesn't go very well with my style color.

Is it possible for you to help me with the following tweaking:

1. How do I change the dotted lines around Google ads box into normal black line?
2. How do I change the background color, surrounding color of the ads to merge with the color of my style?

I am attaching screenshots of my test site showing the ads displayed by your hacks.

I am not very good in programming and need help.

Thank you.

StarBuG
10-26-2007, 07:22 AM
1. How do I change the dotted lines around Google ads box into normal black line?



This would be one possibility:

<table class="tborder" align="center" border="0" cellpadding="6" cellspacing="1" width="100%">
<tbody>
<tr>
<td class="thead" align="center">&nbsp;</td>
</tr>
<tr>
<td class="alt1" colspan="2"> <span class="smallfont">
<center>
Google Adsense here
</center>
</td>
</tr>
</tbody>
</table>



2. How do I change the background color, surrounding color of the ads to merge with the color of my style?

You can go into your Adsense and create your own adsense banner (468x60px) with your own colors, channel, etc. and replace the one I put there.

or replace the color part with this:


google_color_border = "705C99";
google_color_bg = "F5F5FD";
google_color_link = "0C108B";
google_color_text = "2F251C";
google_color_url = "2F251C";


Or change the RGB Codes (#2F251C is one, for google adsense without the #) to your liking.

StarBuG

SVTCobraLTD
10-26-2007, 04:01 PM
Just curious on what the purpose would be to add Adsense to your forum? Is there a benefit to it. This really has nothing to do with the templete file but was curious why it would be done.

SVT

yoyoyoyo
10-26-2007, 04:48 PM
Just curious on what the purpose would be to add Adsense to your forum? Is there a benefit to it. This really has nothing to do with the templete file but was curious why it would be done.

SVTto make $

SVTCobraLTD
10-27-2007, 09:42 PM
to make $

How does that work?

SVT

induslady
10-30-2007, 03:09 AM
Hello StarBug,

Thank you for the tweaks you suggested. The tborder and color settings for the Google ads are now perfect and goes well with the style I use in my site.

I need one more help...if I may ask!

The ads showing up in between the blog entry and the comments (using the code in blog_show_entry) is either getting wrapped or the ad link is missing.

I tried this in Firefox - the ad link (URL) is not showing up.
I also tried in IE - the ad is getting wrapped and is incomplete.
I am attaching screenshots below.

Please help! Many thanks in advance.

StarBuG
10-30-2007, 03:13 PM
I have no clue what you mean.

induslady
10-31-2007, 06:02 PM
Please visit this link http://www.indusladies.com/forums/blog.php

using Internet explorer & Firefox browsers.

Please refere the Google ads below recent entries and recent comments section at the end of the page. You will see that the Google ads (when viewed in IE) are displaying one after the other and the 2nd ad is cut off. The height of the ad box isn't enough to fit.

If you see the same set of ads (when viewed in Firefox), the ads are displaying side by side within the box, but still the URL is cut off in the ads because of the height of the box.

Please can you help in this regards. Many Thanks!

StarBuG
10-31-2007, 06:54 PM
The box has no height.
It is defined by the ad inside.
It looks ok to me.

Some ads don't display URLs if the ad text uses 2 lines.
It is a standard 468x60px banner.

induslady
10-31-2007, 07:47 PM
StarBug,

I too don't see the issue with all the ads. The wrapping or cut-off of the ads happen only at certain instances. If you do a refresh repeatedly, you will notice one such instance for the ad showing up.

I know this might not be a problem with your hack, but jsut want to know if any tweaking in the code can fix the issue. I have also written to Google.

Many thanks.

StarBuG
11-06-2007, 04:10 PM
There is no tweak, it is a browser problem of yours.

ZapFlash
04-13-2008, 06:19 PM
i knew it was a waste not having a banner in the blogs home and you solved that, thank you very much, i'm gonna check your adsense series :)

DNN
06-26-2011, 12:30 AM
It was assumed that one could automatically add AdSense in the CMS blog section in admincp. Is there a plugin that is needed additionally? Please advise.