Advertisement:

Author Topic: Google AdSense in SMF, various positions...  (Read 327293 times)

Offline Moonray

  • Semi-Newbie
  • *
  • Posts: 50
    • Joomlaspan Forum
Google AdSense in SMF, various positions...
« on: September 25, 2005, 11:46:56 PM »
Google AdSense and SMF:


--------
EDIT:
Please check my new post in this thread here.
Have made new changes and will be releasing them soon. Need your feedback on any further improvements.
Thanks
--------
All information is now being compiled at this thread in Joomlaspan forum also.


Position 1: After 1st post

File to be modded: Display.template.php

Find this in the file:
Code: [Select]
// Show the member's signature?
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
echo '
<hr width="100%" size="1" class="hrcolor" />
<div style="overflow: auto; width: 100%; padding-bottom: 3px;" class="signature">', $message['member']['signature'], '</div>';

echo '
</td>
</tr>
</table>
</td></tr>
</table>
</td></tr>';
[color=red]}[/color]

Insert this code, just ABOVE the "}" indicated in red, above.

Code: [Select]
if ($message['id'] == $context['first_message'])
echo '
<div align="center">
        <script type="text/javascript"><!--
        google_ad_client = "pub-youradsenseID";
        google_ad_width = 468;
        google_ad_height = 60;
        google_ad_format = "468x60_as";
        google_ad_type = "text";
        google_ad_channel ="yourCHANNEL";
        google_color_border = "577494";
        google_color_bg = "577494";
        google_color_link = "FFFFFF";
        google_color_url = "999999";
        google_color_text = "EFEFEF";
        //--></script>
        <script type="text/javascript"
          src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
        </script>
  </div>
';

PS: Do not forget to put in your AdSense ID.

Demo:
Mediscuss: Medical education Discussion forum

Position 2: Top of all pages, mimicking a category! (High CTR)

File to be modded: index.template.php

This example is specifically for the smfaqua theme. Necessary modifications may be done for other themes also.


Find this in the file:
Code: [Select]
// The main content should go here.  A table is used because IE 6 just can't handle a div.

Insert this code, just BELOW the code given above.

Code: [Select]
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>


<td style="padding: 1ex 1px 2ex 1px;" width="100%" valign="top">
<div class="tborder">
<table border="0" width="100%" cellspacing="1" cellpadding="5" height="72">
<tr>
<td  colspan="4" class="catbg" height="18"><img src="/Themes/smfaqua/images/post_old.gif" class="midimage" alt="No New Posts" title="No New Posts" border="0" />
<font size="1">Sponsored Links</font>
</td>
</tr>
<tr class="topicbg1">
<td class="topicbg1" align="center" valign="middle"><img src="/Themes/smfaqua/images/on.gif"  border="0" /></td>
<td class="topicbg1" align="left" width="70%">
<div style="float:right;text-align:right;">
    <a href="index.php?action=post;board=1.0"><img src="/Themes/smfaqua/images/n.gif" alt="n" border="0" title="Start new topic" /></a>
    <a href="index.php?action=markasread;sa=board;board=1.0"><img src="/Themes/smfaqua/images/m.gif" alt="m" border="0" title="Mark Topics as Read for this Forum" /></a>
    <a href="index.php?action=notifyboard;sa=on;board=1.0;sesc=233047cc065c2e23891b5ce3e234432f"><img src="/Themes/smfaqua/images/z.gif" alt="z" border="0" title="Notify of replies" /></a>
</div>
<script type="text/javascript"><!--
    google_ad_client = "pub-youradsenseID";
    google_ad_width = 468;
    google_ad_height = 60;
    google_ad_format = "468x60_as";
google_alternate_color = "F1F4F9"
    google_ad_type = "text";
    google_ad_channel ="youadsenseCHANNEL";
    google_color_border = "F1F4F9";
    google_color_bg = "F1F4F9";
    google_color_link = "094899";
    google_color_url = "787878";
    google_color_text = "333333";
    //--></script>
    <script type="text/javascript"
      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
</td>
<td class="topicbg1" valign="middle" align="center" style="width: 10%;" nowrap="nowrap">
<span class="smalltext">1 Post in<br/>1 Topic</span></td>
<td class="topicbg1" valign="middle" width="30%" nowrap="nowrap">
<span class="smalltext"><img border="0" src="/Themes/smfaqua/images/f.gif" align="middle" title="" alt="" />Posted <b>Today</b>,at 12:00:00 AM<br>by <u>Google</u></span></td>
</tr>
<tbody class="sep_display"><tr style="height:5px;"><td style="height:5px;padding:0;" colspan="4" class="catbg"></td></tr><tr style="padding:0;"><td style="padding:0;" colspan="4"><div class="catsep"></div></td></tr></tbody>
</table>
</div>';

PS: Do not forget to put in your AdSense ID.

Demo:
Mediscuss: Medical education Discussion forum

BOTH these have been tested to work seamlessly with the smfaqua theme. Will work in all themes with very little adaptations.


Also look at this if you are interested:


Chameleon code for Google AdSense
« Last Edit: December 16, 2005, 03:05:05 AM by shashikiranu »

Offline trenchteam

  • Sr. Member
  • ****
  • Posts: 901
  • Gender: Male
    • NO WALLS STANDING
Re: Google AdSense in SMF, various positions...
« Reply #1 on: September 27, 2005, 07:43:01 AM »
nice work! The codes work fantastic!  I get about 20,000 impressions a day on my site. It has skyrocketed my google ad clicks using your code! hehe ;D  ten bucks a day is great for paying for my host! ;D

Offline Moonray

  • Semi-Newbie
  • *
  • Posts: 50
    • Joomlaspan Forum
Re: Google AdSense in SMF, various positions...
« Reply #2 on: September 27, 2005, 10:00:25 PM »
Hey,

Good to know that these simple codes are helping you to earn a good income. Good luck.

Regards

Offline yellow1912

  • Jr. Member
  • **
  • Posts: 186
Re: Google AdSense in SMF, various positions...
« Reply #3 on: September 28, 2005, 01:13:47 AM »
I see in your forum you make it looks esactly like a second post but I couldnt do that. And the template I use is chatbubbles which is quite different from the default
My SMF forum ^^
An Ecommerce site I help to build

Offline wohoo

  • Semi-Newbie
  • *
  • Posts: 76
Re: Google AdSense in SMF, various positions...
« Reply #4 on: September 29, 2005, 02:17:47 PM »
The mimicing a category is very interesting indeed. However, is it allowed ?
The ToS says that you can not make it look like it's part of other links on your site.

I'm just a bit worried. Has anyone contacted Google to see if it's ok to place them like that ?
Stargate-Gaming - The biggest source for news and info about the upcoming games based on the Stargate franchise - Stargate-Gaming.com

Offline wohoo

  • Semi-Newbie
  • *
  • Posts: 76
Re: Google AdSense in SMF, various positions...
« Reply #5 on: September 29, 2005, 08:55:24 PM »
To be honest I can't remember if it was is in the ToS or if I read it from another site. I've read A LOT of stuff about AdSense in the past few days since I just got approved, so I can't be sure but I remember reading somewhere you can't trick people into clicking the ads. Isn't this what this basically is ?

I really like this idea though.
About 6hours ago I sent a question to Google about this to be 100% sure if that this can be done without risking a ban from AdSense. No answer yet unfortunately.
« Last Edit: September 29, 2005, 09:01:37 PM by wohoo »
Stargate-Gaming - The biggest source for news and info about the upcoming games based on the Stargate franchise - Stargate-Gaming.com

Offline dairy_man

  • Semi-Newbie
  • *
  • Posts: 16
Re: Google AdSense in SMF, various positions...
« Reply #6 on: September 29, 2005, 10:02:05 PM »
Hi..

do you have the codes if you want the ads to be placed in the left side corner?

Offline wohoo

  • Semi-Newbie
  • *
  • Posts: 76
Re: Google AdSense in SMF, various positions...
« Reply #7 on: September 30, 2005, 07:37:54 AM »
I sent a question to Google about this to be 100% sure if that this can be done without risking a ban from AdSense. No answer yet unfortunately.

The way I understood the TOS was to have the ads blend in and/or even put it smack in the middle sometimes... :o Either way, let us know what Google says okay?

I will.

I'm thinking of testing the above solution today though. Who knows when google might get back to me with the answer. If it's a problem, I'll remove it.
Stargate-Gaming - The biggest source for news and info about the upcoming games based on the Stargate franchise - Stargate-Gaming.com

Offline wohoo

  • Semi-Newbie
  • *
  • Posts: 76
Re: Google AdSense in SMF, various positions...
« Reply #8 on: September 30, 2005, 11:18:10 AM »
Just got a response from Google:

You can place your ads in a forum box but please clearly mark them as
advertisements or sponsored links.
Stargate-Gaming - The biggest source for news and info about the upcoming games based on the Stargate franchise - Stargate-Gaming.com

Offline beller

  • Newbie
  • *
  • Posts: 1
Re: Google AdSense in SMF, various positions...
« Reply #9 on: October 18, 2005, 03:00:13 PM »
Google AdSense and SMF:

Position 1: After 1st post

File to be modded: Display.template.php

Find this in the file:
Code: [Select]
// Show the member's signature?
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
echo '
<hr width="100%" size="1" class="hrcolor" />
<div style="overflow: auto; width: 100%; padding-bottom: 3px;" class="signature">', $message['member']['signature'], '</div>';

echo '
</td>
</tr>
</table>
</td></tr>
</table>
</td></tr>';
[color=red]}[/color]

Insert this code, just ABOVE the "}" indicated in red, above.

Code: [Select]
if ($message['id'] == $context['first_message'])
echo '
<div align="center">
        <script type="text/javascript"><!--
        google_ad_client = "pub-youradsenseID";
        google_ad_width = 468;
        google_ad_height = 60;
        google_ad_format = "468x60_as";
        google_ad_type = "text";
        google_ad_channel ="yourCHANNEL";
        google_color_border = "577494";
        google_color_bg = "577494";
        google_color_link = "FFFFFF";
        google_color_url = "999999";
        google_color_text = "EFEFEF";
        //--></script>
        <script type="text/javascript"
          src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
        </script>
  </div>
';

PS: Do not forget to put in your AdSense ID.

Demo:
hxxp:www.medspan.info/mediscuss/index.php/topic,3.0.html [nonactive]

Position 2: Top of all pages, mimicking a category! (High CTR)

File to be modded: index.template.php

This example is specifically for the smfaqua theme. Necessary modifications may be done for other themes also.


Find this in the file:
Code: [Select]
// The main content should go here.  A table is used because IE 6 just can't handle a div.

Insert this code, just BELOW the code given above.

Code: [Select]
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>


<td style="padding: 1ex 1px 2ex 1px;" width="100%" valign="top">
<div class="tborder">
<table border="0" width="100%" cellspacing="1" cellpadding="5" height="72">
<tr>
<td  colspan="4" class="catbg" height="18"><img src="/Themes/smfaqua/images/post_old.gif" class="midimage" alt="No New Posts" title="No New Posts" border="0" />
<font size="1">Sponsored Links</font>
</td>
</tr>
<tr class="topicbg1">
<td class="topicbg1" align="center" valign="middle"><img src="/Themes/smfaqua/images/on.gif"  border="0" /></td>
<td class="topicbg1" align="left" width="70%">
<div style="float:right;text-align:right;">
    <a href="index.php?action=post;board=1.0"><img src="/Themes/smfaqua/images/n.gif" alt="n" border="0" title="Start new topic" /></a>
    <a href="index.php?action=markasread;sa=board;board=1.0"><img src="/Themes/smfaqua/images/m.gif" alt="m" border="0" title="Mark Topics as Read for this Forum" /></a>
    <a href="index.php?action=notifyboard;sa=on;board=1.0;sesc=233047cc065c2e23891b5ce3e234432f"><img src="/Themes/smfaqua/images/z.gif" alt="z" border="0" title="Notify of replies" /></a>
</div>
<script type="text/javascript"><!--
    google_ad_client = "pub-youradsenseID";
    google_ad_width = 468;
    google_ad_height = 60;
    google_ad_format = "468x60_as";
google_alternate_color = "F1F4F9"
    google_ad_type = "text";
    google_ad_channel ="youadsenseCHANNEL";
    google_color_border = "F1F4F9";
    google_color_bg = "F1F4F9";
    google_color_link = "094899";
    google_color_url = "787878";
    google_color_text = "333333";
    //--></script>
    <script type="text/javascript"
      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
</td>
<td class="topicbg1" valign="middle" align="center" style="width: 10%;" nowrap="nowrap">
<span class="smalltext">1 Post in<br/>1 Topic</span></td>
<td class="topicbg1" valign="middle" width="30%" nowrap="nowrap">
<span class="smalltext"><img border="0" src="/Themes/smfaqua/images/f.gif" align="middle" title="" alt="" />Posted <b>Today</b>,at 12:00:00 AM<br>by <u>Google</u></span></td>
</tr>
<tbody class="sep_display"><tr style="height:5px;"><td style="height:5px;padding:0;" colspan="4" class="catbg"></td></tr><tr style="padding:0;"><td style="padding:0;" colspan="4"><div class="catsep"></div></td></tr></tbody>
</table>
</div>';

PS: Do not forget to put in your AdSense ID.

Demo:
hxxp:www.medspan.info/mediscuss/index.php [nonactive]

BOTH these have been tested to work seamlessly with the smfaqua theme. Will work in all themes with very little adaptations.


Also look at this if you are interested:


hxxp:mambo.medspan.info/myblog/tips-tricks/how-to-change-colors-the-chameleon-code-for-google-adsense/ [nonactive]

Looks good ..What changes are needed to place this in the CLASSIC theme?

Offline BermudaSucks

  • Newbie
  • *
  • Posts: 2
Re: Google AdSense in SMF, various positions...
« Reply #10 on: October 26, 2005, 12:45:56 PM »
Hi, 

I setup my Google Ads using the code from your first example... but now the forum logs people out as they are trying to read and post.  I'm sure it is related to the ads, as I've taken it out an the problem goes away.

Any idea why this is happening?

Thanks in advance.

Offline ChrilleK

  • Newbie
  • *
  • Posts: 2
Re: Google AdSense in SMF, various positions...
« Reply #11 on: October 26, 2005, 04:57:43 PM »
It doesn't say "// The main content should go here.  A table is used because IE 6 just can't handle a div." anywhere in my index.template.php hm?

Offline thetzfreak

  • Semi-Newbie
  • *
  • Posts: 99
Re: Google AdSense in SMF, various positions...
« Reply #12 on: October 26, 2005, 06:12:03 PM »
The second one doesn't work? I'm getting this problem:



First of all, the left image isn't working,

Second of all, there is always for some reason an n, m, and z there.

Third, it doesn't look like a regular category.

Help?

Offline ChrilleK

  • Newbie
  • *
  • Posts: 2
Re: Google AdSense in SMF, various positions...
« Reply #13 on: October 27, 2005, 04:10:29 AM »
I don't have smfaqua, where do I put the code for the second one in the classic theme's index.template.php?

Offline vimalonline

  • Newbie
  • *
  • Posts: 3
Re: Google AdSense in SMF, various positions...
« Reply #14 on: October 30, 2005, 01:34:45 PM »
hi,
   
  am a newbie..can u give me the coding for Position 2: (Top of all pages, mimicking a category)  for Longhorn theme..

With rgds,
Vimal

winnet

  • Guest
Re: Google AdSense in SMF, various positions...
« Reply #15 on: November 02, 2005, 11:31:43 AM »
it is somwhow possible to insert various codes depending on wich is displayed?
if you are in forum no 2 (example) to display the script from google, if you're in forum no 6 to display another script, the links script, etc...

or by category?

anyone could help with this?

plss

Offline mogadishu

  • Semi-Newbie
  • *
  • Posts: 69
  • Gender: Male
  • AHOST.RO FWH
    • New Sharing generation!
Re: Google AdSense in SMF, various positions...
« Reply #16 on: November 09, 2005, 05:17:48 PM »
Greate !!!!

Can You tell Me ["US"] Where To Insert CODe To Display the ADS Under every POST ?
Please Somebudy HELP !
AHost.ro- Free WebHosting & Free Domains .
AzD.Ro - Your Gambling Source !

Offline billp

  • Semi-Newbie
  • *
  • Posts: 13
Re: Google AdSense in SMF, various positions...
« Reply #17 on: November 17, 2005, 02:41:22 PM »
I got #1 working, then I added #2 and now ONLY #2 shows up. I am using the default theme. Anyone have any tips? I am using text links for #1 FYI. An example page can be found here: http://www.norcalkayakanglers.com/newbb/index.php?topic=2198.0 [nofollow]

Offline IncubuS

  • Semi-Newbie
  • *
  • Posts: 14
    • http://www.the-ien.com
Re: Google AdSense in SMF, various positions...
« Reply #18 on: November 24, 2005, 08:12:19 PM »
I cant make the second one to work on a different theme than the default one ... Would appreciate any help that can be done for more themes.
Thanks in advance.
www.the-ien.com [nofollow]

Offline thetzfreak

  • Semi-Newbie
  • *
  • Posts: 99
Re: Google AdSense in SMF, various positions...
« Reply #19 on: November 25, 2005, 05:47:35 PM »
It seems that this guy left us :( He hasn't logged on since 2 months ago.