Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: aufordboy on December 26, 2005, 04:43:07 PM

Title: Google Adsense for Amber theme by Bloc
Post by: aufordboy on December 26, 2005, 04:43:07 PM
I have been playing around today to get adsense setup for my forum that is using Bloc's Amber design.  I added the adsense ads underneath the news & stats seen in the left column.  I was unable to find any info on adding adsense to this theme on the forum so I figured I'd post this.  You can see an example at my site: http://www.talkhuntingonline.com (http://www.talkhuntingonline.com)

File to edit: index.template.php (in the theme folder)

Find:
// The "key stats" box.
echo '<br /><div style="padding: 2px 5px 2px 20px;" class="titlebg0"><b>Stats</b></div>
<div class="windowbg02" style="padding: 10px;">
<div style="padding: 5px;" class="smalltext">
<b>', $context['common_stats']['total_posts'], '</b> ', $txt[95], ' ', $txt['smf88'], ' <b>', $context['common_stats']['total_topics'], '</b> ', $txt[64], ' ', $txt[525], ' <span style="white-space: nowrap;"><b>', $context['common_stats']['total_members'], '</b> ', $txt[19], '</span><br />
', $txt[656], ': <b> ', $context['common_stats']['latest_member']['link'], '</b>
</div>
</div>';


Directly underneath this code you just found past the following (rember to add your adsense id)


//Google adsense here
echo '<br /><div style="padding: 2px 5px 2px 20px;" class="titlebg0"><b>Sponsors</b></div>
<div class="windowbg02" style="padding: 10px;">
<center><script type="text/javascript"><!--
google_ad_client = "pub-youridgoeshere";
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = "120x600_as";
google_ad_type = "text_image";
google_ad_channel ="channelgoeshere";
google_color_border = "9BA5AE";
google_color_bg = "9BA5AE";
google_color_link = "FFFFFF";
google_color_url = "000000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></center>
';
Title: Re: Google Adsense for Amber theme by Bloc
Post by: trenchteam on December 26, 2005, 05:38:04 PM
maybe this should go under tips and tricks. ???
Title: Re: Google Adsense for Amber theme by Bloc
Post by: aufordboy on December 26, 2005, 05:56:21 PM
A mod moved it to this category - this is not where I posted it
Title: Re: Google Adsense for Amber theme by Bloc
Post by: 1MileCrash on December 26, 2005, 05:59:12 PM
normal members cannot post in tips and tricks. you had previously posted it in the wrong section.


/me moves it to tips and tricks
Title: Re: Google Adsense for Amber theme by Bloc
Post by: True Knight on March 20, 2006, 11:15:03 PM
I'm also trying to get Ads using PHPadsnew in my board with the Amber theme. I have tried making the changes to the files, but have no luck.

I would like a banner ad at the top under the head and some ads on the left under the stats. Can anyone help?

Thanks!