Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: Moonray on September 25, 2005, 11:46:56 PM

Title: Google AdSense in SMF, various positions...
Post by: Moonray on September 25, 2005, 11:46:56 PM
Google AdSense and SMF:


--------
EDIT:
Please check my new post in this thread here. (http://www.simplemachines.org/community/index.php?topic=50984.msg411181#msg411181)
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 (http://joomla.medspan.info/forum/index.php/board,15.0.html) also.


Position 1: After 1st post

File to be modded: Display.template.php

Find this in the file:

// 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.


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 (http://www.medspan.info/mediscuss/index.php/topic,3.0.html)

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:

// 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.


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 (http://www.medspan.info/mediscuss/index.php)

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 (http://mambo.medspan.info/myblog/tips-tricks/how-to-change-colors-the-chameleon-code-for-google-adsense/)
Title: Re: Google AdSense in SMF, various positions...
Post by: trenchteam 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
Title: Re: Google AdSense in SMF, various positions...
Post by: Moonray 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
Title: Re: Google AdSense in SMF, various positions...
Post by: yellow1912 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
Title: Re: Google AdSense in SMF, various positions...
Post by: wohoo 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 ?
Title: Re: Google AdSense in SMF, various positions...
Post by: wohoo 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.
Title: Re: Google AdSense in SMF, various positions...
Post by: dairy_man 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?
Title: Re: Google AdSense in SMF, various positions...
Post by: wohoo on September 30, 2005, 07:37:54 AM
Quote from: That's The Hacker to you on September 29, 2005, 09:17:16 PM
Quote from: wohoo on September 29, 2005, 08:55:24 PM
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.
Title: Re: Google AdSense in SMF, various positions...
Post by: wohoo 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.
Title: Re: Google AdSense in SMF, various positions...
Post by: beller on October 18, 2005, 03:00:13 PM
Quote from: shashikiranu on September 25, 2005, 11:46:56 PM
Google AdSense and SMF:

Position 1: After 1st post

File to be modded: Display.template.php

Find this in the file:

// 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.


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 (http://www.medspan.info/mediscuss/index.php/topic,3.0.html)

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:

// 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.


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 (http://www.medspan.info/mediscuss/index.php)

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 (http://mambo.medspan.info/myblog/tips-tricks/how-to-change-colors-the-chameleon-code-for-google-adsense/)

Looks good ..What changes are needed to place this in the CLASSIC theme?
Title: Re: Google AdSense in SMF, various positions...
Post by: BermudaSucks 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.
Title: Re: Google AdSense in SMF, various positions...
Post by: ChrilleK 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?
Title: Re: Google AdSense in SMF, various positions...
Post by: thetzfreak on October 26, 2005, 06:12:03 PM
The second one doesn't work? I'm getting this problem:

(http://img488.imageshack.us/img488/8500/wrong0mj.th.png) (http://img488.imageshack.us/my.php?image=wrong0mj.png)

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?
Title: Re: Google AdSense in SMF, various positions...
Post by: ChrilleK 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?
Title: Re: Google AdSense in SMF, various positions...
Post by: vimalonline 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
Title: Re: Google AdSense in SMF, various positions...
Post by: winnet 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
Title: Re: Google AdSense in SMF, various positions...
Post by: mogadishu 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 !
Title: Re: Google AdSense in SMF, various positions...
Post by: billp 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
Title: Re: Google AdSense in SMF, various positions...
Post by: IncubuS 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.
Title: Re: Google AdSense in SMF, various positions...
Post by: thetzfreak on November 25, 2005, 05:47:35 PM
It seems that this guy left us :( He hasn't logged on since 2 months ago.
Title: Re: Google AdSense in SMF, various positions...
Post by: Moonray on December 04, 2005, 12:59:01 AM
Quote from: thetzfreak on November 25, 2005, 05:47:35 PM
It seems that this guy left us :( He hasn't logged on since 2 months ago.

Sorry, I was very busy for sometime and could not answer the questions here.

I have made changes to my forum themes and they look much better (to me) now. I will post the details here soon. Would it be better if I pack it as a 'new' theme itself?

Base theme used: curveSMF

Demo 1: Joomlaspan Forum (http://joomla.medspan.info/forum/index.php)

Demo 2: Mediscuss (http://www.medspan.info/mediscuss/index.php)

Would love your feedback on these modifications to the curveSMF theme to integrate AdSense into it...
Title: Re: Google AdSense in SMF, various positions...
Post by: IncubuS on December 04, 2005, 10:35:56 PM
Wow Demo 1: Joomlaspan Forum is really amazing .

Would you share this full template ? And question i seen that you are running under SMF 1.0.5 , this template ( if you gona share it ) gona work on 1.1RC1 ?
Title: Re: Google AdSense in SMF, various positions...
Post by: IncubuS on December 11, 2005, 08:12:30 AM
Will be great if you can share both of your themes they are great . Everyone would appreciate it  8)
Title: Re: Google AdSense in SMF, various positions...
Post by: Moonray on December 11, 2005, 12:53:25 PM
Thank you for appreciating the themes...

You can download the new theme based on curveSMF. It has been renamed GreenSense, an appropriate name, as it has green color adn AdSense :)

Details at Joomlaspan Forum:
GreenSense Theme for SMF with AdSense (http://joomla.medspan.info/forum/index.php?topic=41.0)

Thumbnail:
(http://joomla.medspan.info/forum/Themes/GreenSense/images/thumbnail.gif)

Preview:
Joomlaspan Forum (http://joomla.medspan.info/forum/index.php)

Download:
GreenSense Download (http://joomla.medspan.info/joomla-downloads/func,select/id,8/)

The files currently have the developer's AdSense ID. Please change it to your own. Details are at the forum thread mentioned above for this theme.
Title: Re: Google AdSense in SMF, various positions...
Post by: IncubuS on December 11, 2005, 04:36:02 PM
Im waiting every day for this release to be done  :D I gona check this post every day . keep us updated tho  :-*
Title: Re: Google AdSense in SMF, various positions...
Post by: Moonray on December 11, 2005, 04:38:42 PM
Quote from: IncubuS on December 11, 2005, 04:36:02 PM
Im waiting every day for this release to be done  :D I gona check this post every day . keep us updated tho  :-*

Check the post above. We were typing at the same time :)
Title: Re: Google AdSense in SMF, various positions...
Post by: Eternity on December 11, 2005, 06:18:42 PM
Hi Sorry have tried to follow your instructions but am getting an error message.  Template parse error.  I didn't change anything but inserted the adsense id, was going to make the colour amendents to fit with the template later am using the classic theme. 
Title: Re: Google AdSense in SMF, various positions...
Post by: winnet on December 11, 2005, 07:20:05 PM
there ane any posibillities to change the google script for each category?

for one category let say I want ads from one channel, for other category ads for other channel, etc.
Title: Re: Google AdSense in SMF, various positions...
Post by: Moonray on December 12, 2005, 01:57:51 AM
Quote from: winnet on December 11, 2005, 07:20:05 PM
there ane any posibillities to change the google script for each category?

for one category let say I want ads from one channel, for other category ads for other channel, etc.


Not with the current script.

Quote from: Query on December 11, 2005, 06:18:42 PM
Hi Sorry have tried to follow your instructions but am getting an error message.  Template parse error.  I didn't change anything but inserted the adsense id, was going to make the colour amendents to fit with the template later am using the classic theme. 

See if you are missing out some ' or ; characters... If you are not sure, post the script change you have made at the Joomlaspan forum, one of us will take a look at it.
Title: Re: Google AdSense in SMF, various positions...
Post by: IncubuS on December 12, 2005, 09:52:20 AM
All was great for be , but looks that theres a bug , at the 3post on a topic something screw up :
PS : Im useing SMF 1.0.5 fresh installed special for this theme .
PS2: At every 3rd post on a topic thats what happend. Any idea ?
heres a screen :

(http://www.art-media.ro/~incubus/Bug.JPG)
Title: Re: Google AdSense in SMF, various positions...
Post by: winnet on December 12, 2005, 10:20:17 AM
Quote from: shashikiranu on December 12, 2005, 01:57:51 AM
Quote from: winnet on December 11, 2005, 07:20:05 PM
there any any possibilities to change the google script for each category?

for one category let say I want ads from one channel, for other category ads for other channel, etc.


Not with the current script.



it's hard to modify?
should be more usefull and more personalized
Title: Re: Google AdSense in SMF, various positions...
Post by: Moonray on December 12, 2005, 10:22:37 AM
Quote from: IncubuS on December 12, 2005, 09:52:20 AM
All was great for be , but looks that theres a bug , at the 3post on a topic something screw up :
PS : Im useing SMF 1.0.5 fresh installed special for this theme .
PS2: At every 3rd post on a topic thats what happend. Any idea ?
heres a screen :


I see the problem. I will check it right now and correct it...
Thanks for letting me know.
Title: Re: Google AdSense in SMF, various positions...
Post by: IncubuS on December 12, 2005, 10:25:03 AM
I will wait in here for probaly one update :) Please keep us updated tho  :P
Title: Re: Google AdSense in SMF, various positions...
Post by: Moonray on December 12, 2005, 10:34:38 AM
Quote from: IncubuS on December 12, 2005, 10:25:03 AM
I will wait in here for probaly one update :) Please keep us updated tho  :P

?
Title: Re: Google AdSense in SMF, various positions...
Post by: IncubuS on December 12, 2005, 10:38:19 AM
Quote from: shashikiranu on December 12, 2005, 10:22:37 AM
Quote from: IncubuS on December 12, 2005, 09:52:20 AM
All was great for be , but looks that theres a bug , at the 3post on a topic something screw up :
PS : Im useing SMF 1.0.5 fresh installed special for this theme .
PS2: At every 3rd post on a topic thats what happend. Any idea ?
heres a screen :


I see the problem. I will check it right now and correct it...
Thanks for letting me know.


Well i belive you have to fix some of the source , and i thought that you will post a fix or something .
Title: Re: Google AdSense in SMF, various positions...
Post by: Moonray on December 12, 2005, 11:16:27 AM
Well, here you go.

Just download again from the same page. I have updated the file.

The problem apparently was in the instruction line - where I had instructed the change of AdSense ID. Have removed that... tested to work okay now.

If you have any further problems, please let me know.
Title: Re: Google AdSense in SMF, various positions...
Post by: Eternity on December 13, 2005, 03:54:01 AM
Quote from: shashikiranu on December 12, 2005, 01:57:51 AM
See if you are missing out some ' or ; characters... If you are not sure, post the script change you have made at the Joomlaspan forum, one of us will take a look at it.


Thanks very much for your reply.  I will redo check it and then if I can't find the problem, I will do as you have suggested and post the script at Joomlaspan. thanks Appreciated. 
Title: Re: Google AdSense in SMF, various positions...
Post by: Eternity on December 13, 2005, 04:13:06 AM
Shashikiranu

Really cool its working now, I checked and fixed something and now they are working.  One little hinge they have a //> in front of the ad so I not sure I must have made a mistake somewhere. I will try to recheck that straight away. They show up under the first post I would love to have them on the header of also if possible.  Is there any way to do that?  Or will that create too many problems with logging in and out issues?

Thanks for all your assistance and patience.
Title: Re: Google AdSense in SMF, various positions...
Post by: Moonray on December 13, 2005, 04:18:03 AM
Quote from: Query on December 13, 2005, 04:13:06 AM
They show up under the first post I would love to have them on the header of also if possible.  Is there any way to do that?  Or will that create too many problems with logging in and out issues?

Thanks for all your assistance and patience.


Header as in my forum currently? Check the Joomlaspan Forum (http://joomla.medspan.info/forum/index.php) now. Is that what you need?
Title: Re: Google AdSense in SMF, various positions...
Post by: Eternity on December 13, 2005, 04:28:19 AM
Quote from: shashikiranu on December 13, 2005, 04:18:03 AM

Header as in my forum currently? Check the Joomlaspan Forum (http://joomla.medspan.info/forum/index.php) now. Is that what you need?

Thats a beautiful forum nice design and layout.  You know the banner under your main menus just like that but a google ad box.  Inbetween the body of the forum and the login headings box.

Thanks so much for that script, it was really easy to install.  I don't think I will bother to change the colours after all they seem to blend in just fine with the classic theme.

Title: Re: Google AdSense in SMF, various positions...
Post by: Moonray on December 13, 2005, 04:36:20 AM
Okay, I just changed the layout as per your suggestions, is that what you need?
Title: Re: Google AdSense in SMF, various positions...
Post by: Eternity on December 13, 2005, 05:07:50 AM
Quote from: shashikiranu on December 13, 2005, 04:36:20 AM
Okay, I just changed the layout as per your suggestions, is that what you need?

Yes that was exactly what I was looking for.  How do I do that please.  Thanks so much for all your patience and assistance.  Our layout  is a bit different though for us it is more like this forum with a menu box at the top with all the login menus then a space then the main forum body.  Between that menu at the top and the forum body would be great. 
Title: Re: Google AdSense in SMF, various positions...
Post by: fanime7 on December 16, 2005, 01:57:58 AM
How do I add adsense under the first topic under (subject).  Just like joomlahacks.com
Title: Re: Google AdSense in SMF, various positions...
Post by: Moonray on December 16, 2005, 02:35:17 AM
That's been added to the "to do" list. Thank you for the tip.

Watch this page on "Integration of Google AdSense in SMF" (http://joomla.medspan.info/forum/index.php?topic=36.msg74#msg74)
Title: Re: Google AdSense in SMF, various positions...
Post by: unExpected on December 16, 2005, 02:39:39 AM
Open Display.template.php Find
// Show the member's signature?
      if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
         echo '
                     <hr width="100%" size="1" class="hrcolor" />
                     <div class="signature">', $message['member']['signature'], '</div>';

      echo '
                  </td>
               </tr>
            </table>
         </td></tr>
      </table>
   </td></tr>';


replace it with


// Show the member's signature?
      if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
         echo '
                     <hr width="100%" size="1" class="hrcolor" />
                     <div class="signature">', $message['member']['signature'], '</div>';

      echo '
                  </td>
               </tr>
            </table>
         </td></tr>
      </table>
   </td></tr>';
      //Show Google Adsense after the 1st post
if ($message['id'] == $context['first_message'])
         echo '
         <div align="center">
        <script type="text/javascript"><!--
        google_ad_client = "YOURADSENSECODE";
        google_ad_width = 728;
        google_ad_height = 90;
        google_ad_format = "728x90_as";
        google_ad_type = "text";
        google_ad_channel ="";
        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>
         ';
      //End of the adsense Code
Title: Re: Google AdSense in SMF, various positions...
Post by: Moonray on December 16, 2005, 03:00:25 AM
Dear Mashahood,

The script you suggested inserts a google ad as a "second post". An example has already been posted here (http://joomla.medspan.info/forum/index.php/topic,39.0.html). What fanime7 asked was to add it as a "second topic" in a board.

Thanks
Title: Re: Google AdSense in SMF, various positions...
Post by: bjp on December 20, 2005, 10:42:53 AM
if ($message['id'] == $context['first_message'])

What about to show adsense in second post just for non member ?
Title: Re: Google AdSense in SMF, various positions...
Post by: peterstannard on December 21, 2005, 09:23:01 AM
Is it possible to add Google Adsense to the "forum news" or to user signatures?
Title: Re: Google AdSense in SMF, various positions...
Post by: EQWebHost on December 23, 2005, 06:04:36 AM
Quote from: shashikiranu on September 25, 2005, 11:46:56 PM
Google AdSense and SMF:


--------
EDIT:
Please check my new post in this thread here. (http://www.simplemachines.org/community/index.php?topic=50984.msg411181#msg411181)
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 (http://joomla.medspan.info/forum/index.php/board,15.0.html) also.


Position 1: After 1st post

File to be modded: Display.template.php

Find this in the file:

// 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.


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 (http://www.medspan.info/mediscuss/index.php/topic,3.0.html)

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:

// 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.


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 (http://www.medspan.info/mediscuss/index.php)

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 (http://mambo.medspan.info/myblog/tips-tricks/how-to-change-colors-the-chameleon-code-for-google-adsense/)

I followed all that, but I kept getting "parse errors"
Title: Re: Google AdSense in SMF, various positions...
Post by: aufordboy on December 25, 2005, 05:55:15 PM
Thanks - code works great!
Title: Re: Google AdSense in SMF, various positions...
Post by: nokonium on January 02, 2006, 07:35:47 PM
One of my co-admins and I have been trying to get Adsense working properly with RC2. One insertion works fine, but adding a second and a third brings display problems, mostly only the first one shows. Sometimes with few refreshes you can get more than one.

Adsense and RC2 don't work well together.
Title: Re: Google AdSense in SMF, various positions...
Post by: sadiqbaig on January 17, 2006, 12:54:31 AM
Quote from: shashikiranu on September 25, 2005, 11:46:56 PM
Google AdSense and SMF:


--------
EDIT:
Please check my new post in this thread here. (http://www.simplemachines.org/community/index.php?topic=50984.msg411181#msg411181)
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 (http://joomla.medspan.info/forum/index.php/board,15.0.html) also.




i tried dowloading 4rm this url

http://joomla.medspan.info/joomla-downloads/func,fileinfo/id,12/

but i m not getting complete download

so plz copy ur code in here

GreenSense Index file with Google Banner on Top

or email me

sadiqbaig@gmail.com

plz plz
Title: Re: Google AdSense in SMF, various positions...
Post by: sadiqbaig on January 17, 2006, 01:00:19 AM

plz give the code in here

i want to add it in default theme

its in display.template.php

but its not working

google ads in users avataar , n signatures

also i tried skyscaper ad but how to get it in left

no links to the forum or other site plz

plz post the code in here
Title: Re: Google AdSense in SMF, various positions...
Post by: sadiqbaig on January 17, 2006, 01:07:00 AM

also how to add it in

board category

like

General Discussion
Feel free to talk about anything and everything in this board.

Google ads
Title: Re: Google AdSense in SMF, various positions...
Post by: sadiqbaig on January 18, 2006, 12:07:35 AM

plz sum1 HELP
Title: Re: Google AdSense in SMF, various positions...
Post by: StanJ on February 05, 2006, 01:41:55 PM
Strange

When I put the code in as given by shashikiranu, and ad my own adsense pub-etc  etc etc

I get a link basically sending them to his referal page for amazom or similar.

Am I doing something wrong or is he getting a zillion links on this?

Thanks
Title: Re: Google AdSense in SMF, various positions...
Post by: StanJ on February 05, 2006, 01:57:04 PM
This is what i have now, and it is coming up blank...
??

Any ideas?
www.foroadventista.com
Quote// Show the member's signature?
      if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
         echo '
                     <hr width="100%" size="1" class="hrcolor" />
                     <div class="signature">', $message['member']['signature'], '</div>';

      echo '
                  </td>
               </tr>
            </table>
         </td></tr>
      </table>
   </td></tr>';
      //Show Google Adsense after the 1st post
if ($message['id'] == $context['first_message'])
         echo '
         <div align="center">
        <script type="text/javascript"><!--
        google_ad_client = "pub-4098094541740579";
        google_ad_width = 728;
        google_ad_height = 90;
        google_ad_format = "728x90_as";
        google_ad_type = "text_image";
        google_ad_channel ="4809291968";
        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>
         ';
      //End of the adsense Code
}
   echo '
   <tr><td style="padding: 0 0 1px 0;"></td></tr>
</table>
Title: Re: Google AdSense in SMF, various positions...
Post by: TheChicken on February 05, 2006, 01:59:58 PM
This is just a guess but try this,
// Show the member's signature?
      if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
         echo '
                     <hr width="100%" size="1" class="hrcolor" />
                     <div class="signature">', $message['member']['signature'], '</div>';

      echo '
                  </td>
               </tr>
            </table>
         </td></tr>
      </table>
   </td></tr><tr><td>';
      //Show Google Adsense after the 1st post
if ($message['id'] == $context['first_message'])
         echo '
         <div align="center">
        <script type="text/javascript"><!--
        google_ad_client = "pub-4098094541740579";
        google_ad_width = 728;
        google_ad_height = 90;
        google_ad_format = "728x90_as";
        google_ad_type = "text_image";
        google_ad_channel ="4809291968";
        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>
         ';
      //End of the adsense Code
}
   echo '
   </td><tr><td style="padding: 0 0 1px 0;"></td></tr>
</table>
Title: Re: Google AdSense in SMF, various positions...
Post by: StanJ on February 05, 2006, 02:24:29 PM
Appreciate your input ,  it is still not working BUT  the blank is not under the first post rather than on top of it.

I am using tinyportal  but do not think that affects it at all.  When I used the other guys code it was showing up with links to his afflicate page...

Weird

Title: Re: Google AdSense in SMF, various positions...
Post by: TheChicken on February 05, 2006, 02:33:33 PM
Oh yeah, Google ads can take time to show up for some reason. There usually not instant to show up.
Title: Re: Google AdSense in SMF, various positions...
Post by: trenchteam on February 05, 2006, 05:41:22 PM
You have to give your site time to be spidered... I have over 500,000 posts so it took quite sometime. Now my site is filled with ads.  As you can see at www.shoyoroll.com/forum or www.otek671.com
Title: Re: Google AdSense in SMF, various positions...
Post by: StanJ on February 07, 2006, 08:21:10 AM
The google ads are still a blank space after the first post....
I thought i did the code right...
example, see the huge blank after the first post..

http://foroadventista.com/index.php/topic,39.0.html

Thanks for any help..
Title: Re: Google AdSense in SMF, various positions...
Post by: Moonray on February 07, 2006, 10:37:26 AM
Quote from: StanJ on February 07, 2006, 08:21:10 AM
The google ads are still a blank space after the first post....
I thought i did the code right...
example, see the huge blank after the first post..

http://foroadventista.com/index.php/topic,39.0.html

Thanks for any help..

Obviously there is something wrong with the codes. You google adsense code is okay, but the inserted code is sour. Check it again and may be redo it all over again.

Good luck.
Title: Re: Google AdSense in SMF, various positions...
Post by: mann3r on February 13, 2006, 02:31:14 AM
hello all,
first i dont like to hijack this thread,
second is my problem on my forum
it is located at www.stuffdaily.com/forums

i want my adsense to NOT appear on registration page because i believe it is against adsense TOS.

The forum is up but no post yet because i am setting it up. I am using the default theme
Title: Re: Google AdSense in SMF, various positions...
Post by: mann3r on February 13, 2006, 03:21:36 AM
sorry, i just found it out on how to
Title: Re: Google AdSense in SMF, various positions...
Post by: Prasad007 on February 13, 2006, 04:14:35 AM
thanks for the info guys! Although now i use the Ad management mod for my site! :)
Title: Re: Google AdSense in SMF, various positions...
Post by: ormuz on February 16, 2006, 12:05:56 PM
And who to make this in the new deafult theme (1.1 rc2)? Can someone post he code please?
Title: Re: Google AdSense in SMF, various positions...
Post by: ZhongFu on February 17, 2006, 12:34:35 PM
Thanks this work great! Expect for the color, all is great!
Title: Re: Google AdSense in SMF, various positions...
Post by: knightfolk on March 12, 2006, 04:10:32 PM
Quote from: StanJ on February 05, 2006, 02:24:29 PM
Appreciate your input ,  it is still not working BUT  the blank is not under the first post rather than on top of it.

I am using tinyportal  but do not think that affects it at all.  When I used the other guys code it was showing up with links to his afflicate page...

Weird



I was having the same problem.. I had adsense in a in another block and turned it off and the ads starting showing up in the posts just the way they should.  hope this helps.
Title: Re: Google AdSense in SMF, various positions...
Post by: mcm on March 29, 2006, 10:10:51 PM
Quote from: Mashahood on December 16, 2005, 02:39:39 AM
Open Display.template.php Find
// Show the member's signature?
      if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
         echo '
                     <hr width="100%" size="1" class="hrcolor" />
                     <div class="signature">', $message['member']['signature'], '</div>';

      echo '
                  </td>
               </tr>
            </table>
         </td></tr>
      </table>
   </td></tr>';


replace it with


// Show the member's signature?
      if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
         echo '
                     <hr width="100%" size="1" class="hrcolor" />
                     <div class="signature">', $message['member']['signature'], '</div>';

      echo '
                  </td>
               </tr>
            </table>
         </td></tr>
      </table>
   </td></tr>';
      //Show Google Adsense after the 1st post
if ($message['id'] == $context['first_message'])
         echo '
         <div align="center">
        <script type="text/javascript"><!--
        google_ad_client = "YOURADSENSECODE";
        google_ad_width = 728;
        google_ad_height = 90;
        google_ad_format = "728x90_as";
        google_ad_type = "text";
        google_ad_channel ="";
        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>
         ';
      //End of the adsense Code

This looks like this http://www.fullfunda.com/forum/index.php?topic=622.0

Anyone know how to get this to work with 1.06 ?

I tried it .. and it just puts an uncentered ad "on top" of the first post.

Thanks
;D
Title: Re: Google AdSense in SMF, various positions...
Post by: carlatf on April 09, 2006, 11:30:27 PM
hi,

any ideas of how to show advertisement in the 5th message of a thread?

best,
Carla
Title: Re: Google AdSense in SMF, various positions...
Post by: sbarnes on April 20, 2006, 07:40:00 PM
What can be changed so that when the adsense links are clicked they are opened in a new window?
Title: Re: Google AdSense in SMF, various positions...
Post by: Prasad007 on April 21, 2006, 02:04:11 AM
Quote from: sbarnes on April 20, 2006, 07:40:00 PM
What can be changed so that when the adsense links are clicked they are opened in a new window?
ya good question. wanted to know that myself...
wouldnt want my members to go elsewhere upon clicking of ads.
Title: Re: Google AdSense in SMF, various positions...
Post by: JayBachatero on April 21, 2006, 02:07:33 AM
You can't do that.  It is againgt Google's TOS.
Title: Re: Google AdSense in SMF, various positions...
Post by: Prasad007 on April 21, 2006, 02:23:25 AM
Oh okay. but what if im using another ad company that hasnt specified anything about the same.
Is there any particular code for it ?
Title: Re: Google AdSense in SMF, various positions...
Post by: mcm on April 21, 2006, 03:44:30 AM
Quote from: Prasad007 on April 21, 2006, 02:23:25 AM
Oh okay. but what if im using another ad company that hasnt specified anything about the same.
Is there any particular code for it ?


If the "other" ad companys script resides at thier site like Googles does... then you would have to hack into thier site to change it ... then get your account cancelled !  :D
Title: Re: Google AdSense in SMF, various positions...
Post by: Prasad007 on April 21, 2006, 03:51:03 AM
Quote from: mcm on April 21, 2006, 03:44:30 AM
Quote from: Prasad007 on April 21, 2006, 02:23:25 AM
Oh okay. but what if im using another ad company that hasnt specified anything about the same.
Is there any particular code for it ?


If the "other" ad companys script resides at thier site like Googles does... then you would have to hack into thier site to change it ... then get your account cancelled !  :D
hmmmm ::) seems pretty simple
lol :P
bah. forget it :P
Title: Re: Google AdSense in SMF, various positions...
Post by: sbarnes on April 21, 2006, 05:21:50 AM
Thats a bit god damn cheeky if you ask me. Surely if its your site you should have the say as to the workings of it. Nevermind, thanks.
Title: Re: Google AdSense in SMF, various positions...
Post by: geezmo on April 22, 2006, 06:38:55 AM
Quote from: mcm on March 29, 2006, 10:10:51 PM
Quote from: Mashahood on December 16, 2005, 02:39:39 AM
Open Display.template.php Find
// Show the member's signature?
      if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
         echo '
                     <hr width="100%" size="1" class="hrcolor" />
                     <div class="signature">', $message['member']['signature'], '</div>';

      echo '
                  </td>
               </tr>
            </table>
         </td></tr>
      </table>
   </td></tr>';


replace it with


// Show the member's signature?
      if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
         echo '
                     <hr width="100%" size="1" class="hrcolor" />
                     <div class="signature">', $message['member']['signature'], '</div>';

      echo '
                  </td>
               </tr>
            </table>
         </td></tr>
      </table>
   </td></tr>';
      //Show Google Adsense after the 1st post
if ($message['id'] == $context['first_message'])
         echo '
         <div align="center">
        <script type="text/javascript"><!--
        google_ad_client = "YOURADSENSECODE";
        google_ad_width = 728;
        google_ad_height = 90;
        google_ad_format = "728x90_as";
        google_ad_type = "text";
        google_ad_channel ="";
        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>
         ';
      //End of the adsense Code

This looks like this http://www.fullfunda.com/forum/index.php?topic=622.0

Anyone know how to get this to work with 1.06 ?

I tried it .. and it just puts an uncentered ad "on top" of the first post.

Thanks
;D

I have the same problem. Adsense is on top-left of the first post not under it. And there's no "dummy poster" aka "Sponsored Links."

Anyone?
Title: Re: Google AdSense in SMF, various positions...
Post by: Sledgie on May 02, 2006, 09:50:34 PM
Quote from: shashikiranu on September 25, 2005, 11:46:56 PM
Google AdSense and SMF:


--------
EDIT:
Please check my new post in this thread here. (http://www.simplemachines.org/community/index.php?topic=50984.msg411181#msg411181)
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 (http://joomla.medspan.info/forum/index.php/board,15.0.html) also.


Position 1: After 1st post

File to be modded: Display.template.php

Find this in the file:

// 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.


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 (http://www.medspan.info/mediscuss/index.php/topic,3.0.html)


Grr. It's making me crazy! I don't use the same theme, I use Oxygen, and I can't find where this code goes. Oxygen doesn't have a display.template.php. I've searched every file I could think of looking for the "signature" code and I can't find it. Does anyone know where it is in the Oxygen theme?
Title: Re: Google AdSense in SMF, various positions...
Post by: trenchteam on May 05, 2006, 07:02:52 PM
If oxygen doesnt have a display template then its using the default template.  Use that.
Title: Re: Google AdSense in SMF, various positions...
Post by: gulhalim on May 14, 2006, 11:27:39 AM
I am having a littel bit of problem and hoping someone could help me out.

this is my website forum http://www.matrix-network.firstclus.com/index.php?option=com_smf&Itemid=28 and as you see in the picture below

(http://i30.photobucket.com/albums/c344/gulhalim/untitled66.jpg)

as you guys can see i dont know where should i add the adsese

this is my index.template.php file

<?php
// Version: 1.0; index

/* This template is, perhaps, the most important template in the theme.  It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below.  It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.

The init sub template should load any data and set any hardcoded options.

The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.

The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.

The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.

The menu sub template should display all the relevant buttons the user
wants and or needs.

For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
global $context$settings$options$txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';
}

// The main sub template above the content.
function template_main_above()
{
global $context$settings$options$scripturl$txt;

// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html'
$context['right_to_left'] ? ' dir="rtl"' '''><head>
<meta http-equiv="Content-Type" content="text/html; charset='
$context['character_set'], '" />
<meta name="description" content="'
$context['page_title'], '" />
<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js"></script>
<script language="JavaScript" type="text/javascript"><!--
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
// --></script>
<title>'
$context['page_title'], '</title>
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css" />';

/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/fonts-compat.css" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="'
$scripturl'?action=help" target="_blank" />
<link rel="search" href="' 
$scripturl '?action=search" />
<link rel="contents" href="'
$scripturl'" />';

// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="' 
$scripturl '?action=;topic=' $context['current_topic'] . '.0;prev_next=prev" />
<link rel="next" href="' 
$scripturl '?action=;topic=' $context['current_topic'] . '.0;prev_next=next" />';

// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="' 
$scripturl '?action=;board=' $context['current_board'] . '.0" />';

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '
</head>
<body background="'
$settings['images_url'], '/box/bac.png" topmargin="5" leftmargin="5"><table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#FFFFFF">
<tr>
<td width="5">
<img border="0" src="'
$settings['images_url'], '/box/top_left.png" width="12" height="12"></td>
<td background="'
$settings['images_url'], '/box/top.png">
<img border="0" src="'
$settings['images_url'], '/box/top.png" width="3" height="12"></td>
<td width="5">
<img border="0" src="'
$settings['images_url'], '/box/top_right.png" width="14" height="12"></td>
</tr>
<tr>
<td width="5" background="'
$settings['images_url'], '/box/left.png">&nbsp;</td>
<td>'
;

// The logo, user information, news, and menu.
echo '
<table cellspacing="0" cellpadding="0" border="0" align="center" width="100%" >
<tr style="background-color: #ffffff;">
<td valign="middle" align="left">
<table border="0" cellpadding="0" cellspacing="0" width="100%" background="'
$settings['images_url'], '/bac_logo.png">
<tr>
<td>
<img border="0" src="'
$settings['images_url'], '/left_logo.png" width="462" height="88"></td>
<td width="5">
<img border="0" src="'
$settings['images_url'], '/left_icc.png" width="7" height="88"></td>
<td width="291" background="'
$settings['images_url'], '/bac_icc.png"  style="color: #FFFFFF">
'
;

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
'
$txt['hello_member'], ' <b>'$context['user']['name'], '</b>'$context['allow_pm'] ? ', ' $txt[152] . ' <a href="' $scripturl '?action=pm"  style="color: #FFFFFF">' $context['user']['messages'] . ' ' . ($context['user']['messages'] != $txt[153] : $txt[471]) . '</a>' $txt['newmessages4'] . ' ' $context['user']['unread_messages'] . ' ' . ($context['user']['unread_messages'] == $txt['newmessages0'] : $txt['newmessages1']) : '''.';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '<br />
'
$context['unapproved_members'] == $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="'$scripturl'?action=regcenter">'$context['unapproved_members'] == $txt['approve_member'] : $context['unapproved_members'] . ' ' $txt['approve_members'], '</a> '$txt['approve_members_waiting'];

// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '<br />
<b>'
$txt[616], '</b>';
}
// Otherwise they're a guest - so politely ask them to register or login.
else
echo '
'
$txt['welcome_guest'];

echo '
<br />'
$context['current_time'], '
</td>
<td width="5">
<img border="0" src="'
$settings['images_url'], '/right_icc.png" width="11" height="88"></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2" valign="middle" align="center">
<table border="0" cellpadding="0" cellspacing="0" width="100%" background="'
$settings['images_url'], '/bac_icon.png">
<tr>
<td width="5">
<img border="0" src="'
$settings['images_url'], '/left_icon.png" width="12" height="35"></td>
<td>'
;

// Show the menu here, according to the menu sub template.
template_menu();

echo '
</td>
<td width="5">
<img border="0" src="'
$settings['images_url'], '/right_icon.png" width="12" height="35"></td>
</tr>
</table></td>
</tr>'
;

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<tr>
<td colspan="2" height="24"><table border="0" cellpadding="0" cellspacing="0" width="100%" background="'
$settings['images_url'], '/bac_news.png">
<tr>
<td width="4">
<img border="0" src="'
$settings['images_url'], '/left_news.png" width="12" height="29"></td>
<td><b>'
$txt[102], ':</b> '$context['random_news_line'], '</td>
<td width="4">
<img border="0" src="'
$settings['images_url'], '/right_news.png" width="12" height="29"></td>
</tr>
</table>
</td>
</tr>'
;

echo '
</table>'
;
}

function 
template_main_below()
{
global $context$settings$options$scripturl$txt;

echo '
'
;

// Show a vB style login for quick login?
if ($context['show_vBlogin'])
echo '
<table cellspacing="0" cellpadding="0" border="0" align="center" width="100%">
<tr><td nowrap="nowrap" align="right">
<form action="'
$scripturl'?action=login2" method="post"><br />
<input type="text" name="user" size="7" />
<input type="password" name="passwrd" size="7" />
<select name="cookielength">
<option value="60">'
$txt['smf53'], '</option>
<option value="1440">'
$txt['smf47'], '</option>
<option value="10080">'
$txt['smf48'], '</option>
<option value="302400">'
$txt['smf49'], '</option>
<option value="-1" selected="selected">'
$txt['smf50'], '</option>
</select>
<input type="submit" value="'
$txt[34], '" /><br />
'
$txt['smf52'], '
</form>
</td></tr>
</table>'
;
// Don't show a login box, just a break.
else
echo '
<br />'
;

// Show the "Powered by" and "Valid" logos, as well as the copyright.  Remember, the copyright must be somewhere!
echo '
<br />

<table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
<tr>
<td width="28%" valign="middle" align="right">
<a href="http://www.mysql.com/" target="_blank"><img src="'
$settings['images_url'], '/mysql.gif" alt="'$txt['powered_by_mysql'], '" width="88" height="31" border="0" /></a>
<a href="http://www.php.net/" target="_blank"><img src="'
$settings['images_url'], '/php.gif" alt="'$txt['powered_by_php'], '" width="88" height="31" border="0" /></a>
</td>
<td width="44%" valign="middle" align="center">
'
theme_copyright(), '
<p><font size="1">Design:</font><b><a target="_blank" href="http://www.mambotemplate.ir"><font size="1">DigitalEye</font></a></b></p> </td>
<td width="28%" valign="middle" align="left">
<a href="http://validator.w3.org/check/referer" target="_blank"><img src="'
$settings['images_url'], '/valid-xhtml10.gif" alt="'$txt['valid_xhtml'], '" width="88" height="31" border="0" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img src="'
$settings['images_url'], '/valid-css.gif" alt="'$txt['valid_css'], '" width="88" height="31" border="0" /></a>
</td>
</tr>
</table>'
;

// Show the load time?
if ($context['show_load_time'])
echo '
<div align="center" class="smalltext">
'
$txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '
</div>'
;

// And then we're done!
echo '
</td>
<td width="5" background="'
$settings['images_url'], '/box/right.png">&nbsp;</td>
</tr>
<tr>
<td width="5">
<img border="0" src="'
$settings['images_url'], '/box/bot_left.png" width="12" height="12"></td>
<td background="'
$settings['images_url'], '/box/bot.png">
<img border="0" src="'
$settings['images_url'], '/box/bot.png" width="3" height="12"></td>
<td width="5">
<img border="0" src="'
$settings['images_url'], '/box/bot_right.png" width="14" height="12"></td>
</tr>
</table></body>
</html>'
;
}

// Show a linktree.  This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
global $context$settings$options;

// Folder style or inline?  Inline has a smaller font.
echo '<span class="nav"'$settings['linktree_inline'] ? ' style="font-size: smaller;"' '''>';

// Each tree item has a URL and name.  Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show the | | |-[] Folders.
if (!$settings['linktree_inline'])
{
if ($link_num 0)
echo str_repeat('<img src="' $settings['images_url'] . '/icons/linktree_main.gif" alt="| " border="0" />'$link_num 1), '<img src="' $settings['images_url'] . '/icons/linktree_side.gif" alt="|-" border="0" />';
echo '<img src="' $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" />&nbsp; ';
}

// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo '<b>'$settings['linktree_link'] && isset($tree['url']) ? '<a href="' $tree['url'] . '" class="nav">' $tree['name'] . '</a>' $tree['name'], '</b>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo $settings['linktree_inline'] ? ' &nbsp;|&nbsp; ' '<br />';
}

echo '</span>';
}

// Show the menu up top.  Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context$settings$options$scripturl$txt;

// Show the [home] and [help] buttons.
echo '
<a href="'
$scripturl'">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/home.gif" alt="' $txt[103] . '" border="0" />' $txt[103]), '</a>''
<a href="'
$scripturl'?action=help" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/help.gif" alt="' $txt[119] . '" border="0" />' $txt[119]), '</a>';

// How about the [search] button?
if ($context['allow_search'])
echo '
<a href="'
$scripturl'?action=search">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/search.gif" alt="' $txt[182] . '" border="0" />' $txt[182]), '</a>';

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo '
<a href="'
$scripturl'?action=admin">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/admin.gif" alt="' $txt[2] . '" border="0" />' $txt[2]), '</a>';

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo '
<a href="'
$scripturl'?action=profile">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/profile.gif" alt="' $txt[79] . '" border="0" />' $txt[467]), '</a>';

// The [calendar]!
if ($context['allow_calendar'])
echo '
<a href="'
$scripturl'?action=calendar">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/calendar.gif" alt="' $txt['calendar24'] . '" border="0" />' $txt['calendar24']), '</a>';

// If the user is a guest, show [login] and [register] buttons.
if ($context['user']['is_guest'])
{
echo '
<a href="'
$scripturl'?action=login">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/login.gif" alt="' $txt[34] . '" border="0" />' $txt[34]), '</a>''
<a href="'
$scripturl'?action=register">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/register.gif" alt="' $txt[97] . '" border="0" />' $txt[97]), '</a>';
}
// Otherwise, they might want to [logout]...
else
echo '
<a href="'
$scripturl'?action=logout;sesc='$context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/logout.gif" alt="' $txt[108] . '" border="0" />' $txt[108]), '</a>';
}

?>
Title: Re: Google AdSense in SMF, various positions...
Post by: lesmond on May 16, 2006, 10:15:31 AM
This is how I put adsence on my test board..

This can be used with any theme :)

go to admin/Boards/Modify Boards
In the bit where is says "Full name:" put <a href="http://www.yourname.com/smf/index.php?action=forum">Advertisement</a>
this is so people cant post in the board.
then in the Description put your adsense code, thats it.

Best to 460x60 banner though :)

Demo (http://www.lesmonds.co.uk/smf2/index.php?action=forum)
Title: Re: Google AdSense in SMF, various positions...
Post by: gulhalim on May 17, 2006, 01:46:09 AM
http://www.matrix-network.firstclus.com/index.php?option=com_smf&Itemid=28

as you can see now this is the default theme that i add the google ads code and i want it the same for the other theme.and thanks for the tip lesmond
Title: Re: Google AdSense in SMF, various positions...
Post by: Vinspire on May 19, 2006, 12:23:02 PM
Quote from: gulhalim on May 17, 2006, 01:46:09 AM
http://www.matrix-network.firstclus.com/index.php?option=com_smf&Itemid=28

as you can see now this is the default theme that i add the google ads code and i want it the same for the other theme.and thanks for the tip lesmond

Ermm ... How do you add that in default theme ? There is a few codes lying around this thread. Which one should i follow ?
Title: Re: Google AdSense in SMF, various positions...
Post by: Miyagi on May 20, 2006, 01:31:20 PM
This is a little off to the side of the topic at hand.

For those having trouble trawling through coding to get ads on your site, i'd suggest trying out TinyPortal and using the block functionality to easily and effectively add various code.

As an example my site (http://www.fordxr5turbo.com/forums/) i have a center block up top with my 468x60 banner code simply cut and paste into it. I also have the skyscraper down the LHS in a block. It made it very easy for me to do... TinyPortal is sweeet!  ;D
Title: Re: Google AdSense in SMF, various positions...
Post by: Vinspire on June 03, 2006, 04:44:19 AM
I am using SMF 1.1 RC 2

Theme : Default

Tried the 1st guide - Manage to get it working

Anyway, my question is ... how to do this ?

(http://img19.imageshack.us/img19/4755/googleads3dy.jpg) (http://imageshack.us)

And whats the code to do this "google ads" between "menu bar" & "forum"

http://www.matrix-network.firstclus.com/index.php?option=com_smf&Itemid=28
Title: Re: Google AdSense in SMF, various positions...
Post by: trenchteam on June 06, 2006, 04:59:12 AM
Try some CSS.  I got it working on my www.shoyoroll.com/forum site.   I cant really give you directions because its a very rough coding.  Anyway, try CSS and google putting images in absolute sections of a webspace.  I did that and managed to get it to work. 
Title: Re: Google AdSense in SMF, various positions...
Post by: MeetHere on August 04, 2006, 02:56:16 PM
Hello, as per first post i have placed the google adsense codes on the smf 1.1 RC2 version of my forum..

But i am getting some n m z links on the right top of the google ad placed just below the top logo.

also second code shows ads above the first post..

You can view my forum : http://MeetHere.org (http://meethere.org)

Also help me to place adsense ads on the top right corner and at the bottom of the page..

Please help me in getting out of this problem..

Title: Re: Google AdSense in SMF, various positions...
Post by: perlisbetter on August 06, 2006, 12:52:09 PM
I don't like PHP, I prefer the stability of Perl better but I have a question.

My code deliveres a parsing error and it's probably due the to echo ' and my printout having ' in it. What's the escape characterr I should use?

Or is there another way to do the echo where I wouldn't have to?

Ie:

print " \" \" ";
print " ' ' ";
print qq( "" '' " ');

in Perl?
Title: Re: Google AdSense in SMF, various positions...
Post by: Charles LePage on August 08, 2006, 01:44:45 PM
Quote from: geezmo on April 22, 2006, 06:38:55 AM
I have the same problem. Adsense is on top-left of the first post not under it. And there's no "dummy poster" aka "Sponsored Links."

I'm using 1.07 and having the same issue.
Title: Re: Google AdSense in SMF, various positions...
Post by: Bigguy on August 08, 2006, 02:00:45 PM
Why not use the ad mod. Would that not be easier than this. PLus it gives you more options on were to put the ads.
Title: Re: Google AdSense in SMF, various positions...
Post by: Charles LePage on August 08, 2006, 03:24:38 PM
Sounds cool... where do I find this "ad mod?"
Title: Re: Google AdSense in SMF, various positions...
Post by: Bigguy on August 08, 2006, 03:37:20 PM
Right here:

http://mods.simplemachines.org/index.php?mod=255

Make sure to download the proper version.
Title: Re: Google AdSense in SMF, various positions...
Post by: Charles LePage on August 08, 2006, 04:19:13 PM
Thank you!

I noticed one of the comments on the ad mod was that it only worked on the default theme... is that accurate?
Title: Re: Google AdSense in SMF, various positions...
Post by: Bigguy on August 08, 2006, 04:25:02 PM
No it works on all themes but you have to do the edits to other themes other than the default theme yourself. So, you install the ad mod on the default theme, then go to the theme folder that you are using and edit the template files manually. You can find all the edits in the "install.xml" file or at this website:

http://www.smfads.com/forums/index.php?board=7.0
Title: Re: Google AdSense in SMF, various positions...
Post by: Charles LePage on August 08, 2006, 04:48:00 PM
Thank you again!
Title: Re: Google AdSense in SMF, various positions...
Post by: Bigguy on August 08, 2006, 05:04:10 PM
No problem what so ever, glad to help. :)
Title: Re: Google AdSense in SMF, various positions...
Post by: Charles LePage on August 09, 2006, 01:37:39 PM
I've posted some questions for you here on your forum:

http://www.smfads.com/forums/index.php?topic=118.0

Thank you for all the information you've provided!
Title: Re: Google AdSense in SMF, various positions...
Post by: Bigguy on August 09, 2006, 02:43:06 PM
Answered, sorry about the wait.

Quote from: Charles LePage on August 09, 2006, 01:37:39 PM
I've posted some questions for you here on your forum:

http://www.smfads.com/forums/index.php?topic=118.0

Thank you for all the information you've provided!
Title: Re: Google AdSense in SMF, various positions...
Post by: bjp on August 24, 2006, 11:14:15 AM
I do no unsdertand
With RC3, if I use this http://www.simplemachines.org/community/index.php?topic=50984.msg553968#msg553968
The adsense is place at the top of the page, not after the firt post ?
Title: Re: Google AdSense in SMF, various positions...
Post by: Bigguy on August 24, 2006, 11:32:38 AM
You could try the ad mod.
Title: Re: Google AdSense in SMF, various positions...
Post by: bjp on August 24, 2006, 11:48:41 AM
I try it, but i need to insert condition
http://www.simplemachines.org/community/index.php?topic=68632.msg696226#msg696226
Title: Re: Google AdSense in SMF, various positions...
Post by: Bigguy on August 24, 2006, 11:55:37 AM
Your missing some of that code for google and I have no idea were this came from cause it's not part of the code

if (!$message['member']['is_guest'])
         echo '


You don't need that bit. You set this in permissions.
Title: Re: Google AdSense in SMF, various positions...
Post by: Mr. Jinx on August 28, 2006, 02:30:37 PM
SMF RC3 (default template)
For those who don't want to install a complete mod for this just modify the following:

In display.template.php find:
// Show the member's signature?
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
echo '
<hr width="100%" size="1" class="hrcolor" />
<div class="signature">', $message['member']['signature'], '</div>';

echo '
</td>
</tr>
</table>
</td></tr>
</table>
</td></tr>';


and add AFTER:
if ($message['id'] == $context['first_message'])
echo '
<tr><td style="padding: 1px 1px 0 1px;">
<table width="100%" cellpadding="3" cellspacing="0" border="0">
<tr><td class="windowbg">
<div align="center">
<script type="text/javascript"><!--
google_ad_client = "YOUR_ADSENSE_ID_GOES_HERE!!!";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "ECEDF3";
google_color_bg = "ECEDF3";
google_color_link = "005199";
google_color_text = "000000";
google_color_url = "005199";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</td></tr></table></td></tr>';


This will add a nice adsense banner after every first post.
Title: Re: Google AdSense in SMF, various positions...
Post by: S1L1C0N on September 03, 2006, 02:19:08 AM
You f'ing rock!  :o
Title: Re: Google AdSense in SMF, various positions...
Post by: bidawinner on September 03, 2006, 03:06:37 PM
Isd it possible to insert adsense code so that only unregistered visitors see the adsense..

The idea of course is so that members dont have to see advertising and that unregistered guest that maybe didnt want to join the forum but was simply looking for a product would see the adverts and click through to the product they were lookinmg for
Title: Re: Google AdSense in SMF, various positions...
Post by: uyuy on September 30, 2006, 11:10:25 PM
I have problem , my forum become error , though I have vanished the him of but still emerge like this http://webiseng.nurul.org/index.php?topic=3.0 every post.

what I which must conduct to be can return forum/post like initialy ?

thx
Title: Re: Google AdSense in SMF, various positions...
Post by: tuxq on October 11, 2006, 06:33:13 PM
This particular thread has gotten extremely cluttered and hard to follow.
I've included a screenshot with arrows pointing where I want my google ads to go.
Could someone be nice enough to post or re-post the respective code? (http://tuxq.com/fast.php?example.jpg)
Title: Re: Google AdSense in SMF, various positions...
Post by: geezmo on October 11, 2006, 07:33:53 PM
Search for the Ad Management Mod, you can use that to position your ads almost anywhere in the forum.
Title: Re: Google AdSense in SMF, various positions...
Post by: Vinspire on October 11, 2006, 08:56:11 PM
Quote from: tuxq on October 11, 2006, 06:33:13 PM
This particular thread has gotten extremely cluttered and hard to follow.
I've included a screenshot with arrows pointing where I want my google ads to go.
Could someone be nice enough to post or re-post the respective code? (http://tuxq.com/fast.php?example.jpg)

Check out this mod : http://www.simplemachines.org/community/index.php?topic=68632.0
Title: Re: Google AdSense in SMF, various positions...
Post by: ivanstech on October 18, 2006, 05:10:54 AM
i'm currenly using smf theme sullen madness , could anyone tell me how to insert adsense into the top of my page? thanks!
Title: Re: Google AdSense in SMF, various positions...
Post by: Vinspire on October 18, 2006, 05:46:58 AM
Quote from: ivanstech on October 18, 2006, 05:10:54 AM
i'm currenly using smf theme sullen madness , could anyone tell me how to insert adsense into the top of my page? thanks!

Check out this mod : http://www.simplemachines.org/community/index.php?topic=68632.0
Title: Re: Google AdSense in SMF, various positions...
Post by: kalton on October 28, 2006, 05:05:24 PM
Hi

I installed ad managment tool however I do not see it in the admin section.

I am running rc3

Please advise
Title: Re: Google AdSense in SMF, various positions...
Post by: Bigguy on October 29, 2006, 12:26:15 PM
Did you have any errors on install. ???
Title: Re: Google AdSense in SMF, various positions...
Post by: kalton on October 29, 2006, 08:28:05 PM
no errors
Title: Re: Google AdSense in SMF, various positions...
Post by: Bigguy on October 29, 2006, 08:37:28 PM
Add the edits to the modification.english.php file. You can find them in the .xml file or at:

www.smfads.com
Title: Re: Google AdSense in SMF, various positions...
Post by: Vinspire on October 29, 2006, 10:16:28 PM
Quote from: kalton on October 28, 2006, 05:05:24 PM
Hi

I installed ad managment tool however I do not see it in the admin section.

I am running rc3

Please advise

Are you using custom theme ?
Title: Re: Google AdSense in SMF, various positions...
Post by: dyrer on November 06, 2006, 01:24:24 PM
Quote
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>
         ';
This code in Firefox 2 display ads on the left not on center, can anyone help
Title: Re: Google AdSense in SMF, various positions...
Post by: Vinspire on November 07, 2006, 01:52:07 AM
changed the code

<div align="center">

to

<div align="left">

and see if that works :)
Title: Re: Google AdSense in SMF, various positions...
Post by: EZ Picker on November 14, 2006, 02:01:17 PM
I can't get the google ads to appear *after* the first post!

They always appear *before* the first post and I followed the directions to the tee.

Any advice?

Thx
Title: Re: Google AdSense in SMF, various positions...
Post by: klra on November 16, 2006, 07:48:25 PM
Running SMF 1.0.9 and the Ig-Oh theme- 

Here's my forum- http://klrworld.com/forums/

I inserted this code and my ID as instructed (Position 2: Top of all pages, mimicking a category! (High CTR)) in the
index.template.php file.

Quoteecho '
<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>';
[/size]


Couple of wierd images being displayed that I don't understand, as I'm a SMF noob-

IE7-

(http://img391.imageshack.us/img391/5332/adsenie7forumsmx4.png) (http://imageshack.us)

Firefox-

(http://img391.imageshack.us/img391/8830/adsenffforumsgy2.png) (http://imageshack.us)

Opera-

(http://img391.imageshack.us/img391/7482/adsenopforumsgg2.jpg) (http://imageshack.us)


Also, should I change "Themes/smfaqua" below to "Themes/Ig-Oh" in order for the colors and width to be displayed properly?

Quote<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" />
Any help would be appreciated and Thanks in advance-
Title: Re: Google AdSense in SMF, various positions...
Post by: klra on November 16, 2006, 08:13:33 PM
Here's the original index.template.php for Ig-Oh if you need it-

<?php
// Version: 1.0; index

/*   This template is, perhaps, the most important template in the theme.  It
   contains the main template layer that displays the header and footer of
   the forum, namely with main_above and main_below.  It also contains the
   menu sub template, which appropriately displays the menu; the init sub
   template, which is there to set the theme up; (init can be missing.) and
   the linktree sub template, which sorts out the link tree.

   The init sub template should load any data and set any hardcoded options.

   The main_above sub template is what is shown above the main content, and
   should contain anything that should be shown up there.

   The main_below sub template, conversely, is shown after the main content.
   It should probably contain the copyright statement and some other things.

   The linktree sub template should display the link tree, using the data
   in the $context['linktree'] variable.

   The menu sub template should display all the relevant buttons the user
   wants and or needs.

   For more information on the templating system, please see the site at:
   http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
   global 
$context$settings$options$txt;

   
/* Use images from default theme when using templates from the default theme?
      if this is 'always', images from the default theme will be used.
      if this is 'defaults', images from the default theme will only be used with default templates.
      if this is 'never' or isn't set at all, images from the default theme will not be used. */
   
$settings['use_default_images'] = 'never';

   
/* What document type definition is being used? (for font size and other issues.)
      'xhtml' for an XHTML 1.0 document type definition.
      'html' for an HTML 4.01 document type definition. */
   
$settings['doctype'] = 'xhtml';
}

// The main sub template above the content.
function template_main_above()
{
   global 
$context$settings$options$scripturl$txt$forum_version$language$modSettings;

   
// Show right to left and the character set for ease of translating.
   
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html'
$context['right_to_left'] ? ' dir="rtl"' '''><head>
   <meta http-equiv="Content-Type" content="text/html; charset='
$context['character_set'], '" />
   <meta name="description" content="'
$context['page_title'], '" />
   <meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
   <script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js"></script>
   <script language="JavaScript" type="text/javascript"><!--
      var smf_theme_url = "'
$settings['theme_url'], '";
      var smf_images_url = "'
$settings['images_url'], '";
   // --></script>
   <title>'
$context['page_title'], '</title>';

   
// This is here because Gecko browsers properly support white-space....
   
if ($context['browser']['is_gecko'])
      echo 
'
   <style type="text/css"><!--
      .code
      {
         white-space: pre;
      }
   --></style>'
;

   echo 
'
   <link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css" />';

   if (empty(
$settings['theme_default_color']))
   echo 
'
   <link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/maincolorcss/default_style.css?rc2" />';
   else
      {
   if (
$settings['theme_default_color'] == 1)
   echo 
'
   <link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/maincolorcss/green_style.css?rc2" />';
      }

   echo 
'
   <!--[if IE 5 ]><link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/ie5.css"><![endif]-->';

   
/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
      Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
      Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
      Standards compliance mode happens when you use xhtml... */
   
if ($context['browser']['needs_size_fix'])
      echo 
'
   <link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/fonts-compat.css" />';

   
// Show all the relative links, such as help, search, contents, and the like.
   
echo '
   <link rel="help" href="'
$scripturl'?action=help" target="_blank" />
   <link rel="search" href="' 
$scripturl '?action=search" />
   <link rel="contents" href="'
$scripturl'" />';

   
// If we're viewing a topic, these should be the previous and next topics, respectively.
   
if (!empty($context['current_topic']))
      echo 
'
   <link rel="prev" href="' 
$scripturl '?action=;topic=' $context['current_topic'] . '.0;prev_next=prev" />
   <link rel="next" href="' 
$scripturl '?action=;topic=' $context['current_topic'] . '.0;prev_next=next" />';

   
// If we're in a board, or a topic for that matter, the index will be the board's index.
   
if (!empty($context['current_board']))
      echo 
'
   <link rel="index" href="' 
$scripturl '?action=;board=' $context['current_board'] . '.0" />';

   
// We'll have to use the cookie to remember the header...
   
if ($context['user']['is_guest'])
      
$options['collapse_header'] = !empty($_COOKIE['upshrink']);

   
// Output any remaining HTML headers. (from mods, maybe?)
   
echo $context['html_headers'], '

   <script language="JavaScript" type="text/javascript"><!--
      var current_header = '
, empty($options['collapse_header']) ? 'false' 'true'';

      function shrinkHeader(mode)
      {'
;

   
// Guests don't have theme options!!
   
if ($context['user']['is_guest'])
      echo 
'
         document.cookie = "upshrink=" + (mode ? 1 : 0);'
;
   else
      echo 
'
         document.getElementById("upshrinkTemp").src = "'
$scripturl'?action=jsoption;var=collapse_header;val=" + (mode ? 1 : 0) + ";sesc='$context['session_id'], ';" + (new Date().getTime());';

   echo 
'
         document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

         document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";

         current_header = mode;
      }
   // --></script>
</head>
<body>'
;

   
// Because of the way width/padding are calculated, we have to tell Internet Explorer 4 and 5 that the content should be 100% wide. (or else it will assume about 108%!)
   
echo '
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" >
<tbody>
   <tr>
   <td align="left" width="30" class="topbg_l" height="70">&nbsp;</td>
   <td colspan="2" align="left" class="topbg" valign="top">'
;

   if (empty(
$settings['forum_name_image_url']))
      echo 
'
   <span style="font-family: Georgia, sans-serif; margin-left: 5px;">'
$context['forum_name'], '</span>';
   else
      echo 
'
      <img src="'
$settings['forum_name_image_url'], '" alt="'$context['forum_name'], '" border="0" />';

   echo 
'
   </td>
   <td align="right" width="250" class="topbg_r" valign="top">'
;

   
// This part is the logo and forum name.  You should be able to change this to whatever you want...
               
   
if (empty($settings['header_logo_url']))
   {
   if (empty(
$settings['theme_default_color']))
   echo 
'
<img  style="margin-top: 24px; float: '
, !$context['right_to_left'] ? 'right' 'left'';" src="'$settings['images_url'], '/smflogo.gif" alt="" />';
   else
      {
   if (
$settings['theme_default_color'] == 1)
   echo 
'
<img  style="margin-top: 24px; float: '
, !$context['right_to_left'] ? 'right' 'left'';" src="'$settings['images_url'], '/green/smflogo.gif" alt="" />';
      }
   }
   else
      echo 
'
      <img  style="margin-top: 24px;" src="'
$settings['header_logo_url'], '" alt="'$context['forum_name'], '" border="0" />';

   echo 
'   
      </td>
      <td align="right" width="25" class="topbg_r2" valign="top">
      <!-- blank -->
      </td>
   </tr>  </tbody>
</table>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tbody>
    <tr>
      <td width="15" class="area_l">&nbsp;</td><td>
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
         <tr>
            <td id="headerarea" align="center" width="100%" style="position: relative; padding: 0px 15px 0px 15px;">'
;

   
// The logo and the three info boxes.
   
echo '
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
   <tr><td align="left" width="20" class="titlebg_l" height="25">&nbsp;</td><td colspan="2" align="center" class="titlebg">'
$txt['top_info'] ,'<span style="font-size: 1px;">&nbsp;</span>
      </td><td align="right" width="20" class="titlebg_r">&nbsp;</td>
   </tr>  </tbody>
</table>
      <table cellspacing="0" cellpadding="0" border="0" align="center" width="100%" style="position: relative;">
         <tr id="upshrinkHeader"'
, empty($options['collapse_header']) ? '' ' style="display: none;"''>
            <td valign="top">
                  <table class="headerbodies" width="100%" cellpadding="0" cellspacing="5" border="0"><tr>'
;

   if (!empty(
$context['user']['avatar']))
      echo 
'<td valign="middle">'$context['user']['avatar']['image'], '</td>';

   echo 
'<td width="70%" valign="top" class="headertext" align="left">';

   
// If the user is logged in, display stuff like their name, new messages, etc.
   
if ($context['user']['is_logged'])
   {
      echo 
'
                     '
$txt['hello_member'], ' <b>'$context['user']['name'], '</b>';

      
// Only tell them about their messages if they can read their messages!
      
if ($context['allow_pm'])
         echo 
', '$txt[152], ' <a href="'$scripturl'?action=pm">'$context['user']['messages'], ' '$context['user']['messages'] != $txt[153] : $txt[471], '</a>'$txt['newmessages4'], ' '$context['user']['unread_messages'], ' '$context['user']['unread_messages'] == $txt['newmessages0'] : $txt['newmessages1'];
      echo 
'.';

      
// Is the forum in maintenance mode?
      
if ($context['in_maintenance'] && $context['user']['is_admin'])
         echo 
'<br />
                     <b>'
$txt[616], '</b>';

      
// Are there any members waiting for approval?
      
if (!empty($context['unapproved_members']))
         echo 
'<br />
                     '
$context['unapproved_members'] == $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="'$scripturl'?action=regcenter">'$context['unapproved_members'] == $txt['approve_member'] : $context['unapproved_members'] . ' ' $txt['approve_members'], '</a> '$txt['approve_members_waiting'];

      
// Show the total time logged in?
      
if (!empty($context['user']['total_time_logged_in']))
      {
         echo 
'
                     <br />'
$txt['totalTimeLogged1'];

         
// If days is just zero, don't bother to show it.
         
if ($context['user']['total_time_logged_in']['days'] > 0)
            echo 
$context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

         
// Same with hours - only show it if it's above zero.
         
if ($context['user']['total_time_logged_in']['hours'] > 0)
            echo 
$context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

         
// But, let's always show minutes - Time wasted here: 0 minutes ;).
         
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'];
      }

      echo 
'<br />
                     <a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a><br />
                     <a href="'
$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a><br />';
                     
   }
   
// Otherwise they're a guest - so politely ask them to register or login.
   
else
   {
      echo 
'
                     '
$txt['welcome_guest'], '<br />
                     <form action="'
$scripturl'?action=login2" method="post" style="margin: 3px 1ex 1px 0; text-align:left;">
                        <input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
                        <select name="cookielength">
                           <option value="60">'
$txt['smf53'], '</option>
                           <option value="1440">'
$txt['smf47'], '</option>
                           <option value="10080">'
$txt['smf48'], '</option>
                           <option value="302400">'
$txt['smf49'], '</option>
                           <option value="-1" selected="selected">'
$txt['smf50'], '</option>
                        </select>
                        <input type="submit" value="'
$txt[34], '" /><br />
                        '
$txt['smf52'], '
                     </form>'
;
   }

   echo 
'
                  </td><td width="30%" class="headertext" valign="top" align="right">
                   '
$context['current_time'], ' <br />
                        <b>'
$modSettings['totalMessages'], '</b> '$txt[95], ' '$txt['smf88'], ' <b>'$modSettings['totalTopics'], '</b> '$txt[64], ' '$txt[525], ' <b>'$modSettings['memberCount'], '</b> '$txt[19], '<br />
                     '
$txt[656], ': <b> <a href="'$scripturl'?action=profile;u='$modSettings['latestMember'], '">'$modSettings['latestRealName'], '</a></b>                  
                  </td></tr>
      
'
;
   if (!empty(
$settings['enable_news']))      
      echo 
'
      <tr><td align="left" colspan="3" class="headernews"><b>'
$txt[102], ':</b> '$context['random_news_line'] , '</td></tr>';

   echo 
'
                  </table>
            </td>
         </tr>
      </table>

      <table width="100%" class="headerbodies2">
         <tr>
      <td valign="middle" align="left" style="padding-top: 10px;" width="100%">'
theme_linktree(), '</td>
            <td valign="middle"><a href="'
$scripturl'?action=search;advanced" class="searchb" title="'$txt['smf298'], '"><img src="'$settings['images_url'], '/search2_f.gif" border="0" alt="" /></a></td>
      <td valign="middle" align="right" style="padding: 10px 0px 5px 0px;">
<form action="'
$scripturl'?action=search2" method="post" style="margin: 0; margin-top: 0px;">
               <input type="text" name="search" value="'
$txt[182], '..." onfocus="this.value = \'\';" onblur="if(this.value==\'\') this.value=\''$txt[182], '...\';" style="width: 170px;" />';

   
// If we're on a certain board, limit it to this board ;).
   
if (!empty($context['current_board']))
      echo 
'
                  <input type="hidden" name="brd['
$context['current_board'], ']" value="'$context['current_board'], '" />';

   echo 
'
               </form>
</td>
         </tr>
      </table>'
;

   echo 
'
            </td>
         </tr><tr>
<td class="menu_bg" style="padding-left: 15px; padding-right: 15px;"><table border="0" cellpadding="0" cellspacing="0" align="left"> 
                  <tbody> 
                    <tr> 
                      <td width="10" valign="top" style="background: #ffffff url('
$settings['images_url'], '/bar_02.gif);"><img src="'$settings['images_url'], '/menu_01.gif" border="0" alt="" /></td> 
                      <td rowspan="2" valign="middle"  style="background: #ffffff; padding: 0px; border-bottom: 1px solid #808080;">      

      <a href="#" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="'
$settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' 'upshrink2.gif''" alt="*" title="'$txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTemp" src="'$settings['images_url'], '/blank.gif" alt="" style="margin-right: 3px;" />';

      
// Show the menu here, according to the menu sub template.
      
template_menu();

   echo 
'
</td> 
                      <td width="10" valign="top" style="background: #ffffff url('
$settings['images_url'], '/bar_01.gif);"><img src="'$settings['images_url'], '/menu_02.gif" border="0" alt="" /></td> 
                    </tr> 
                    <tr> 
                      <td width="10" valign="bottom" style="background: #ffffff url('
$settings['images_url'], '/bar_02.gif);"><img src="'$settings['images_url'], '/menu_01b.gif" border="0" width="10" alt="" /></td> 
                      <td width="10" valign="bottom" style="background: #ffffff url('
$settings['images_url'], '/bar_01.gif);"><img src="'$settings['images_url'], '/menu_02b.gif" border="0" width="10" alt="" /></td> 
                    </tr> 
                  </tbody> 
               </table></td></tr>
      </table>'
;

   
// The main content should go here.  A table is used because IE 6 just can't handle a div.

   
echo '
   <table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
      <td id="bodyarea" style="padding: 1ex 15px 2ex 15px;">'
;

   if (
$context['user']['is_admin'])
{

   if (empty(
$settings['theme_version_attention']))
{
      if (
$forum_version != 'SMF 1.0.7')
   {
      if (
$forum_version != 'SMF 1.0.8')
   echo 
'
      <div style="margin: 2ex; padding: 2ex; border: 2px dashed #cc3344; color: black; background-color: #ffb76f;">
         <div style="float: left; width: 2ex; font-size: 2em; color: red;">!!</div>
         <b style="text-decoration: underline;">Attention of Ig-Oh theme:</b><br />
         <div style="padding-left: 6ex;">
         This theme doesn\'t correspond to the version of SMF that you are using. This theme is made for SMF 1.0.7 &amp; SMF 1.0.8. 

         </div>
      </div>'
;
   }   
}
      if (empty(
$txt['necessary_to_translate']))
   echo 
'
      <div style="margin: 2ex; padding: 2ex; border: 2px dashed #cc3344; color: black; background-color: #e7e7f7;">
         <div style="float: left; width: 2ex; font-size: 2em; color: red;">!!</div>
         <b style="text-decoration: underline;">Attention of Ig-Oh theme:</b><br />
         <div style="padding-left: 6ex;">
         You should put &quot;<b>Modifications.<span style="color: red;"><acronym title="Name of language that you are using">' 
$language '</acronym></span>.php</b>&quot; on the &quot;<b>languages</b>&quot; directory ( <i>'$settings['theme_url'], '/languages/</i> ) in the theme of Ig-Oh.<br /><br />

Copy &quot;<i>Modifications.english.php</i>&quot; of the &quot;languages&quot; directory of Ig-Oh onto the first. Next, rename it according to the language for which you use the file. 

         </div>
      </div>'
;
}

}

function 
template_main_below()
{
   global 
$context$settings$options$scripturl$txt;

   echo 
'</td>
   </tr></table>'
;

   
// Show the "Powered by" and "Valid" logos, as well as the copyright.  Remember, the copyright must be somewhere!
   
echo '

   <div id="footerarea" style="text-align: center; padding-bottom: 1ex;'
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' '''">
      <script language="JavaScript" type="text/javascript"><!--
         function smfFooterHighlight(element, value)
         {
            element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
         }
      // --></script>
      <table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
         <tr>
            <td width="28%" valign="middle" align="right">
               <a href="http://www.mysql.com/" target="_blank"><img id="powered-mysql" src="'
$settings['images_url'], '/powered-mysql.gif" alt="'$txt['powered_by_mysql'], '" width="30" height="18" style="margin: 5px 5px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
               <a href="http://www.php.net/" target="_blank"><img id="powered-php" src="'
$settings['images_url'], '/powered-php.gif" alt="'$txt['powered_by_php'], '" width="30" height="18" style="margin: 5px 5px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
               <a href="http://validator.w3.org/check/referer" target="_blank"><img id="valid-xhtml10" src="'
$settings['images_url'], '/valid-xhtml10.gif" alt="'$txt['valid_xhtml'], '" width="30" height="18" style="margin: 5px 5px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
               <a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img id="valid-css" src="'
$settings['images_url'], '/valid-css.gif" alt="'$txt['valid_css'], '" width="30" height="18" style="margin: 5px 5px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>   
            </td>
            <td valign="middle" align="center">
               '
theme_copyright(), '
            </td>
            <td width="28%" valign="middle" align="center" style="padding-top: 3px;" nowrap="nowrap"><a href="http://bdc.s15.xrea.com/" class="bdc_c" title="Author of this theme." target="_blank">Ig-Oh Theme by koni.</a>
            </td>
         </tr>
      </table>'
;

   
// Show the load time?
   
if ($context['show_load_time'])
      echo 
'
      <div><span class="smalltext">'
$txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span></div>';

   echo 
'</div></td>
      <td width="15" class="area_r">&nbsp;</td>
    </tr>
  </tbody>
</table>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
   <tr><td align="left" width="37" class="bottombg_l">&nbsp;</td><td colspan="2" align="left" class="bottombg" height="25">&nbsp;
      </td><td align="right" width="37" class="bottombg_r">&nbsp;</td>
   </tr>  </tbody>
</table>'
;

   
// This is an interesting bug in Internet Explorer AND Safari.  Rather annoying, it makes overflows just not tall enough.
   
if ($context['browser']['is_ie'] && !$context['browser']['is_ie4'] || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'])
   {
      
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
      
echo '
      <script language="JavaScript" type="text/javascript"><!--'
;

      
// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
      
if ($context['browser']['is_safari'])
         echo 
'
         window.addEventListener("load", smf_codeFix, false);

         function smf_codeFix()
         {
            var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

            for (var i = 0; i < codeFix.length; i++)
            {
               if (codeFix[i].className == "code" && codeFix[i].offsetHeight < 20)
                  codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
            }
         }'
;
      else
      {
         echo 
'
         var window_oldOnload = window.onload;
         window.onload = smf_codeFix;

         function smf_codeFix()
         {
            var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

            for (var i = 0; i < codeFix.length; i++)
            {
               if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
                  codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
            }

            if (window_oldOnload)
               window_oldOnload();
         }'
;
      }

      echo 
'
      // --></script>'
;
   }

   echo 
'
   </body>
</html>'
;
}

// Show a linktree.  This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
   global 
$context$settings$options;

   
// Folder style or inline?  Inline has a smaller font.
   
echo '<span class="nav"'$settings['linktree_inline'] ? ' style="font-size: smaller;"' '''>';

   
// Each tree item has a URL and name.  Some may have extra_before and extra_after.
   
foreach ($context['linktree'] as $link_num => $tree)
   {
      
// Show the | | |-[] Folders.
      
if (!$settings['linktree_inline'])
      {
         if (
$link_num 0)
            echo 
str_repeat('<img src="' $settings['images_url'] . '/icons/linktree_main.gif" alt="| " border="0" />'$link_num 1), '<img src="' $settings['images_url'] . '/icons/linktree_side.gif" alt="|-" border="0" />';
         echo 
'<img src="' $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" />&nbsp; ';
      }

      
// Show something before the link?
      
if (isset($tree['extra_before']))
         echo 
$tree['extra_before'];

      
// Show the link, including a URL if it should have one.
      
echo '<b>'$settings['linktree_link'] && isset($tree['url']) ? '<a href="' $tree['url'] . '" class="nav">' $tree['name'] . '</a>' $tree['name'], '</b>';

      
// Show something after the link...?
      
if (isset($tree['extra_after']))
         echo 
$tree['extra_after'];

      
// Don't show a separator for the last one.
      
if ($link_num != count($context['linktree']) - 1)
         echo 
$settings['linktree_inline'] ? ' &nbsp;|&nbsp; ' '<br />';
   }

   echo 
'</span>';
}

// Show the menu up top.  Something like [home] [help] [profile] [logout]...
function template_menu()
{
   global 
$context$settings$options$scripturl$txt;

   
// Show the [home] and [help] buttons.
   
echo '
            <a href="'
$scripturl'">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/home.gif" alt="' $txt[103] . '" style="margin: 2px 0;" border="0" />' $txt[103]), '</a>'$context['menu_separator'], '
            <a href="'
$scripturl'?action=help" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/help.gif" alt="' $txt[119] . '" style="margin: 2px 0;" border="0" />' $txt[119]), '</a>'$context['menu_separator'];

   
// How about the [search] button?
   
if ($context['allow_search'])
      echo 
'
            <a href="'
$scripturl'?action=search">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/search.gif" alt="' $txt[182] . '" style="margin: 2px 0;" border="0" />' $txt[182]), '</a>'$context['menu_separator'];

   
// Is the user allowed to administrate at all? ([admin])
   
if ($context['allow_admin'])
      echo 
'
            <a href="'
$scripturl'?action=admin">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/admin.gif" alt="' $txt[2] . '" style="margin: 2px 0;" border="0" />' $txt[2]), '</a>'$context['menu_separator'];

   
// Edit Profile... [profile]
   
if ($context['allow_edit_profile'])
      echo 
'
            <a href="'
$scripturl'?action=profile">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/profile.gif" alt="' $txt[79] . '" style="margin: 2px 0;" border="0" />' $txt[467]), '</a>'$context['menu_separator'];

   
// The [calendar]!
   
if ($context['allow_calendar'])
      echo 
'
            <a href="'
$scripturl'?action=calendar">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/calendar.gif" alt="' $txt['calendar24'] . '" style="margin: 2px 0;" border="0" />' $txt['calendar24']), '</a>'$context['menu_separator'];

   
// If the user is a guest, show [login] and [register] buttons.
   
if ($context['user']['is_guest'])
   {
      echo 
'
            <a href="'
$scripturl'?action=login">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/login.gif" alt="' $txt[34] . '" style="margin: 2px 0;" border="0" />' $txt[34]), '</a>'$context['menu_separator'], '
            <a href="'
$scripturl'?action=register">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/register.gif" alt="' $txt[97] . '" style="margin: 2px 0;" border="0" />' $txt[97]), '</a>';
   }
   
// Otherwise, they might want to [logout]...
   
else
      echo 
'
            <a href="'
$scripturl'?action=logout;sesc='$context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/logout.gif" alt="' $txt[108] . '" style="margin: 2px 0;" border="0" />' $txt[108]), '</a>';
}

?>


EDIT: Used code tag.
Title: Re: Google AdSense in SMF, various positions...
Post by: klra on November 16, 2006, 10:05:13 PM
Ok, I got rid of the images, but am still wanting to get the Adsense box to match the theme-

Any ideas?
Title: Re: Google AdSense in SMF, various positions...
Post by: h4ni on December 12, 2006, 01:10:42 AM
Hello
how i can ad manualy a google adsense pub in a post replay like this
(http://img329.imageshack.us/img329/6679/adsdg9.jpg)

thank you
sorry for my English
Title: Re: Google AdSense in SMF, various positions...
Post by: klra on December 12, 2006, 01:19:15 AM
I'm using the Ad Management Mod and SMF 1.1 final, default blue theme.

It works great. I wish I could answer your question, but it might be easier to try it that way.
Title: Re: Google AdSense in SMF, various positions...
Post by: h4ni on December 12, 2006, 01:53:08 AM
i can not install ad mod in my forum (theme musiconica)    :-\
can you help me to place ads manualy ?  :(
thank you
Title: Re: Google AdSense in SMF, various positions...
Post by: klra on December 13, 2006, 12:48:46 AM
Check in at the Ad Management Mod Forum- they have a theme section there and I believe Musonica is being worked-

http://www.smfads.com/forums/
Title: Re: Google AdSense in SMF, various positions...
Post by: maxchanwl on December 16, 2006, 04:42:29 AM
Hi, after much research into the coding and also thanks to SMF Forum, I finally managed to integrate Adsense into practically anywhere in the forum - using the Classic template/theme. If you like my Adsense settings/location, you can get the codes here.

Integrating Adsense into SMF - boardindex.template
http://dotmyspot.com/forum/index.php?topic=35.0

display.template 
http://dotmyspot.com/forum/index.php?topic=36.0

MessageIndex.template 
http://dotmyspot.com/forum/index.php?topic=37.0

search.template 
http://dotmyspot.com/forum/index.php?topic=38.0

Always remember to change the publisher ID and also the channel ID(if there's any)

Happy modding..

BTW FEEL free to visit the site - http://dotmyspot.com

Lastly, thanks to all participant in SMF Forum that made this happen :)
Title: Re: Google AdSense in SMF, various positions...
Post by: +speed on December 16, 2006, 05:29:23 PM
no ads in admin panel and login.. is possible??
Title: Re: Google AdSense in SMF, various positions...
Post by: WonderWally on February 02, 2007, 12:45:19 PM
Hi,

I already addes adsense on top of each topic, but now i want to add adsense at the bottom of each topic. Does anyone has a code to fix this?

Grtz
Title: Re: Google AdSense in SMF, various positions...
Post by: bjp on February 16, 2007, 02:02:53 PM
Hi
I want tu put adsense after last message on evry page

a code like this but with last message

if ($message['id'] == $context['first_message'])
Title: Re: Google AdSense in SMF, various positions...
Post by: maroon_cool on February 27, 2007, 01:51:15 PM
Quote from: bjp on February 16, 2007, 02:02:53 PM
Hi
I want tu put adsense after last message on evry page

a code like this but with last message

if ($message['id'] == $context['first_message'])

i want to make somthing like you say but only in the first and last post,like in this site:
http://www.smfhacks.com/index.php/topic,594.0.html (http://www.smfhacks.com/index.php/topic,594.0.html)

...can help me somebody? please....   :'(
Title: Re: Google AdSense in SMF, various positions...
Post by: SanSite.Info on March 09, 2007, 08:38:41 PM
Hai,

How do I put adsense at top of the first post. Jus below the HR tag.


- San
Title: Re: Google AdSense in SMF, various positions...
Post by: merosler on March 14, 2007, 11:37:04 PM
Does anyone know how to insert google adsense WITHIN  a post?  (not at top or bottom, but within first post?)
Title: Re: Google AdSense in SMF, various positions...
Post by: Bigguy on March 15, 2007, 12:22:04 AM
The ad mod will do this. It can be found here:

Ad Mod (http://custom.simplemachines.org/mods/index.php?mod=255)

If you need help with it that can also be found here:

SMF Ads (http://www.smfads.com)
Title: Re: Google AdSense in SMF, various positions...
Post by: alstar70 on March 16, 2007, 11:14:23 PM
I've done that to two of the themes.  How do I change the core SMF default theme??
Title: Re: Google AdSense in SMF, various positions...
Post by: Bigguy on March 16, 2007, 11:41:25 PM
The ad mod installs by default to the core theme. (default theme)
Title: Re: Google AdSense in SMF, various positions...
Post by: exodia on March 20, 2007, 02:05:10 PM
hi what should i do to put the adsense in the last post of the page.
should i put

if ($message['id'] == $context['first_message'])
should i put last_message in the place of first_message.
Title: Re: Google AdSense in SMF, various positions...
Post by: karlbenson on March 24, 2007, 10:07:42 AM
there isnt a variaible for the last message
Title: Re: Google AdSense in SMF, various positions...
Post by: NickC on May 21, 2007, 09:05:12 AM
I've got Adsense on my forum using the SAF theme.

notaussiefloyd forum (http://www.notaussiefloyd.com/forum)
Title: Re: Google AdSense in SMF, various positions...
Post by: soori on May 25, 2007, 04:34:36 AM
I wanted a clarification.I have used the codes given by oyu.
Great one thanks.

But needed one clarification

How can I make the google adsense not be displayed in following pages

1) Login and registation

2) administration
Title: Re: Google AdSense in SMF, various positions...
Post by: hunyaga on July 27, 2007, 01:07:51 AM
Hi guys and gals,

I'm a total noob here and just want to know how I can get google adsense onto my Forum. I don't know about PHP sorry.

Here's the site:

http://learnjapanesepod.com/forum/

Any suggestions or help ?

Thanks
Title: Re: Google AdSense in SMF, various positions...
Post by: miekboffer on July 28, 2007, 02:32:09 PM
Hi have inserted the "ads below first post" but for some reason, the ads appear above the first post. Anyone else had this problem and found a solution?
Thanks
Title: Re: Google AdSense in SMF, various positions...
Post by: pirat3 on July 31, 2007, 04:45:49 PM
can somseone please show a screen on how these cond option looks like?
Title: Re: Google AdSense in SMF, various positions...
Post by: pirat3 on August 02, 2007, 12:50:47 PM
Quote from: thetzfreak on October 26, 2005, 06:12:03 PM
The second one doesn't work? I'm getting this problem:

(http://img488.imageshack.us/img488/8500/wrong0mj.th.png) (http://img488.imageshack.us/my.php?image=wrong0mj.png)

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?

I get same issue
Title: Re: Google AdSense in SMF, various positions...
Post by: dakotagrappler on August 11, 2007, 11:52:26 PM
Troubles with Google adsense....  That is me...  I inserted the code given to me by google in the ad management and no ads show up...

??  does this work just in default theme or does it work in any other theme?

It seems really simple...  am I doing something wrong...  my website is:
http://dakotagrappler.com/simplemessageboard/index.php

I would really appreciate any help...

I can give more details under my messages..

Thanks
dakotagrappler
Title: Re: Google AdSense in SMF, various positions...
Post by: nitins60 on August 22, 2007, 04:46:54 AM
This s very simple trick to show ads on each and every page at the bottom of the page. Remember i m newbie to php, just i tried trial & error method!

open index.template.php file of any theme
find

//Show valid logos and Powered by .......

now just insert this code just above it

echo '
//Your Google Adsense code
';


that's it :P
Title: Re: Google AdSense in SMF, various positions...
Post by: Flying Drupalist on August 25, 2007, 02:35:27 PM
The instructions in the first post are incorrect. The ad code goes before the    </td></tr>';            
not the    }.
Title: Re: Google AdSense in SMF, various positions...
Post by: geezmo on August 27, 2007, 03:22:48 AM
I want to know how to disable Adsense in the following forum pages as well. Hope someone can help. Thanks.

Quote from: soori on May 25, 2007, 04:34:36 AM
How can I make the google adsense not be displayed in following pages

1) Login and registation

2) administration
Title: Re: Google AdSense in SMF, various positions...
Post by: fortran on August 30, 2007, 07:40:21 PM
Thanks dear Moonray. ;)
Title: Re: Google AdSense in SMF, various positions...
Post by: dyrer on October 08, 2007, 01:47:38 PM
Quote from: dyrer on November 06, 2006, 01:24:24 PM
Quote
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>
         ';
This code in Firefox 2 display ads on the left not on center, can anyone help
Quote from: Vinspire on November 07, 2006, 01:52:07 AM
changed the code

<div align="center">

to

<div align="left">

and see if that works :)

No is not working
Title: Re: Google AdSense in SMF, various positions...
Post by: SleePy on November 07, 2007, 12:29:13 AM
Have you tried the ad mod first?
It might do things how you need them instead of manually editing the files.
Title: Re: Google AdSense in SMF, various positions...
Post by: starsapphire04 on November 16, 2007, 12:12:51 PM
I always get this message:

Template Parse Error!
It seems something has gone sour on the forum with the template system. This problem should only be temporary, so please come back later and try again. If you continue to see this message, please contact the administrator.

You can also try refreshing this page.

I carefully tried the step by step but what's the problem here
Title: Re: Google AdSense in SMF, various positions...
Post by: Bigguy on November 16, 2007, 12:26:40 PM
:)

Quote from: SleePy on November 07, 2007, 12:29:13 AM
Have you tried the ad mod first?
It might do things how you need them instead of manually editing the files.
Title: Re: Google AdSense in SMF, various positions...
Post by: Rashid777 on November 16, 2007, 10:26:40 PM
Hello, Is there an Adsense Mod for the 1.1.4 version? The old Adsense Mod does not work. I have someone trying to install it but i does not seem to work. Here is the site http://sscommerce.com/index.php thank you........
Title: Re: Google AdSense in SMF, various positions...
Post by: spytrdr on December 03, 2007, 07:05:07 PM
Quote from: nitins60 on August 22, 2007, 04:46:54 AM
This s very simple trick to show ads on each and every page at the bottom of the page. Remember i m newbie to php, just i tried trial & error method!

open index.template.php file of any theme
find

//Show valid logos and Powered by .......

now just insert this code just above it

echo '
//Your Google Adsense code
';


that's it :P

This is a better positioning:

   // Show the menu here, according to the menu sub template.
   template_menu();

echo '
<div align="center">
YOUR GOOGLE SCRIPT HERE
</div>
';

   // The main content should go here.
   echo '
   <div id="bodyarea" style="padding: 1ex 0px 2ex 0px;">';
}
Title: Re: Google AdSense in SMF, various positions...
Post by: raelpsf on December 09, 2007, 02:14:02 PM
Quote from: pirat3 on July 31, 2007, 04:45:49 PM
can somseone please show a screen on how these cond option looks like?

Quote from: dyrer on November 06, 2006, 01:24:24 PM

This code in Firefox 2 display ads on the left not on center, can anyone help

This code, solve the problem of you both... the advertisement is in the center (middle) and under the first post!!!

//Show Google Adsense after the 1ast post

if ($message['id'] == $context['first_message'])
echo '
<div align="center; margin-left:auto; margin-right:auto;">
<table align="center" border="0" cellpadding="0" cellspacing="0"><td align="$stylevar[center]">
        <script type="text/javascript"><!--
google_ad_client = "pub-5621933613264713";
//forum
google_ad_slot = "5446614957";
google_ad_width = 728;
google_ad_height = 90;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
</table>
  </div>
';
//End of the adsense Code




;D
Title: Re: Google AdSense in SMF, various positions...
Post by: saquib on March 02, 2008, 11:55:25 AM
Hi i have a SMF forum and recently download the outline theme but the code you provide is not in the index template , so please me how can i add googl;e adsense in it.

thank you

saquib189@yahoo.com
Title: Re: Google AdSense in SMF, various positions...
Post by: paypalcommunity on March 03, 2008, 02:30:38 AM
hi guys,

can anyone help me too ?? my forum is http://www.paypalcommunity.info

and i install smf 1.1.4 version but i dont know how to put adsense in very 1 post.

or just a footer or header part. please help me guys
Title: Re: Google AdSense in SMF, various positions...
Post by: Rumbaar on March 05, 2008, 07:10:28 PM
@saquib some themes are very different to the CORE theme so you'll have to try and use your best judgement to find the correct location for your specific theme.  Take a look at how it's positioned in the CORe theme and then try and work it out for your custom theme.  You might be able to ask in the themes specific comment/support thread for additional help from the author.

@paypalcommunity for your needs have you looked at the Ads Management mod, I think it has the ability to control the location of ads and you'll be able to position it in headers, footers and message posts.
Title: Re: Google AdSense in SMF, various positions...
Post by: neforum on March 06, 2008, 10:31:30 AM
Quote from: spytrdr on December 03, 2007, 07:05:07 PM
Quote from: nitins60 on August 22, 2007, 04:46:54 AM
This s very simple trick to show ads on each and every page at the bottom of the page. Remember i m newbie to php, just i tried trial & error method!

open index.template.php file of any theme
find

//Show valid logos and Powered by .......

now just insert this code just above it

echo '
//Your Google Adsense code
';


that's it :P

This is a better positioning:

   // Show the menu here, according to the menu sub template.
   template_menu();

echo '
<div align="center">
YOUR GOOGLE SCRIPT HERE
</div>
';

   // The main content should go here.
   echo '
   <div id="bodyarea" style="padding: 1ex 0px 2ex 0px;">';
}

Hey, thanks for that. I've now got Google Ads nestling just under the menu at the top of my forum, and they blend VERY well.  :)

http://www.neforum2.co.uk/smf
Title: Re: Google AdSense in SMF, various positions...
Post by: KEA on March 11, 2008, 05:44:02 PM
I may have missed the answer to my question so forgive me in advance. 

I have SMF1.1.4 with the add mod isntalled.  I have entered the appropriate code from Google Adsense and I am able to see my ad on every page as I want but it shows up on the far left under the menu. 

Also when you click on the add it takes you out of the forum.  How do you make the add a link so it doesnt take the members out of the forum when clicked?

How can I get the adds to center on the page instead of showing up on the far left.

Also, how can I show more than three adds?

I am using the core theme. 

www.sawmillandtimberforum.com (http://www.sawmillandtimberforum.com)
Title: Re: Google AdSense in SMF, various positions...
Post by: Rumbaar on March 11, 2008, 07:47:25 PM
I think your question is more of a Ads Management mod configuration question KEA?
Title: Re: Google AdSense in SMF, various positions...
Post by: KEA on March 12, 2008, 05:52:54 PM
OK, Ill try there.  I figured it would be best here since it was specific to Google Adsense but Ill post it on the Ads Man. mod topic.

Thanks
Title: Re: Google AdSense in SMF, various positions...
Post by: Rumbaar on March 12, 2008, 06:33:45 PM
Well some of it might be specific to Google Adsense (ie open new link in new tab/browser) but the positioning and layout you are after is part of the Ads Management mod system.
Title: Re: Google AdSense in SMF, various positions...
Post by: pp08 on March 14, 2008, 11:18:46 PM
hi Moonray, i am a new user, i posted how to add google adsense on my forum question and one of the smf specialist gave me this link... can you provide me exact code for my theme plz. and instruction on what i have to do step by step. when it comes to these things i dont know much close to nothing actualy so i dont mess up my forum so please give me detailed info on what file i have to edit and what part. also what part i have to change and put my google code thank you in advance

i am using smf 1.1.2 and theme "ancient and rusted" if i have to upgrade to smf 1.1.4 will the theme and the codes work with it?
Title: Re: Google AdSense in SMF, various positions...
Post by: rancitis on March 23, 2008, 07:53:23 AM
Hi guys!. I would like to know how to integrate an announcer at the first post each topic. I want to be seen as follows:  ;)

(http://img181.imageshack.us/img181/7449/picvt3.th.jpg) (http://img181.imageshack.us/my.php?image=picvt3.jpg)

I have installed the "Ad Management mod" but doesn't have this option. What should I do modify the code in the site to integrate this position ad?. I'm using smf 2.0 beta 3. I'm sorry for my bad english  :P.

Cheers.
Title: Re: Google AdSense in SMF, various positions...
Post by: snork13 on March 23, 2008, 10:23:32 AM
Quote from: rancitis on March 23, 2008, 07:53:23 AM
Hi guys!. I would like to know how to integrate an announcer at the first post each topic. I want to be seen as follows:  ;)

(http://img181.imageshack.us/img181/7449/picvt3.th.jpg) (http://img181.imageshack.us/my.php?image=picvt3.jpg)

I have installed the "Ad Management mod" but doesn't have this option. What should I do modify the code in the site to integrate this position ad?. I'm using smf 2.0 beta 3. I'm sorry for my bad english  :P.

Cheers.

I run an ad just before the first post. Search for


if ($message['id'] == $context['first_message'])


in Display.template.php in your theme directory. You will need to change it to something like this


if ($message['id'] == $context['first_message']) {

AD SCRIPT GOES HERE

}


Here is the complete idea of what I'm doing, I don't use the ad management mod at all. I tweaked a few things to display to only regular members and guest. In my signature is a link to the forum, which will show you the results. The code could be cleaned up a little, just haven't had time :P


// Show the message anchor and a "new" anchor if this message is new.
if ($message['id'] != $context['first_message'])
echo '
<a name="msg', $message['id'], '"></a>', $message['first_new'] ? '<a name="new"></a>' : '';

echo '
<table width="100%" cellpadding="3" cellspacing="0" border="0">';
       
        if ($message['id'] == $context['first_message'])
     
   {
   
        $allowed_group = 0; // The group ID which will see the button.
        global $user_info;
        if (in_array($allowed_group, $user_info['groups']) || ($context['user']['is_guest'])) {
                echo '
                <tr><td style="padding: 0px 0px 1px 0px;">
                    <table width="100%" cellpadding="3" cellspacing="0" border="0">
<tr><td align="center" class="smalltext windowbg" ><br />';
         

                echo '<script type="text/javascript"><!--amazon_ad_tag = "*******";  amazon_ad_width = "728";  amazon_ad_height = "90";//--></script>
                    <script type="text/javascript" src="http://www.assoc-amazon.com/s/ads.js"></script>
                    <br /><br /></td></tr>
  </table>
</td></tr>';
   
}
}
       
        echo'
<tr><td class="', $message['approved'] ? ($message['alternate'] == 0 ? 'windowbg' : 'windowbg2') : 'approvebg', '">';


-snork13
Title: Re: Google AdSense in SMF, various positions...
Post by: rancitis on March 24, 2008, 08:09:27 AM
Thanks snork13  ;), but this will not be integrating the announcement in the manner indicated and the structure of Display.template.php in smf 2.0 is different. The author of the"Ad Management mod"  would have to take into account how much this position because it is very important these location
Title: Re: Google AdSense in SMF, various positions...
Post by: rancitis on March 27, 2008, 09:42:13 PM
Any help?  ::)
Title: Re: Google AdSense in SMF, various positions...
Post by: SleePy on April 10, 2008, 11:57:55 PM
2.0 looks the same to me.

        // Show the message anchor and a "new" anchor if this message is new.
        if ($message['id'] != $context['first_message'])
            echo '
        <a name="msg', $message['id'], '"></a>', $message['first_new'] ? '<a name="new"></a>' : '';

        echo '
        <table width="100%" cellpadding="3" cellspacing="0" border="0">
            <tr><td class="', $message['approved'] ? ($message['alternate'] == 0 ? 'windowbg' : 'windowbg2') : 'approvebg', '">';
Title: Re: Google AdSense in SMF, various positions...
Post by: vojailic on May 30, 2008, 04:20:59 PM
Any idea how to achive this in Recent posts?
Title: Re: Google AdSense in SMF, various positions...
Post by: Tosyne on June 10, 2008, 04:29:08 PM
Please i have not being able to add adsense on my forum.

Kindly assit.

Thanks

http://faithfulsnetwork.com/index.php
Title: Re: Google AdSense in SMF, various positions...
Post by: happybear on June 11, 2008, 04:52:57 AM
I've just realized that I'm not alowed to post a topic so I'm posting my question here.

Can I add google adsense to my private forum i.e. only accessible to members who have signed in? I'm trying unsuccessibly to add it to my forum and it's still not showing.

This is so frustrating until I realize that it could be because my forum is set to private browsing. Anyone can help?

Title: Re: Google AdSense in SMF, various positions...
Post by: SleePy on July 30, 2008, 01:31:44 AM
We do have a couple ad mods that might help you out if they are easier to install :)
http://custom.simplemachines.org/mods/index.php?mod=1216
http://custom.simplemachines.org/mods/index.php?mod=255
Title: Re: Google AdSense in SMF, various positions...
Post by: neich on August 28, 2008, 10:57:45 AM
Quote from: SleePy on July 30, 2008, 01:31:44 AM
We do have a couple ad mods that might help you out if they are easier to install :)
http://custom.simplemachines.org/mods/index.php?mod=1216
http://custom.simplemachines.org/mods/index.php?mod=255

Is there any way to apply the 2nd mod (ads management) to a theme different to the default one ?

Thanks
Title: AdSense at top and and after each first post
Post by: iGraphiX on September 13, 2008, 03:13:57 AM
Hi lads, this is a way too long post, and I was wondering if I can make it longer. Hehe, just kidding.
I'm a noob but I hope this helps:

(http://i37.tinypic.com/n2dcvq.png)
View full-size image here: http://i37.tinypic.com/n2dcvq.png

I'm using SMF 1.1.6.
In order to see what's in the screenshot you have to do the following modifications in the default theme folder, file to edit: Display.template.php

1. For the top of post ad unit:

Find this code:

// Now show how many guests are here too.
echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '
</td>
</tr>';
}

echo '
</table>';


And right after it add:

//Google Adsense
   echo '
   <tr><td style="padding: 1px 1px 0 1px;">
   <table width="100%" cellpadding="3" cellspacing="0" border="0">
   <tr><td class="windowbg">
   <div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-YOUR_ADSENSE";
/* blog_bottom */
google_ad_slot = "6779400012";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
   </div>
   </td></tr></table></td></tr>';
//End of Google Adsense


2. To display AdSense unit after the first post:

Find this code:

// Show the member's signature?
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
echo '
<hr width="100%" size="1" class="hrcolor" />
<div class="signature">', $message['member']['signature'], '</div>';

echo '
</td>
</tr>
</table>
</td></tr>
</table>
</td></tr>';


And right after it add this code:

//Google Adsense
if ($message['id'] == $context['first_message'])
   echo '
   <tr><td style="padding: 1px 1px 0 1px;">
   <table width="100%" cellpadding="3" cellspacing="0" border="0">
   <tr><td class="windowbg">
   <div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-YOUR_ADSENSE";
/* blog_bottom */
google_ad_slot = "6779400012";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
   </div>
   </td></tr></table></td></tr>';
//End of Google Adsense


Now it easy to understand that in order to correctly display Google AdSense units in any version of SMF forums, in any position or alignment, just see this code and place it where you think it might bring some impressions:

   
//Start Google Adsense   
echo '
   <tr><td style="padding: 1px 1px 0 1px;">
   <table width="100%" cellpadding="3" cellspacing="0" border="0">
   <tr><td class="windowbg">
   <div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-YOUR_ADSENSE";
/* blog_bottom */
google_ad_slot = "6779400012";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
   </div>
   </td></tr></table></td></tr>';
//End of Google Adsense


PS. Don't forget to insert your Publisher ID fron AdSense :)
Title: Re: Google AdSense in SMF, various positions...
Post by: Rumbaar on September 13, 2008, 08:43:35 PM
Quote from: neich on August 28, 2008, 10:57:45 AMIs there any way to apply the 2nd mod (ads management) to a theme different to the default one ?
Thanks
Yes, just like any mod you just manually add the code to any of the applicable template files in your custom theme.

Manual Installation of Mods (http://docs.simplemachines.org/index.php?topic=402)
Title: Re: Google AdSense in SMF, various positions...
Post by: krish227 on September 23, 2008, 06:24:05 AM
Hey does dis tutorial helps for version 1.1.6 & custom theme. my forum has a custom theme Metallistic. So can ur tutorial help my forum?
Title: Re: Google AdSense in SMF, various positions...
Post by: badmasketa on September 24, 2008, 01:13:21 PM
(http://i36.tinypic.com/2nuhxz6.jpg)
View full-size image here: http://i36.tinypic.com/2nuhxz6.jpg

I wanna put the GOOGLE ADSENSE in Babylon Theme like the way i have drawn in the screenshot above...

how's that possible??
any idea?
Title: Re: Google AdSense in SMF, various positions...
Post by: badmasketa on September 25, 2008, 02:43:07 PM
???
Title: Re: Google AdSense in SMF, various positions...
Post by: bintua on September 28, 2008, 11:32:17 PM
I am still having problems with putting google ad sense on my site. I was able to put it on the footer but i want to see it in every posts i have please help. Thanks
I have 1.1.6  installed
Title: Re: Google AdSense in SMF, various positions...
Post by: anakmacan on September 30, 2008, 05:12:06 AM
Theme : Classic YABB
Version : 1.1.5

Question :
How do i insert advertisement in the middle of text in first post like this?

(http://img504.imageshack.us/img504/1331/adsxz5.gif)

Ive downloaded smf Ad Management, but i cant make it to be exactly like i want as in picture above.  I appreciate your help in advance :) (and show me your site ill click your ads for you ).
Title: Re: Google AdSense in SMF, various positions...
Post by: dazea2k8 on October 26, 2008, 03:44:04 PM
It doesn't work on all themes, well it doesn't work for me  ;)
Title: Re: Google AdSense in SMF, various positions...
Post by: Rumbaar on October 26, 2008, 05:09:02 PM
There is a feature of the Ads Management mod to insert into the first message of a thread?  If so then, and it's not in the desired position, you'll need edit the Display or Post templates that the ads management mod adds the code too and position it how you want.

Also any code should work in all themes, as long as you make the changes to all custom themes applicable template files.
Title: Re: Google AdSense in SMF, various positions...
Post by: Bananas92 on November 01, 2008, 07:45:53 PM
I'm add google ads by iGraphiX and have problem :/ My theme is Xbox360_Elite, table, images after install crazy position, pls look  on http://www.gtamods.pl/forum2/index.php?topic=1.0 (http://www.gtamods.pl/forum2/index.php?topic=1.0). Pleas help me.
Title: Re: Google AdSense in SMF, various positions...
Post by: delniotis on November 13, 2008, 09:03:34 PM
Quote
2. To display AdSense unit after the first post:

Find this code:

// Show the member's signature?
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
echo '
<hr width="100%" size="1" class="hrcolor" />
<div class="signature">', $message['member']['signature'], '</div>';

echo '
</td>
</tr>
</table>
</td></tr>
</table>
</td></tr>';


And right after it add this code:

//Google Adsense
if ($message['id'] == $context['first_message'])
   echo '
   <tr><td style="padding: 1px 1px 0 1px;">
   <table width="100%" cellpadding="3" cellspacing="0" border="0">
   <tr><td class="windowbg">
   <div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-YOUR_ADSENSE";
/* blog_bottom */
google_ad_slot = "6779400012";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
   </div>
   </td></tr></table></td></tr>';
//End of Google Adsense


PS. Don't forget to insert your Publisher ID fron AdSense :)


Wow, thanks this works fine, but how can we place the ads before the members signature ?
(between post/text and the signature) all this in the first post, not as second post

Title: Re: Google AdSense in SMF, various positions...
Post by: Oldiesmann on December 13, 2008, 11:33:50 PM
Add the ad code before the specified code instead of after it :)
Title: Re: Google AdSense in SMF, various positions...
Post by: llckll on February 16, 2009, 06:17:18 PM
Quote from: badmasketa on September 24, 2008, 01:13:21 PM
(http://i36.tinypic.com/2nuhxz6.jpg)
View full-size image here: http://i36.tinypic.com/2nuhxz6.jpg

I wanna put the GOOGLE ADSENSE in Babylon Theme like the way i have drawn in the screenshot above...

how's that possible??
any idea?

I would like to add the same google ads all the way to the right of the forum sections.  Where in the code do I add that?

Thanks.
Title: Re: Google AdSense in SMF, various positions...
Post by: mrzaheri on February 27, 2009, 07:24:38 PM
Thank you iGraphiX,
I did what ever you said but the google adsense dose not appear in the posts. Actually an empty area is appeared based on my adsense size but it is empty.
P.S : I have used my own created adsense ads.  I have used it before in my header.
also I am using babylon theme:
www.irandspcenter.ir/forum1
Does it need any change in other files?

Title: Re: Google AdSense in SMF, various positions...
Post by: L'AltroWeb on March 20, 2009, 03:12:00 PM
Hi!
Sorry but i don't have read all posts from this topic.
Info from first post don't works for me.
I've edit like this and now is ok ;)

// Show the member's signature?
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
echo '
<hr width="100%" size="1" class="hrcolor" />
<div class="signature">', $message['member']['signature'], '</div>';
   if ($message['id'] == $context['first_message'])
       echo '
        <div style="text-align: center; padding: 10px;">
        <banner code>
        </div>';
echo '
</td>
</tr>
</table>
</td></tr>
</table>
</td></tr>';
}
-
Demo here: http://darkwolf.altervista.org/forum/modemrouter/d-link-dsl-2640b-brikkato/msg2039/#msg2039  :)
Title: Re: Google AdSense in SMF, various positions...
Post by: BellyDanceDreams on April 10, 2009, 09:10:57 AM
I can't figure where to put the code on the 1.1.8 version.  I want ad it on all my pages but when I add my code I get this on my forum:

Template Parse Error!
It seems something has gone sour on the forum with the template system. This problem should only be temporary, so please come back later and try again. If you continue to see this message, please contact the administrator.

You can also try refreshing this page.
Title: Re: AdSense at top and and after each first post
Post by: BellyDanceDreams on April 10, 2009, 12:44:59 PM
Quote from: iGraphiX on September 13, 2008, 03:13:57 AM
Hi lads, this is a way too long post, and I was wondering if I can make it longer. Hehe, just kidding.
I'm a noob but I hope this helps:

(http://i37.tinypic.com/n2dcvq.png)
View full-size image here: http://i37.tinypic.com/n2dcvq.png

I'm using SMF 1.1.6.
In order to see what's in the screenshot you have to do the following modifications in the default theme folder, file to edit: Display.template.php

1. For the top of post ad unit:

Find this code:

// Now show how many guests are here too.
echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '
</td>
</tr>';
}

echo '
</table>';


And right after it add:

//Google Adsense
   echo '
   <tr><td style="padding: 1px 1px 0 1px;">
   <table width="100%" cellpadding="3" cellspacing="0" border="0">
   <tr><td class="windowbg">
   <div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-YOUR_ADSENSE";
/* blog_bottom */
google_ad_slot = "6779400012";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
   </div>
   </td></tr></table></td></tr>';
//End of Google Adsense


2. To display AdSense unit after the first post:

Find this code:

// Show the member's signature?
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
echo '
<hr width="100%" size="1" class="hrcolor" />
<div class="signature">', $message['member']['signature'], '</div>';

echo '
</td>
</tr>
</table>
</td></tr>
</table>
</td></tr>';


And right after it add this code:

//Google Adsense
if ($message['id'] == $context['first_message'])
   echo '
   <tr><td style="padding: 1px 1px 0 1px;">
   <table width="100%" cellpadding="3" cellspacing="0" border="0">
   <tr><td class="windowbg">
   <div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-YOUR_ADSENSE";
/* blog_bottom */
google_ad_slot = "6779400012";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
   </div>
   </td></tr></table></td></tr>';
//End of Google Adsense


Now it easy to understand that in order to correctly display Google AdSense units in any version of SMF forums, in any position or alignment, just see this code and place it where you think it might bring some impressions:

   
//Start Google Adsense   
echo '
   <tr><td style="padding: 1px 1px 0 1px;">
   <table width="100%" cellpadding="3" cellspacing="0" border="0">
   <tr><td class="windowbg">
   <div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-YOUR_ADSENSE";
/* blog_bottom */
google_ad_slot = "6779400012";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
   </div>
   </td></tr></table></td></tr>';
//End of Google Adsense


PS. Don't forget to insert your Publisher ID fron AdSense :)


now, I have used the first code and it works, however it keeps trying to log me out when I try reply to posts!  ???
Title: Re: AdSense at top and and after each first post
Post by: Sarge on May 08, 2009, 01:45:49 AM
Quote from: BellyDanceDreams on April 10, 2009, 12:44:59 PM
now, I have used the first code and it works, however it keeps trying to log me out when I try reply to posts!  ???

Do you see an error message on the page? Or in the error log?
Title: Re: AdSense at top and and after each first post
Post by: BellyDanceDreams on May 08, 2009, 06:15:57 AM
Quote from: Sarge on May 08, 2009, 01:45:49 AM
Quote from: BellyDanceDreams on April 10, 2009, 12:44:59 PM
now, I have used the first code and it works, however it keeps trying to log me out when I try reply to posts!  ???

Do you see an error message on the page? Or in the error log?
Nope it just logged me straight out!
Title: Re: AdSense at top and and after each first post
Post by: Sarge on May 08, 2009, 06:44:11 AM
Quote from: BellyDanceDreams on May 08, 2009, 06:15:57 AM
Nope it just logged me straight out!

Does it happen as an admin or as a regular user? What's your forum URL?
Title: Re: AdSense at top and and after each first post
Post by: BellyDanceDreams on May 12, 2009, 11:40:42 AM
Quote from: Sarge on May 08, 2009, 06:44:11 AM
Quote from: BellyDanceDreams on May 08, 2009, 06:15:57 AM
Nope it just logged me straight out!

Does it happen as an admin or as a regular user? What's your forum URL?
Admin
www.bellydancedreams.co.uk/forums
Title: Re: Google AdSense in SMF, various positions...
Post by: saibaworld on May 20, 2009, 06:25:20 PM
Which is better to use in placing adsense or other affiliate codes in my forum: ad mod OR editing my templates?

I ask cos of problem of updates and other tech issues wich may come up with an ad mod? At the same time, i tried editing my templates and had a virus contaminate my forum (see http://www.simplemachines.org/community/index.php?topic=310921.0)

Wich is better pls?
Title: Re: Google AdSense in SMF, various positions...
Post by: dzinerfusion on May 20, 2009, 07:43:11 PM
Sorry if this is really a noob question but the codes you put, are they compatible with 2.0 rc1?
Title: Re: Google AdSense in SMF, various positions...
Post by: remi_naija on May 27, 2009, 04:33:24 PM
I'm trying to add adsense codes to Oxygen11 template and just realized Ithat it does not have the display_temlplate.php file. which file do i modify to add adsense before the first, and the last post?
Title: Re: Google AdSense in SMF, various positions...
Post by: remi_naija on June 02, 2009, 09:18:46 AM
Quote from: Moonray on September 25, 2005, 11:46:56 PM
Google AdSense and SMF:


--------
EDIT:
Please check my new post in this thread here. (http://www.simplemachines.org/community/index.php?topic=50984.msg411181#msg411181)
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 (http://joomla.medspan.info/forum/index.php/board,15.0.html) also.


Position 1: After 1st post

File to be modded: Display.template.php

Find this in the file:

// 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.


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 (http://www.medspan.info/mediscuss/index.php/topic,3.0.html)


I have Just followed the steps on position 1 and i get an error message in the status bar: "Done but with error on page" in Internet explorer. Also, the ad appears on top of the first post, in between the Name of poster and content.

see here www.naijaclan.com
Title: Re: Google AdSense in SMF, various positions...
Post by: taimurkazmi on June 20, 2009, 02:13:10 AM
Quote from: Moonray on September 25, 2005, 11:46:56 PM
Google AdSense and SMF:


--------
EDIT:
Please check my new post in this thread here. (http://www.simplemachines.org/community/index.php?topic=50984.msg411181#msg411181)
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 (http://joomla.medspan.info/forum/index.php/board,15.0.html) also.


Position 1: After 1st post

File to be modded: Display.template.php

Find this in the file:

// 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.


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 (http://www.medspan.info/mediscuss/index.php/topic,3.0.html)

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:

// 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.


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 (http://www.medspan.info/mediscuss/index.php)

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 (http://mambo.medspan.info/myblog/tips-tricks/how-to-change-colors-the-chameleon-code-for-google-adsense/)

Great
Title: Re: Google AdSense in SMF, various positions...
Post by: ne-yola on June 24, 2009, 05:49:17 PM
Pls I am a Newbie and i own a forum site..i need to put ads on the top and side bars and in between posts , i need help as to a step by step method to go abt it....
my forum is hosted on wbrlhosting

i know i need to get to the display.temp.php

pls how do i locate the display temp php
xpecting a prompt reply
thanks
Title: Re: Google AdSense in SMF, various positions...
Post by: jeffym on July 03, 2009, 06:59:31 AM
That's such an awesome tip .

Thanks for that. I'm going to give it a try right now.

Thanks  :)

Jeff
Fat belly (http://www.losebeerbelly.org)
Title: Re: Google AdSense in SMF, various positions...
Post by: bosunjohnson on July 10, 2009, 02:54:08 PM
Can someone  please give the download link for the greensense theme pls. I have check the joomlaspan site but found nothing.
Any other custom adsense ready theme is also appreciated.
Title: Re: Google AdSense in SMF, various positions...
Post by: ScottDB on July 12, 2009, 05:21:15 PM
Hi all, I would really like to have this in my forum but not sure how to do it. I would like the position 2 but in the post the: find this code is blank.

I am a bit of a newbie. Can someone explain a little better how to do this?
Title: Re: Google AdSense in SMF, various positions...
Post by: JBlaze on July 26, 2009, 01:10:14 AM
Quote from: ScottDB on July 12, 2009, 05:21:15 PM
Hi all, I would really like to have this in my forum but not sure how to do it. I would like the position 2 but in the post the: find this code is blank.

I am a bit of a newbie. Can someone explain a little better how to do this?

See if this helps.
Manual Installation of Mods (http://docs.simplemachines.org/index.php?topic=402)
Title: Re: Google AdSense in SMF, various positions...
Post by: samueliyinbo on August 16, 2009, 12:04:35 AM
Hello please I am using smf 1.1.10 with the dibermic theme, I can't see to find any Display.template.php. Please could you help. Thank you
Title: Re: Google AdSense in SMF, various positions...
Post by: Arantor on August 16, 2009, 07:35:57 AM
Display.template.php will be in either Themes/dilber/Display.template.php (or whatever the directory is called) or failing that it will be in Themes/default/Display.template.php.
Title: Re: Google AdSense in SMF, various positions...
Post by: sclark on September 02, 2009, 09:39:22 AM
This is exactly what i need, but i will wait until i have enough impression.
Title: Re: Google AdSense in SMF, various positions...
Post by: Joey Smith™ on September 23, 2009, 06:51:25 AM
Any updates on this?
Title: Re: Google AdSense in SMF, various positions...
Post by: Hayalet Sürücü on September 23, 2009, 10:04:34 AM
Heyya Thanks , Moonray
Title: Re: Google AdSense in SMF, various positions...
Post by: Shadow1243 on September 27, 2009, 10:42:53 AM
I installed adsense to different areas: http://www.doktortr.net/forum/english-medical-resources/10-definite-don8217ts-of-great-hair-care/
Title: Re: Google AdSense in SMF, various positions...
Post by: Arantor on October 11, 2009, 05:59:15 AM
Do you need any support with this, Shadow1243?
Title: Re: Google AdSense in SMF, various positions...
Post by: wordgeist on October 12, 2009, 04:00:52 PM
I'm going to try this changes and see if they work on my site
Title: Re: Google AdSense in SMF, various positions...
Post by: Isabelle88 on October 26, 2009, 03:14:57 PM
a quick question, i got it to work in the first post but i was wondering is there a way to have it in every post?

the banners are small and it looks great
Title: Re: Google AdSense in SMF, various positions...
Post by: Arantor on October 26, 2009, 03:15:54 PM
Quote from: Isabelle88 on October 26, 2009, 03:14:57 PM
a quick question, i got it to work in the first post but i was wondering is there a way to have it in every post?

the banners are small and it looks great

You are not permitted by Google AdSense's TOS to have more than 3 link units in a page.
Title: Re: Google AdSense in SMF, various positions...
Post by: Isabelle88 on October 26, 2009, 03:16:46 PM
thanks, that was quick
Title: Re: Google AdSense in SMF, various positions...
Post by: Isabelle88 on October 26, 2009, 05:12:43 PM
ok i jinxed myself, i had it perfect but then i realized i had one too many ads and i removed one, nothing to do with the code but now for the first post ad it shows the space but not the ad its self, i re did everything but nothing works
Title: Re: Google AdSense in SMF, various positions...
Post by: jim2009 on November 15, 2009, 02:53:54 AM
very nice forum. I read this thread from the begining. I try to add google adsense. I tried the code that I got from google and the code that I saw here with my id. Every thing was not difficult: copy and paste according to the instructions yesterday but nothing happened. I see no ads; I wish to put it on the first page.
I use Babylon theme    humansecretsonline.com

Any advice is welcomed!
Title: Re: Google AdSense in SMF, various positions...
Post by: macayub on November 19, 2009, 05:42:13 AM

It works on my forum (Babylon Theme) like magic, though I just installed the forum few days ago. 
Thank you very much.  ;) ;)
Title: Re: Google AdSense in SMF, various positions...
Post by: jim2009 on November 24, 2009, 08:19:00 AM
Pls tell me where did you paste it exactly.
Thanks
Title: Re: Google AdSense in SMF, various positions...
Post by: jim2009 on November 29, 2009, 10:41:55 AM
I have already found out how to manage. I don't need help.
Thanks.
Title: Re: Google AdSense in SMF, various positions...
Post by: masbury12 on November 29, 2009, 11:25:41 PM
Hello, I am trying to insert my adsense code for my forum and haven't been able to so far.  I am not sure where to place the ad, I'm using the FCY-Themes.  I tried downloading the ad management, and it does not show in my configuration list.  Please can someone help?
thanks
Title: Re: Google AdSense in SMF, various positions...
Post by: kingkingston on November 30, 2009, 12:31:05 AM
Quote from: masbury12 on November 29, 2009, 11:25:41 PM
Hello, I am trying to insert my adsense code for my forum and haven't been able to so far.  I am not sure where to place the ad, I'm using the FCY-Themes.  I tried downloading the ad management, and it does not show in my configuration list.  Please can someone help?
thanks

What language and smf version are you using ?,if they know that,people might be able to help.
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on November 30, 2009, 12:32:27 AM
Have you tried using your adsense code in a HTML block from portal mods
Title: Re: Google AdSense in SMF, various positions...
Post by: masbury12 on November 30, 2009, 08:07:13 PM
Thanks King... the smf version that I am using is 1.1

and John, I haven't tried the code in a HTML block like you mentioned, how would I do that?

thank you both for responding.
Title: Re: Google AdSense in SMF, various positions...
Post by: kingkingston on November 30, 2009, 09:55:42 PM
Quote from: masbury12 on November 30, 2009, 08:07:13 PM
Thanks King... the smf version that I am using is 1.1

and John, I haven't tried the code in a HTML block like you mentioned, how would I do that?

thank you both for responding.
with a html block from a portal system,one from the mod site
Title: Re: Google AdSense in SMF, various positions...
Post by: nigerianwall on December 06, 2009, 04:10:06 PM
Guys greetings to you all. thanks for the above info, but i dont know how to utilize them. Someone was contracted to handel my website for me and i dont know jack how i can and where to place all these codes. can someone help me?
Title: Re: Google AdSense in SMF, various positions...
Post by: h78509 on December 08, 2009, 10:10:25 PM
Quote from: kingkingston on November 30, 2009, 12:31:05 AM
Quote from: masbury12 on November 29, 2009, 11:25:41 PM
Hello, I am trying to insert my adsense code for my forum and haven't been able to so far.  I am not sure where to place the ad, I'm using the FCY-Themes.  I tried downloading the ad management, and it does not show in my configuration list.  Please can someone help?
thanks

What language and smf version are you using ?,if they know that,people might be able to help.

I have the same problem. I'm using 2.0 RC2 and English, default theme.

I installed Ad Management (right after clean install) and everything seemed to go as planned, only I didn't see any change in the "Configuration" drop-down menu (or anywhere else). Then when I tried to uninstall, I got a screen full of red text.

I'm guessing I have to change file permissions or something but how can they be wrong when I haven't touched anything and the installation seemed to go ok?
Title: Re: Google AdSense in SMF, various positions...
Post by: DoctorMalboro on December 09, 2009, 11:11:11 AM
excelent tip, but it's a little bit of annoying advertisement on a forum  ;)
Title: Re: Google AdSense in SMF, various positions...
Post by: jim2009 on December 20, 2009, 01:34:24 AM
The adsense are very nice on my forum. I used the code that I found on this discussion topic and I added my pub code. When I go to my google account I still see my adv. as new and not active. Any idea if this is oke and i must wait! or I have to do some changes?  Thanks
humansecretsonline.com
Title: Re: Google AdSense in SMF, various positions...
Post by: supahben on December 20, 2009, 01:20:50 PM
I want it within the post just like what digitalpoint (its vb, sorry) did on their forum
Title: Re: Google AdSense in SMF, various positions...
Post by: Massl on January 07, 2010, 08:20:44 AM
Hi,
does anyone know how to add the banner in the header near the logo?

(http://img691.imageshack.us/img691/5909/senzatitolo2w.jpg) (http://img691.imageshack.us/i/senzatitolo2w.jpg/) (http://img691.imageshack.us/img691/senzatitolo2w.jpg/1/w1007.png) (http://g.imageshack.us/img691/senzatitolo2w.jpg/1/)

The banner can also be added in the last post after the signing?

Many thanks
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on January 08, 2010, 09:38:22 AM
That depends on which version of SMF your asking about, you can replace the entire code for the SMF logo and replace with google adsense code though, (small ad recommended)
Title: Re: Google AdSense in SMF, various positions...
Post by: Massl on January 08, 2010, 09:47:44 AM
Thanks JohnCcCcCc, i added the code on index.template.php (Theme Curve) after
// the upshrink image, right-floated

And is perfect but there is a way to add the banner in the last post after the signing?
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on January 09, 2010, 01:00:52 PM
Quote from: Max_74 on January 08, 2010, 09:47:44 AM
Thanks JohnCcCcCc, i added the code on index.template.php (Theme Curve) after
// the upshrink image, right-floated

And is perfect but there is a way to add the banner in the last post after the signing?


Your best bet is to use a portal HTML block or Ad Management mod for placing simple code, its much easier than hard coding thus no coding required, just copy and paste
Title: Re: Google AdSense in SMF, various positions...
Post by: spytrdr on January 14, 2010, 10:55:41 AM
I'm using the Ad Management Mod, it's great and was so easy to install. But how do I CENTER the ads? They are all aligned to the left by default and there is no way to change that in the settings.
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on January 14, 2010, 11:18:06 AM
Quote from: spytrdr on January 14, 2010, 10:55:41 AM
I'm using the Ad Management Mod, it's great and was so easy to install. But how do I CENTER the ads? They are all aligned to the left by default and there is no way to change that in the settings.

where you input the ad code add the HTML center tags there

<center>
You code here
</center>
Title: Re: Google AdSense in SMF, various positions...
Post by: Dzonny on January 19, 2010, 01:31:42 PM
Hello there.
Is there a way to put ads after 1st post, as some poster. For example i can set username that will "post" ads in every second post in thread. I think that Ad Menagement mod can do this, but i dont want to install it just for this.

Regards.
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on January 19, 2010, 01:37:27 PM
Quote from: Dzonny on January 19, 2010, 01:31:42 PM
Hello there.
Is there a way to put ads after 1st post, as some poster. For example i can set username that will "post" ads in every second post in thread. I think that Ad Menagement mod can do this, but i dont want to install it just for this.

Regards.

Ad management mod can do that, there is a option for putting ads between posts, then another option to make the ad look like a post, which is posted by "your forum name"
Title: Re: Google AdSense in SMF, various positions...
Post by: Dzonny on January 19, 2010, 02:03:08 PM
I know that, but as i said, i dont wannna use mod for this.
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on January 19, 2010, 09:15:01 PM
well, you could dismantle the mod and find the part of code that applies the ad, Im unsure which file it is, but when found the

echo ' ['blablabla'] ' would be replaced with the code, I cant really offer more help than that, you could ask in the ad management mod support thread about that certain part of the code and see if they will help you manually add it where its needed
Title: Re: Google AdSense in SMF, various positions...
Post by: waruna on January 30, 2010, 02:10:07 AM
Can this code combine with google webmaster tools?
Title: Re: Google AdSense in SMF, various positions...
Post by: yurckk on February 04, 2010, 10:30:55 AM
Hi,

I've managed to add adsense block after the first post just right below the signature, thanks for the code!

By the way, how to add adsense in every first post like DigitalPoint.com? Anyone having success with it?

P.s: I'm using SMF2 RC2
Title: Re: Google AdSense in SMF, various positions...
Post by: Raul Malik on February 10, 2010, 10:47:01 AM
Quote from: yurckk on February 04, 2010, 10:30:55 AM
Hi,

I've managed to add adsense block after the first post just right below the signature, thanks for the code!

By the way, how to add adsense in every first post like DigitalPoint.com? Anyone having success with it?

P.s: I'm using SMF2 RC2


I would also like to know the same
Title: Re: Google AdSense in SMF, various positions...
Post by: Arantor on February 10, 2010, 01:38:42 PM
Ad Management mod (http://custom.simplemachines.org/mods/index.php?mod=255) maybe?
Title: Re: Google AdSense in SMF, various positions...
Post by: yurckk on February 11, 2010, 07:00:56 AM
Quote from: Arantor on February 10, 2010, 01:38:42 PM
Ad Management mod (http://custom.simplemachines.org/mods/index.php?mod=255) maybe?

Nope, I don't think it have the feature ... btw Ad Management mod have flaw on its design... the curve shape on every post made for advertising is out of order.
Title: Re: Google AdSense in SMF, various positions...
Post by: Raul Malik on February 11, 2010, 07:09:35 AM
Brother,
like d way as DIGITAL POINT FORUMS place ADS on their site..like..."between" the first post of their topic..i want to have ads like that..is..there a way...
Title: Re: Google AdSense in SMF, various positions...
Post by: Arantor on February 11, 2010, 07:56:21 AM
yurckk: Ask the mod's author then, via the Support and Comments for this mod.

funindiazone: I think it's actually an option of Ad Management mod as I mentioned above.
Title: Re: Google AdSense in SMF, various positions...
Post by: Raul Malik on February 11, 2010, 11:20:41 AM
Actually...they place AD in between the content of the first post...
Ad management mod doesn't have that option....
Title: Re: Google AdSense in SMF, various positions...
Post by: yurckk on February 12, 2010, 01:54:07 PM
Yerp, I really waiting for someone to discover on how to make that like at DP.
I think the conversion rates will be higher.
Title: Re: Google AdSense in SMF, various positions...
Post by: pipmaster420 on February 18, 2010, 08:00:03 AM
thanks all...I have been able to put google adsense after the first post at my forum.
Check my signature.
Title: Re: Google AdSense in SMF, various positions...
Post by: yurckk on February 19, 2010, 08:15:42 AM
It seems, DP had changed the adsense block placement. Maybe google don't allow the previous method.
Title: Re: Google AdSense in SMF, various positions...
Post by: punjablovers on February 20, 2010, 01:46:46 PM
Hi there,
Please some one tell me how to show adds under the post title and before stating the content?
Like this

http://www.funfani.com/smsssssss/a-collection-of-freindship-sms-t12844.0.html

I am using Core Default theme
Thanks in advance
Title: Re: Google AdSense in SMF, various positions...
Post by: Raul Malik on February 26, 2010, 03:43:31 AM
Quote from: punjablovers on February 20, 2010, 01:46:46 PM
Hi there,
Please some one tell me how to show adds under the post title and before stating the content?
Like this

http://www.funfani.com/smsssssss/a-collection-of-freindship-sms-t12844.0.html

I am using Core Default theme
Thanks in advance

yes this would be nice...
Can anyone tell how to do that..
Title: Re: Google AdSense in SMF, various positions...
Post by: Raul Malik on March 03, 2010, 11:32:04 PM
Bump
Title: Re: Google AdSense in SMF, various positions...
Post by: zaibatt on March 04, 2010, 02:43:35 AM
Yeh! Its working. I faced the same problem. Thanks for all for your contribution.
Title: Re: Google AdSense in SMF, various positions...
Post by: bing4all on March 21, 2010, 12:26:18 PM
i want to post my adds in middle of the post can any one help me plz
Title: Re: Google AdSense in SMF, various positions...
Post by: jezzb on March 30, 2010, 07:22:49 AM
Hi All,

Did you find a way to sort this out :
"Hi, I've managed to add adsense block after the first post just right below the signature, thanks for the code!
By the way, how to add adsense in every first post like DigitalPoint.com? Anyone having success with it?
"

If yes, can someone please post how to do it?

Thanks
Jezzb
Title: Re: Google AdSense in SMF, various positions...
Post by: zinruss on March 31, 2010, 07:52:36 AM
Quote from: bing4all on March 21, 2010, 12:26:18 PM
i want to post my adds in middle of the post can any one help me plz

Try this.
http://custom.simplemachines.org/mods/index.php?mod=255

Two types of ad code are allowed. Either html(javascript) or PHP. I am using version 2.3 in SMF 1.1.4 and it work like a charm. You can
Display ads within posts - if you set it to 1, your ad will show between post 1 and post 2. If you set it to 2, your ad will show between post 2 and post 3...etc etc

Other than this, you can
- Display ads after categories - if you set it to 1, your ad will show between category 1 and category 2. If you set it to 2, your ad will show between category 2 and category 3...etc etc
- Display ads on board index ( tick to enable )
- Display ads on every page right below the menu ( tick to enable )
- Display ads on message index ( tick to enable )
- Display ads on the post page ( tick to enable )
- Display ads after the last post ( tick to enable )
- Display ads on every page on the top of the page ( tick to enable )
- Display ads in the welcome user area ( tick to enable )
- Display ads on the bottom of the page ( tick to enable )
- Display ads on every page as a tower on the left side ( tick to enable )
- Display ads on every page as a tower on the right side ( tick to enable )
- Display ads under child boards ( tick to enable )

Hope this help.
Title: Re: Google AdSense in SMF, various positions...
Post by: jani01 on April 02, 2010, 10:56:14 PM
Quote from: punjablovers on February 20, 2010, 01:46:46 PM
Hi there,
Please some one tell me how to show adds under the post title and before stating the content?
Like this

http://www.funfani.com/smsssssss/a-collection-of-freindship-sms-t12844.0.html

I am using Core Default theme
Thanks in advance
Quote from: Raul Malik on February 26, 2010, 03:43:31 AM
Quote from: punjablovers on February 20, 2010, 01:46:46 PM
Hi there,
Please some one tell me how to show adds under the post title and before stating the content?
Like this

http://www.funfani.com/smsssssss/a-collection-of-freindship-sms-t12844.0.html

I am using Core Default theme
Thanks in advance

yes this would be nice...
Can anyone tell how to do that..

Off course ads placement is good.  I have also done this at www(.)pakmelody.com/community/index.php.  It can further be customized according to background of your theme.

Title: Re: Google AdSense in SMF, various positions...
Post by: SDX1 on April 03, 2010, 07:42:06 PM
Hi guys,

Where and how exactly do I add the Google Adsense code for the Ads to display below the Menu on EVERY page on the "ORANGE-LT" theme?

Thanks! :)
Title: Re: Google AdSense in SMF, various positions...
Post by: SDX1 on April 06, 2010, 07:16:48 PM
Quote from: SDX1 on April 03, 2010, 07:42:06 PM
Hi guys,

Where and how exactly do I add the Google Adsense code for the Ads to display below the Menu on EVERY page on the "ORANGE-LT" theme?

Thanks! :)

Anyone??
Title: Re: Google AdSense in SMF, various positions...
Post by: flapjack on April 06, 2010, 07:39:43 PM
you need to ask that question in this theme's support topic
Title: Re: Google AdSense in SMF, various positions...
Post by: SDX1 on April 06, 2010, 09:12:16 PM
Quote from: flapjack on April 06, 2010, 07:39:43 PM
you need to ask that question in this theme's support topic

Where is that please?
Title: Re: Google AdSense in SMF, various positions...
Post by: TheListener on April 06, 2010, 09:15:11 PM
http://custom.simplemachines.org/themes/

Then whichever theme is the one being used.
Title: Re: Google AdSense in SMF, various positions...
Post by: SDX1 on April 07, 2010, 09:05:52 PM
Quote from: Brack1 on April 06, 2010, 09:15:11 PM
http://custom.simplemachines.org/themes/

Then whichever theme is the one being used.

I just asked and nobody's responding :(
...
Is there a general place to add the Adsense code on all templates?
Title: Re: Google AdSense in SMF, various positions...
Post by: flapjack on April 07, 2010, 09:20:45 PM
try this:
http://www.simplemachines.org/community/index.php?topic=375157.msg2574981#msg2574981
Title: Re: Google AdSense in SMF, various positions...
Post by: exnecko on April 13, 2010, 05:33:40 AM
This description is good !Is there somewhere to download the whole example?
Title: Re: Google AdSense in SMF, various positions...
Post by: Arantor on April 13, 2010, 05:35:14 AM
Again it's not something you download.

If you want something that you can download then have to install manually anyway... Ad Management mod (http://custom.simplemachines.org/mods/index.php?mod=255) (since it won't work on many custom themes)
Title: Re: Google AdSense in SMF, various positions...
Post by: snyperthugs on April 24, 2010, 06:42:31 AM
for some REALLY WACK reason I can not get the ads to show up after first post. I been trying and trying and trying. I using 1.1.11  with Default Theme. and Its driving me stupid!!  It leaves a space for the ad, but it is blank with nothing there. Any help would be greatly appreciated
Title: Re: Google AdSense in SMF, various positions...
Post by: visitnepal on April 25, 2010, 06:17:16 PM
Thanks for sharing. Really useful.
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on April 25, 2010, 11:10:39 PM
Quote from: snyperthugs on April 24, 2010, 06:42:31 AM
for some REALLY WACK reason I can not get the ads to show up after first post. I been trying and trying and trying. I using 1.1.11  with Default Theme. and Its driving me stupid!!  It leaves a space for the ad, but it is blank with nothing there. Any help would be greatly appreciated

If you have only just set up your ads on the ad provider your using, it may be a while before they will work
Title: Re: Google AdSense in SMF, various positions...
Post by: snyperthugs on April 26, 2010, 04:39:25 AM
Quote from: ♪ JohnCcCcCc ♫ on April 25, 2010, 11:10:39 PM
Quote from: snyperthugs on April 24, 2010, 06:42:31 AM
for some REALLY WACK reason I can not get the ads to show up after first post. I been trying and trying and trying. I using 1.1.11  with Default Theme. and Its driving me stupid!!  It leaves a space for the ad, but it is blank with nothing there. Any help would be greatly appreciated

If you have only just set up your ads on the ad provider your using, it may be a while before they will work

Thanks for replying. And Im not sure if that it because my ads work at the top of the site... but nowhere else
Title: Re: Google AdSense in SMF, various positions...
Post by: punjablovers on April 27, 2010, 03:22:17 PM
Some help needed about add placement in Aeva Media (Gallery & Auto-embedder):::

http://apnimastian.com/index.php?action=media;sa=item;in=7
Check above url here you will find a video, i want to show my adds on left and right side of the video, how can i do this.
Regards.
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on May 01, 2010, 12:29:48 PM
Quote from: snyperthugs on April 26, 2010, 04:39:25 AM
Quote from: ♪ JohnCcCcCc ♫ on April 25, 2010, 11:10:39 PM
Quote from: snyperthugs on April 24, 2010, 06:42:31 AM
for some REALLY WACK reason I can not get the ads to show up after first post. I been trying and trying and trying. I using 1.1.11  with Default Theme. and Its driving me stupid!!  It leaves a space for the ad, but it is blank with nothing there. Any help would be greatly appreciated

If you have only just set up your ads on the ad provider your using, it may be a while before they will work

Thanks for replying. And Im not sure if that it because my ads work at the top of the site... but nowhere else
It could be also that you have too many ads on one page, if your using Google Adsense they have a limit to how many ads you can use on one page, I believe its somewhere around 4 ads.

If you have less than this then I see no reason why it should not work. You will need to seek more help, from someone that can login to your site and look for errors in coding.
Title: Re: Google AdSense in SMF, various positions...
Post by: punjablovers on May 05, 2010, 02:44:51 AM
Quote from: punjablovers on April 27, 2010, 03:22:17 PM
Some help needed about add placement in Aeva Media (Gallery & Auto-embedder):::

http://apnimastian.com/index.php?action=media;sa=item;in=7
Check above url here you will find a video, i want to show my adds on left and right side of the video, how can i do this.
Regards.

Waiting for Answer,,,,,,
Title: Re: Google AdSense in SMF, various positions...
Post by: icoify on May 06, 2010, 05:45:45 PM
Am new with SMF. How do i add google adsence code to my forum. am using SMF 1.1.11. please help me. if it has already been peaste here b4, due give me the link to read it!
Title: Re: Google AdSense in SMF, various positions...
Post by: punjablovers on May 09, 2010, 09:24:17 AM
Quote from: punjablovers on May 05, 2010, 02:44:51 AM
Quote from: punjablovers on April 27, 2010, 03:22:17 PM
Some help needed about add placement in Aeva Media (Gallery & Auto-embedder):::

http://apnimastian.com/index.php?action=media;sa=item;in=7
Check above url here you will find a video, i want to show my adds on left and right side of the video, how can i do this.
Regards.

Waiting for Answer,,,,,,
Still waiting
Title: Re: Google AdSense in SMF, various positions...
Post by: Webguru2020 on May 30, 2010, 03:28:46 AM
What position that you think is the best for earning from adsense? I am not sure about the thread.
Title: Re: Google AdSense in SMF, various positions...
Post by: mcmedal001 on May 30, 2010, 03:45:01 AM
Plz how do i edit my display.index.php? Im using babylon theme, and i want to put google adsense right below d menu,on every page. Plz where will i paste my google code?. Im using smf 1.1.11. Plz help needed urgently. Thanx ahead
Title: Re: Google AdSense in SMF, various positions...
Post by: punjablovers on June 05, 2010, 12:13:23 PM
This thread is going to dead!!! all support team is sleeping and taking some rest!!!! So many people are using SMF, but the support team is to lazy to provide some help, just start a thread and take rest, supporting team will give you help after 6 Months O:) To much discussing!!!!
Title: Re: Google AdSense in SMF, various positions...
Post by: Arantor on June 06, 2010, 08:29:52 PM
Quote from: punjablovers on June 05, 2010, 12:13:23 PM
This thread is going to dead!!! all support team is sleeping and taking some rest!!!! So many people are using SMF, but the support team is to lazy to provide some help, just start a thread and take rest, supporting team will give you help after 6 Months O:) To much discussing!!!!

Or use either of the mods for inserting ads...

Technically the team isn't strictly responsible for providing support here, generally the thread starter is assumed to be.
Title: Re: Google AdSense in SMF, various positions...
Post by: Phoestre on June 07, 2010, 09:40:19 AM
Quote from: Arantor on June 06, 2010, 08:29:52 PM
Quote from: punjablovers on June 05, 2010, 12:13:23 PM
This thread is going to dead!!! all support team is sleeping and taking some rest!!!! So many people are using SMF, but the support team is to lazy to provide some help, just start a thread and take rest, supporting team will give you help after 6 Months O:) To much discussing!!!!

Or use either of the mods for inserting ads...

Technically the team isn't strictly responsible for providing support here, generally the thread starter is assumed to be.

Arantor is right. "Individual" posting the tip/trick is responsible for support and explanation.;) If we were going to hold SM LLC responsible for advises from individuals, wow.. I don't think they even check this board, other than moderation, yes they are watching us! :P
Title: Re: Google AdSense in SMF, various positions...
Post by: Hj Ahmad Rasyid Hj Ismail on June 17, 2010, 01:20:46 PM
Quote from: rancitis on March 23, 2008, 07:53:23 AM
(http://img181.imageshack.us/img181/7449/picvt3.th.jpg)

Try this for SMF 2.0 RC3. Change left to right if you want it to be on the right side and the width accordingly with your ad size (+10px to be more beautiful).

Quote from: Abu Fahim Ismail on June 17, 2010, 09:28:46 AM
After some reference, I clean up the code a bit with ad only in the first post. Change float:left; width:270px; and adsense id to your need.
Find:
echo '
<div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>
</div>';

Replace:
echo '
<div class="inner" id="msg_', $message['id'], '"', '>';
if ($message['id'] == $context['first_message'])
echo '
<div style="float:left; width:270px;">
<script target="_blank" type="text/javascript"><!--
google_ad_client = "pub-xxxxxxxxxxxxxxxxx";
/* All 250x250 */
google_ad_slot = "8967115259";
google_ad_width = 250;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js?target=_blank">
</script></div>';
echo '
', $message['body'], '</div>
</div>';


At the same time, I am looking for a solution for this too (without the text or ad being hidden). :(

Quote from: anakmacan on September 30, 2008, 05:12:06 AM
(http://img504.imageshack.us/img504/1331/adsxz5.gif)
Title: Re: Google AdSense in SMF, various positions...
Post by: shawdy on July 13, 2010, 10:27:10 AM
Banning people with such helpfull posts?!?! i was hoping he could help do this with version one sad! being banned for a signature picture, get a grip smf
Title: Re: Google AdSense in SMF, various positions...
Post by: Hj Ahmad Rasyid Hj Ismail on July 15, 2010, 06:06:17 PM
Quote from: shawdy on July 13, 2010, 10:27:10 AM
Banning people with such helpfull posts?!?! i was hoping he could help do this with version one sad! being banned for a signature picture, get a grip smf
Lol... Hi, shawdy. I am not banned here. No, not by SMF. They are kind people here with a good free license software for all of us. I was banned somewhere else by using the signature. I thought I put it there as my signature as a protest to them (not SMF). Sorry, if I misled you in any kind. Always, remember that the last part of the post is the signature and not a note for banning. Sorry again.
Title: Re: Google AdSense in SMF, various positions...
Post by: GarfieldP on July 31, 2010, 04:42:24 PM
if you have bidvertiser, and you want to do the category one it should look like this: (index.template.php where first google modifications are found)
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/default/images/www.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/default/images/upshrink2.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=6.0"><img src="/Themes/default/images/topic/normal_post.gif" alt="n" border="0" title="Start new topic" /></a>
</div>
<!-- Begin BidVertiser code -->
<SCRIPT LANGUAGE="JavaScript1.1" SRC="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=code1&bid=code2" type="text/javascript"></SCRIPT>
<noscript><a href="http://www.bidvertiser.com">make money online</a></noscript>
<!-- End BidVertiser code -->
</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="50%" nowrap="nowrap">
<span class="smalltext"><img border="0" src="/Themes/smfaqua/images/www.gif" align="middle" title="" alt="" />Posted <b>Today</b>,at 6:30:00 AM<br>by <u>Bidvertiser</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>';
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on July 31, 2010, 04:46:28 PM
Who is having this issue
(http://img504.imageshack.us/img504/1331/adsxz5.gif)

Because I have my ads just like this, however the text is on the right side of it only

I can help lol...
Title: Re: Google AdSense in SMF, various positions...
Post by: punjablovers on August 01, 2010, 09:18:05 AM
I think he can use simple ad mod or google ad mod.
Title: Re: Google AdSense in SMF, various positions...
Post by: Hj Ahmad Rasyid Hj Ismail on August 01, 2010, 09:20:17 AM
Quote from: punjablovers on August 01, 2010, 09:18:05 AM
I think he can use simple ad mod or google ad mod.
Nope. Try that already.
Title: Re: Google AdSense in SMF, various positions...
Post by: Hj Ahmad Rasyid Hj Ismail on August 01, 2010, 09:22:57 AM
Quote from: johncccccc on July 31, 2010, 04:46:28 PM
Who is having this issue
Because I have my ads just like this, however the text is on the right side of it only
I am. If that is the case, I can do something like that too. But what I want is for it to float left or right and valign middle not on the right side only.
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on August 01, 2010, 11:16:17 AM
Quote from: AbuFahim⎝⏠⏝⏠⎠ on August 01, 2010, 09:22:57 AM
Quote from: johncccccc on July 31, 2010, 04:46:28 PM
Who is having this issue
Because I have my ads just like this, however the text is on the right side of it only
I am. If that is the case, I can do something like that too. But what I want is for it to float left or right and valign middle not on the right side only.

Which are you using, smf 1 or 2 ?
Title: Re: Google AdSense in SMF, various positions...
Post by: Hj Ahmad Rasyid Hj Ismail on August 01, 2010, 11:22:26 AM
2.0 RC3
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on August 01, 2010, 11:23:59 AM
OK then attach your display.template.php

And your ad code too, coded in post

Then all that post (in the image, or similar), also coded, I can get this done.
Title: Re: Google AdSense in SMF, various positions...
Post by: lmoi on August 08, 2010, 03:47:32 PM
My adsense account has been banned since last year is thier anyway to re activate it back.
thanx
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on August 08, 2010, 04:18:35 PM
Quote from: lmoi on August 08, 2010, 03:47:32 PM
My adsense account has been banned since last year is thier anyway to re activate it back.
thanx

Kiss it goodbye, your never going to get it re-enabled.

unless;

you change your domain.
change your home address (or use another)
change your SSN (or use another)
change your name (or use another)

lol its true, somebody click bombed mine adsense ads, and mine was and still is disabled, that's what you get when you have competition.

I moved to adbrite, seems to be the next best thing after adsense.
Title: Re: Google AdSense in SMF, various positions...
Post by: xpubstargamingx on August 12, 2010, 12:57:32 PM
I am interested in adding Adsense to my forums. Right now my only Ad is listed on the Homepage of my website, but I would like to add to my forums since that is where the most impressions would come from.

What information do I need to include in this thread for someone to assist me in setting this up correctly?

I am using SMF 1.1.11 any help would be greatly appreciated.
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on August 12, 2010, 01:37:49 PM
their are several ways to add ads, like some of the ad mods here or even portal blocks (html blocks)
Title: Re: Google AdSense in SMF, various positions...
Post by: xpubstargamingx on August 12, 2010, 01:53:08 PM
Quote from: JohnCcCcCc on August 12, 2010, 01:37:49 PM
their are several ways to add ads, like some of the ad mods here or even portal blocks (html blocks)

I don't know how to install any of the Ad Mods, I am looking to just add the script to my index.template.php if possible. Realy whatever will help me receive the most impressions on my forums.
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on August 12, 2010, 01:59:29 PM
Well if you want to do it manually then you need to tell us where you want the ad to be placed.
Title: Re: Google AdSense in SMF, various positions...
Post by: xpubstargamingx on August 12, 2010, 02:32:33 PM
Quote from: JohnCcCcCc on August 12, 2010, 01:59:29 PM
Well if you want to do it manually then you need to tell us where you want the ad to be placed.

I am thinking here if possible...

(http://img696.imageshack.us/img696/1862/capture1sd.jpg)

(http://img9.imageshack.us/img9/6920/captureqt.jpg)
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on August 12, 2010, 02:33:43 PM
Your running SMF 1.1 or SMF 2 RC3 core theme ?
Title: Re: Google AdSense in SMF, various positions...
Post by: xpubstargamingx on August 14, 2010, 12:52:34 AM
Quote from: JohnCcCcCc on August 12, 2010, 02:33:43 PM
Your running SMF 1.1 or SMF 2 RC3 core theme ?

I am using SMF 1.1.11

Default-copy (1.1.5) Theme

Any help would be greatly appreciated. Thanks in advance to anyone that offers help.
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on August 14, 2010, 12:01:13 PM
Quote from: xpubstargamingx on August 14, 2010, 12:52:34 AM
Quote from: JohnCcCcCc on August 12, 2010, 02:33:43 PM
Your running SMF 1.1 or SMF 2 RC3 core theme ?

I am using SMF 1.1.11

Default-copy (1.1.5) Theme

Any help would be greatly appreciated. Thanks in advance to anyone that offers help.

Would you like it for guests only or for everybody?
Title: Re: Google AdSense in SMF, various positions...
Post by: xpubstargamingx on August 14, 2010, 12:19:23 PM
Quote from: JohnCcCcCc on August 14, 2010, 12:01:13 PM
Quote from: xpubstargamingx on August 14, 2010, 12:52:34 AM
Quote from: JohnCcCcCc on August 12, 2010, 02:33:43 PM
Your running SMF 1.1 or SMF 2 RC3 core theme ?

I am using SMF 1.1.11

Default-copy (1.1.5) Theme

Any help would be greatly appreciated. Thanks in advance to anyone that offers help.

Would you like it for guests only or for everybody?

I would like for the Ads to show for everyone that visits the forum.
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on August 14, 2010, 12:23:13 PM
Index.template.php
Code (find) Select

// If the user is logged in, display stuff like their name, new messages, etc.

Code ( Add after) Select

            echo '<div id= "floatright">
    Some ad code goes here
    </div>';


Also, add the following class to style.css

#floatright
{
    float:right;
}


That's for the ad at the top, although is says find "// If the user is logged in" it will still display for guests as its before the if statement. :)
Title: Re: Google AdSense in SMF, various positions...
Post by: xpubstargamingx on August 14, 2010, 12:48:48 PM
Quote from: JohnCcCcCc on August 14, 2010, 12:23:13 PM
Index.template.php
Code (find) Select

// If the user is logged in, display stuff like their name, new messages, etc.

Code ( Add after) Select

            echo '<div id= "floatright">
    Some ad code goes here
    </div>';


Also, add the following class to style.css

#floatright
{
    float:right;
}


That's for the ad at the top, although is says find "// If the user is logged in" it will still display for guests as its before the if statement. :)

I keep getting this error, sorry I really have no idea what I am doing.

Parse error: syntax error, unexpected T_ELSE in .../Themes/Default-copy/index.template.php  on line 256

247:
248: {
249: echo '
250: <a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a> <br />
251: <a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />';
252:
253: }
254:
255: // Otherwise they're a guest - send them a lovely greeting...

256: else

257: echo $txt['welcome_guest'];
258:
259: // Now, onto our second set of info, are they logged in again?
260: if ($context['user']['is_logged'])


Now I cannot even access my forums... :'(
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on August 14, 2010, 12:52:06 PM
Attach Index.template.php, I can add it for you :)
Title: Re: Google AdSense in SMF, various positions...
Post by: xpubstargamingx on August 14, 2010, 12:54:59 PM
Quote from: JohnCcCcCc on August 14, 2010, 12:52:06 PM
Attach Index.template.php, I can add it for you :)

I just lost everything, my theme is completely gone... :'(
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on August 14, 2010, 01:00:10 PM
Ok don't panic, you probably have a backup you don't even know about.

Look for Index.template.php~, attach that.

Upon further reading, I assume your editing from the theme editor within the forum.

Please access the files using a FTP client.
How do I use FTP? / What is FTP? (http://docs.simplemachines.org/index.php?topic=480.0)



To access your forum temporarily use a default theme

yourforum.com/index.php?theme=1
Title: Re: Google AdSense in SMF, various positions...
Post by: xpubstargamingx on August 14, 2010, 01:03:18 PM
Quote from: JohnCcCcCc on August 14, 2010, 01:00:10 PM
Ok don't panic, you probably have a backup you don't even know about.

Look for Index.template.php~, attach that.

Upon further reading, I assume your editing from the theme editor within the forum.

Please access the files using a FTP client.
How do I use FTP? / What is FTP? (http://docs.simplemachines.org/index.php?topic=480.0)

Thanks for offering the help, but I have no idea what you are asking me to do about locating the index.template.php and attaching it.
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on August 14, 2010, 01:04:35 PM
To access your forum temporarily use the default theme

yourforum.com/index.php?theme=1
Title: Re: Google AdSense in SMF, various positions...
Post by: xpubstargamingx on August 14, 2010, 01:06:37 PM
Quote from: JohnCcCcCc on August 14, 2010, 01:04:35 PM
To access your forum temporarily use the default theme

yourforum.com/index.php?theme=1

Do you have AIM?

My username is the same if so.
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on August 14, 2010, 01:08:05 PM
No, I do not use AOL.

Did you try to access your forum as stated above?
Title: Re: Google AdSense in SMF, various positions...
Post by: xpubstargamingx on August 14, 2010, 01:08:53 PM
Quote from: JohnCcCcCc on August 14, 2010, 01:08:05 PM
No, I do not use AOL.

Did you try to access your forum as stated above?

Yes I am there.
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on August 14, 2010, 01:14:47 PM
No, I do not use AOL.

Did you try to access your forum as stated above?
Title: Re: Google AdSense in SMF, various positions...
Post by: xpubstargamingx on August 14, 2010, 01:15:57 PM
Quote from: JohnCcCcCc on August 14, 2010, 01:14:47 PM
No, I do not use AOL.

Did you try to access your forum as stated above?

Yes I am there. What next?
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on August 14, 2010, 01:20:10 PM
Now, I need you to attach your index.template.php file, from your custom theme, you will have to log into your hosts cpanel or FTP client and upload the file here.
Title: Re: Google AdSense in SMF, various positions...
Post by: xpubstargamingx on August 14, 2010, 01:30:31 PM
Quote from: JohnCcCcCc on August 14, 2010, 01:20:10 PM
Now, I need you to attach your index.template.php file, from your custom theme, you will have to log into your hosts cpanel or FTP client and upload the file here.

http://www.mediafire.com/?fl359dyd3i053pc

Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on August 14, 2010, 01:34:29 PM
You can attach the templates here, instead of using Quick Reply, click reply on the right side then click  "+additional options" , then attach files their.
Are you sure that file is the one from your theme, because their are no errors in that file.
Title: Re: Google AdSense in SMF, various positions...
Post by: xpubstargamingx on August 14, 2010, 01:37:24 PM
Quote from: JohnCcCcCc on August 14, 2010, 01:34:29 PM
You can attach the templates here, instead of using Quick Reply, click reply on the right side then click  "+additional options" , then attach files their.
Are you sure that file is the one from your theme, because their are no errors in that file.

My theme was wiped out completely none of my stuff is there anymore when I access my forums.

For example...

(http://img696.imageshack.us/img696/1862/capture1sd.jpg)

Numerous buttons are now missing form my Navigation. Such as Donate, Promote, etc...
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on August 14, 2010, 01:42:06 PM
Well, look.

In your custom theme folder, their should be a backup called "index.template.php~" note the ~ at the end, attach that one please.
Title: Re: Google AdSense in SMF, various positions...
Post by: xpubstargamingx on August 14, 2010, 01:50:17 PM
Quote from: JohnCcCcCc on August 14, 2010, 01:42:06 PM
Well, look.

In your custom theme folder, their should be a backup called "index.template.php~" note the ~ at the end, attach that one please.

Sorry I must not have enough posts to add attachments, because it is not an option for me...

http://www.mediafire.com/?80uxy7urjpxqii9

That is the file you asked for and it hasn't been touched sine 06/24

Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on August 14, 2010, 01:54:21 PM
Well see, this file is generated after the last mod changed it, so all you need to remember is which mod you installed last
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on August 14, 2010, 01:59:08 PM
No attachments for me neither, maybe their disabled in the tips and tricks board, for some odd reason...

http://www.mediafire.com/?6bcpldbckwe90e5

I would recommend uploading the broken one however, using this will remove edits made by your last installed mod, if you have the broken index.template.php please upload it
Title: Re: Google AdSense in SMF, various positions...
Post by: xpubstargamingx on August 14, 2010, 02:01:06 PM
Quote from: JohnCcCcCc on August 14, 2010, 01:54:21 PM
Well see, this file is generated after the last mod changed it, so all you need to remember is which mod you installed last

In order to do what? I really just need my Navigation Bar corrected, I am fine with everything else that has happened I guess. How can I add back the Donate, Promote, Site Index options to the Navigation Bar?

Since adding this AdSense is such a hassle I will just forget about it.
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on August 14, 2010, 02:02:57 PM
All these were working correctly before you attempted to add the ad?

If so...

Upload the broken index.template.php file.
./Themes/{your current custom theme}/index.template.php
Title: Re: Google AdSense in SMF, various positions...
Post by: Aportadordelmix on August 14, 2010, 02:06:25 PM
Thanks Moonray  :)
Title: Re: Google AdSense in SMF, various positions...
Post by: xpubstargamingx on August 14, 2010, 02:21:05 PM
Quote from: JohnCcCcCc on August 14, 2010, 02:02:57 PM
All these were working correctly before you attempted to add the ad?

If so...

Upload the broken index.template.php file.
./Themes/{your current custom theme}/index.template.php

Thanks for the assistance everything is back to normal now. You have been a wonderful help, just wish I could get this AdSense thing working. I am missing out on 10,000 impressions a day... :'(
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on August 14, 2010, 02:24:03 PM
If you upload that one that's working now, I can add that ad in for you, I wont mess it up :P lol
Title: Re: Google AdSense in SMF, various positions...
Post by: xpubstargamingx on August 14, 2010, 02:45:01 PM
Quote from: JohnCcCcCc on August 14, 2010, 02:24:03 PM
If you upload that one that's working now, I can add that ad in for you, I wont mess it up :P lol

Thanks a lot. I have stressed too much over the past 2 days trying to figure this out.

http://www.mediafire.com/?1mb9qpewqmxee6g

Here is the AdSense Code...

<script type="text/javascript"><!--
google_ad_client = "pub-9429299917480675";
/* 468x60, created 8/14/10 */
google_ad_slot = "1259794898";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on August 14, 2010, 02:52:55 PM
http://www.mediafire.com/?uljifzwupk0ml09

Their you go, remember to backup your file :)
Title: Re: Google AdSense in SMF, various positions...
Post by: xpubstargamingx on August 30, 2010, 08:40:53 AM
Quote from: JohnCcCcCc on August 14, 2010, 02:52:55 PM
http://www.mediafire.com/?uljifzwupk0ml09

Their you go, remember to backup your file :)

I appreciate all the help you offered, but this never worked.

Would anyone else know how to go about adding Google Adsense to my forums? Thanks.
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on August 30, 2010, 08:56:53 AM
Are you sure you added this to the correct theme?

That's definitely in the right place for displaying that ad. I have a theme based on core just like that and I displayed my ad the same way and it works fine.

Got a link to your forum
Title: Re: Google AdSense in SMF, various positions...
Post by: xpubstargamingx on August 30, 2010, 09:14:29 AM
Quote from: JohnCcCcCc on August 30, 2010, 08:56:53 AM
Are you sure you added this to the correct theme?

That's definitely in the right place for displaying that ad. I have a theme based on core just like that and I displayed my ad the same way and it works fine.

Got a link to your forum

http://pubstargaming.com/forum
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on August 30, 2010, 09:24:24 AM
Try this
http://www.mediafire.com/?cymf11eaj2udfpg
Remember to add that custom class to style.css or it will not float right. ;)
Title: Re: Google AdSense in SMF, various positions...
Post by: xpubstargamingx on August 30, 2010, 11:41:23 AM
Quote from: JohnCcCcCc on August 30, 2010, 09:24:24 AM
Try this
http://www.mediafire.com/?cymf11eaj2udfpg
Remember to add that custom class to style.css or it will not float right. ;)

My work has Websense so I cannot view to see if this is coming up right now. I added the new index, could you visit the site again and see if this is working now? Thanks, do you have a PayPal I could send a donation to for helping me out, if this is working?
Title: Re: Google AdSense in SMF, various positions...
Post by: sandrabright10 on September 10, 2010, 08:13:40 AM
Great tips! The adsense are very nice on my forum. I used the code that I found on this discussion topic and I added my pub code. And it works!  ;D Thank you!
Title: Re: Google AdSense in SMF, various positions...
Post by: KensonPlays on September 11, 2010, 01:53:43 AM
good job! I was denied adsense for some reason. i answered questions,etc correctly, oh well i dont be using this.

great job though!
Title: Re: Google AdSense in SMF, various positions...
Post by: wcharlot on September 11, 2010, 03:08:43 AM
Wow this is really very helpful.

It helped me gain some information. I am just a newbie. Thanks
Title: Re: Google AdSense in SMF, various positions...
Post by: Hj Ahmad Rasyid Hj Ismail on September 11, 2010, 07:44:13 AM
Quote from: Kcmartz on September 11, 2010, 01:53:43 AM
good job! I was denied adsense for some reason. i answered questions,etc correctly, oh well i dont be using this.

great job though!

IMHO all of these can be used to all other ads as well. So if you have other ads to display, you may use them too.
Title: Re: Google AdSense in SMF, various positions...
Post by: KensonPlays on September 11, 2010, 10:49:49 PM
I will just use SimpleAds though, once i get ads, and once paypal gets verified, ill use paid subscriptions for ad-free!
Title: Re: Google AdSense in SMF, various positions...
Post by: Hj Ahmad Rasyid Hj Ismail on September 12, 2010, 01:39:37 PM
Quote from: Kcmartz on September 11, 2010, 10:49:49 PM
I will just use SimpleAds though, once i get ads, and once paypal gets verified, ill use paid subscriptions for ad-free!

Sounds like you'll getting richer, Kcmartz... ;D
Title: Re: Google AdSense in SMF, various positions...
Post by: KensonPlays on September 12, 2010, 10:31:44 PM
Eventually. Ill probably charge between $1.50-$5 per year, very small so maybe more members will purchase!

And possibly when you reach 10k posts on my site you'll get free ad-free!
Title: Re: Google AdSense in SMF, various positions...
Post by: wcharlot on September 12, 2010, 10:37:08 PM
Kcmartz, that can be the coolest suggestion! O:)
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on September 12, 2010, 11:21:41 PM
Those options can be achieved easily with a few PHP conditions before the ad script and one paid subscription to automate the entire process.
Title: Re: Google AdSense in SMF, various positions...
Post by: Hj Ahmad Rasyid Hj Ismail on September 13, 2010, 06:30:45 AM
Quote from: Kcmartz on September 12, 2010, 10:31:44 PM
Eventually. Ill probably charge between $1.50-$5 per year, very small so maybe more members will purchase!

And possibly when you reach 10k posts on my site you'll get free ad-free!

That is a nice idea. At least it is enough to support your domain and hosting annual fee. :D
Title: Re: Google AdSense in SMF, various positions...
Post by: KensonPlays on September 13, 2010, 09:29:53 AM
yep, most will go to the site, and when its more regular, move to a better host! but until then no ads can speed up page loading. if i make $15/year ill take $2 for me. something like that
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on September 13, 2010, 12:46:30 PM
Quote from: Kcmartz on September 13, 2010, 09:29:53 AM
yep, most will go to the site, and when its more regular, move to a better host! but until then no ads can speed up page loading. if i make $15/year ill take $2 for me. something like that

I have all my ads set up this way, if you need any help with it, don't hesitate to ask :)
Title: Re: Google AdSense in SMF, various positions...
Post by: wcharlot on September 14, 2010, 12:19:39 AM
From now on I am going to get Adsense. this is really making sense now.
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on September 14, 2010, 11:43:12 AM
Quote from: wcharlot on September 14, 2010, 12:19:39 AM
From now on I am going to get Adsense. this is really making sense now.
Adsense is the number 1 ad provider I believe, I would use a tracking system however, if some of your visitors/members misuse the ads, click clicking the c**P out of them just to help you (without you even knowing) Adsense will disable your account, and until you provide logs and they determine what happened it will never be enabled again.

Just be careful, and don't click your own ads, not that you will, just a friendly warning. Google are VERY strict.
Title: Re: Google AdSense in SMF, various positions...
Post by: KensonPlays on September 15, 2010, 10:40:23 AM
JohnCcCcCc, if you could, PM me what ad services you use, a few of those free backlink ones would be nice, and some cheap ones, ill pay the ads and free ones once I get around 200+ posts a day and 500 members or more
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on September 20, 2010, 01:15:31 PM
I use Adbrite. but I do not advertise my forum, I just use the publisher section only.
Title: Re: Google AdSense in SMF, various positions...
Post by: KensonPlays on September 21, 2010, 01:53:13 AM
is adbrite free?

also, is mochiads?
Title: Re: Google AdSense in SMF, various positions...
Post by: ɔɔɔɔɔɔuɥoɾ on September 21, 2010, 06:25:00 PM
Errmmm...

Ad providers for publishers pay you, you don't pay them...
Title: Re: Google AdSense in SMF, various positions...
Post by: nend on September 21, 2010, 11:21:07 PM
Quote from: Kcmartz on September 21, 2010, 01:53:13 AM
is adbrite free?

also, is mochiads?

There free for publishers to put the ads on their sites.

However Mochi is for flash games, they are embedded in the games in other words and takes a little know how to get them set up. If you plan to run flash games with Mochi ads in them please take a look at my Mochi Media Hack for SMF Arcade.

I use AdBrite, AdSense and Mochi with a competitive edge through Google's Double Click program. I also run paid ads through my sites through Google Double Click program or AdBrite.

However I am unsure of the legal age you must be to participate in these programs. You got your labor laws and plus legal binding contracts really don't hold up in the US for minors so allot of companies are hesitant to allow minors to sign up. I don't know which programs may not allow sign up due to age, but that is something you can figure out.
Title: Re: Google AdSense in SMF, various positions...
Post by: nend on September 22, 2010, 11:08:51 AM
Quote from: ahrasis on September 22, 2010, 05:07:48 AM
Quote from: nend on September 21, 2010, 11:21:07 PM
I use AdBrite, AdSense and Mochi with a competitive edge through Google's Double Click program. I also run paid ads through my sites through Google Double Click program or AdBrite.
What is Google's Double Click program? I just heard about it here. Can you explain a bit? It sounds interesting.

https://www.google.com/dfp

I think you can get a better picture there.
Title: Re: Google AdSense in SMF, various positions...
Post by: Imso on January 10, 2011, 12:40:15 PM
Didn't work
Title: Re: Google AdSense in SMF, various positions...
Post by: simonedifulvio on January 19, 2011, 06:08:51 AM
Hello everyone. thanks for the post!

I have a problem to add adsense after first post.

Not working and this error   www. cronoscalatestoriche.it/log/forum/index.php?topic=2.0

help? thank you very much

sorry for my english i'm italian


this is my code


// Show the member's signature?
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
echo '
<hr width="100%" size="1" class="hrcolor" />
<div class="signature">', $message['member']['signature'], '</div>';

echo '
</td>
</tr>
</table>
</td></tr>
</table>
</td></tr>';

   if ($message['id'] == $context['first_message'])
         echo'
         <div align="center">
   <script type="text/javascript"><!--
google_ad_client = "pub-0000000000";
/* 728x90, creato 05/01/11 */
google_ad_slot = "00000000";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>        </div>
         ';
}
Title: Re: Google AdSense in SMF, various positions...
Post by: azzuhro on June 23, 2011, 01:26:00 AM
_http://www.azzuhro-forum.tk

I successfully edit the theme

Display.template.php

echo '
<tr> <td style="padding: 0 0 1px 0;"> </ td> </ tr> <center> <script>
ADS HERE
</ table>
<a name="lastPost"> </ a> ';


example _http://www.azzuhro-forum.tk
Title: Re: Google AdSense in SMF, various positions...
Post by: sojmanie on September 08, 2011, 08:03:02 AM
I have tried everything ad manager as well as manually.Nothing seems to work .Is there something I am doing wrong??Please help!!!!!1
Title: Re: Google AdSense in SMF, various positions...
Post by: spikespiegel on October 01, 2011, 10:47:03 AM
I've been creating courage to register in this forum, you know, I was a little bored and too lazy to do that.

So let's go to the point, I made a modification in the code, I also tried to use the index code, but it broke my template, I didn't mind about it anyway, cause header ads takes too much space.

Here goes my modification in case if you want to display one ad after the first signature and another one right before the reply button (For curve Themplate - SMF 2.0.1):

Open the file Display.template.php.


Replace:
if ($message['id'] == $context['first_message'])

With:
if ($ad = ($message['id'] == $context['first_message']))

Right after add:
<div align="center">
        <script type="text/javascript"><!--
        google_ad_client = " AdsenseID";
        google_ad_width = 728;
        google_ad_height = 90;
        google_ad_format = "728x90_as";
        google_ad_type = "image";
        google_ad_channel =" ChannelID";
        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>
';









Right before // Show the page index... "Pages: [1]".
insert:
if ($ad)


{
echo '<!-- Blank -->';
} else {


echo '
<div align="center">
        <script type="text/javascript"><!--
        google_ad_client = " AdsenseID";
        google_ad_width = 728;
        google_ad_height = 90;
        google_ad_format = "728x90_as";
        google_ad_type = "image";
        google_ad_channel =" ChannelID";
        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>
';



}






Don't forget to change your Adsense ID and ChannelID, that should work just fine. You can see it working here: forum.mghospedagem.com


PS: I took the whole daybreak and part of the morning to figure out how to solve the issue that when a topic had only one message, it was showing two ads, now you can rest in peace, because if the topic has only one message, it'll only display one ad.


PS 2: SOooooooooooooooo sorry, there was a part missing, just fixed it.
Title: Re: Google AdSense in SMF, various positions...
Post by: lawnkhan on October 05, 2011, 07:51:05 PM
eai galera tem um  forum smf que está com mais de 100.000 membro ....gostaria de saber se isso seria um bug, virus ou coisa parecida ....

o forum está em

canallitoral.com.br/index.php

agradeço se alguém puder me dar uma dica de como colocar adsence , pois fui tentar e quase perdi tudo o forum

Valeu um salve aqui do BRAZIL  4YOU
Title: Re: Google AdSense in SMF, various positions...
Post by: spikespiegel on October 05, 2011, 09:45:46 PM
Quote from: lawnkhan on October 05, 2011, 07:51:05 PM
eai galera tem um  forum smf que está com mais de 100.000 membro ....gostaria de saber se isso seria um bug, virus ou coisa parecida ....

o forum está em

canallitoral.com.br/index.php

agradeço se alguém puder me dar uma dica de como colocar adsence , pois fui tentar e quase perdi tudo o forum

Valeu um salve aqui do BRAZIL  4YOU


Vc deu foi sorte de ter um brasileiro lendo sua mensagem, pq vc ta no fórum americano.

Fiz uma alteração do código deste topico, se quiser te ensino como instalá-la.


Isso se você não for um bot fazendo SPAM.
Title: Re: Google AdSense in SMF, various positions...
Post by: lawnkhan on October 05, 2011, 10:44:21 PM
Salve Brasil qblza ...meu gostaria sim de uma ajuda tenho ha um tempinho e nunca usei e ele ta chapado de membro americanos rssrs
o pior é que deve ser virus   .......tem mais de 110k de membros
ai eu gostaria de colocar adsense pra ver se funfa ..
vc é de onde???     eu sou de osasco , são sebastião São Paulo ....... valeu grande abraço..
Title: Re: Google AdSense in SMF, various positions...
Post by: spikespiegel on October 05, 2011, 11:53:17 PM
Quote from: lawnkhan on October 05, 2011, 10:44:21 PM
Salve Brasil qblza ...meu gostaria sim de uma ajuda tenho ha um tempinho e nunca usei e ele ta chapado de membro americanos rssrs
o pior é que deve ser virus   .......tem mais de 110k de membros
ai eu gostaria de colocar adsense pra ver se funfa ..
vc é de onde???     eu sou de osasco , são sebastião São Paulo ....... valeu grande abraço..

Goiânia, mg, goiania, por aí.
te mandar meu msn por mensagem pessoal.
Title: Re: Google AdSense in SMF, various positions...
Post by: fmiyar on August 01, 2012, 08:41:31 PM
thank.
it works now on my new forum website big family (mbahmarto-family[dot]com)
Title: Re: Google AdSense in SMF, various positions...
Post by: piranon on August 21, 2012, 10:12:51 AM
Thanks for your sharing.
Title: Re: Google AdSense in SMF, various positions...
Post by: bukharifaran on October 22, 2012, 02:44:06 PM
Hi,

I've tried to add the google ad code in first Post. Though my Display.template.php file code is bit different from the code which is provided by topic initiator, but I've successfully added the code with a little variation.

The area of Display.template.php file was mentioned by topic initiator had a different code, my code at that place was as follow:

// Show the member's signature?
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
echo '
<div class="signature" id="msg_', $message['id'], '_signature">', $message['member']['signature'], '</div>';

echo '
</div>
</div>
<span class="botslice"><span></span></span>
</div>
<hr class="post_separator" />';
}


I have added the code provided by topic initiator after replacing my adsense code after:

// Show the member's signature?
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
echo '
<div class="signature" id="msg_', $message['id'], '_signature">', $message['member']['signature'], '</div>';


So if anyone have different code in Display.template.php file and it matches with the code I've provided above, he can add his google ad code after above lines which I've mentioned.

Here you can see the result.
http://www.mobilefun.pk/forum/topic-9.0.html
Title: Re: Google AdSense in SMF, various positions...
Post by: bukharifaran on October 22, 2012, 06:17:31 PM
After adding the google code in First post of each topic as described by the topic initiator, I've also added the google ad code on the second place. Just below the Main menu as we have on SMF http://www.simplemachines.org/community/index.php

Topi initiator mention index.template.php file to edit. But he is using some different theme. Where as I am using default theme. By adding the code provided by topic initiator, it creates some table and other links along with google ad which looks bad.

Topic initiator give this line to search:
// The main content should go here. (Some more text was there in initial posts but that text is not in default theme.)

Topic initiator mention to add his provided code below above mentioned line.

But if you are using default template than right below this line, you will find this code:


echo '
<div id="content_section"><div class="frame">
<div id="main_content_section">';

// Custom banners and shoutboxes should be placed here, before the linktree.


I have added my Google code right after the second dive having id="main_content_section" and it works fine for me. You have to add like this:


echo '
<div id="content_section"><div class="frame">
<div id="main_content_section">

Your Google Ad code here
';

// Custom banners and shoutboxes should be placed here, before the linktree.


And it will work for you.

:)
Title: Re: Google AdSense in SMF, various positions...
Post by: Hj Ahmad Rasyid Hj Ismail on October 22, 2012, 07:47:30 PM
The OP was created long time ago bukharifaran. Don't expect the code will remain the same. :P
Title: Re: Google AdSense in SMF, various positions...
Post by: bukharifaran on October 23, 2012, 03:20:05 AM
Quote from: No More Mr Nice Sully on October 22, 2012, 07:47:30 PM
The OP was created long time ago bukharifaran. Don't expect the code will remain the same. :P

I know that there will be many users like me who are new and they might have the exact code that I have. So my post can help them in selecting a right place to insert the code.

When I ask from support how to add google ads, they told me to browse the TIPS and Tricks category. I open this and found this thread. And I see some posts where users are complaining that there code is different from the one provided in first post. That is why I posted the new code which I have.
Title: Re: Google AdSense in SMF, various positions...
Post by: Hj Ahmad Rasyid Hj Ismail on October 23, 2012, 03:47:21 AM
Sorry but IMO you were not reading the newer advices inside this topic and others. There are members who already given newer tips and tricks. Yours will later be similar to theirs when your post is hidden by various other post after yours.  :P
Title: Re: Google AdSense in SMF, various positions...
Post by: ryan_dwight on May 31, 2013, 04:24:04 PM
any updated code for this on black n black theme?

thanks
Title: Re: Google AdSense in SMF, various positions...
Post by: rajpbm on June 12, 2013, 04:04:36 PM
my all postiong seems to be good but still i am not getting good CTR on google adsense
now tell me what to do ?
my CTR rate still less then 1  :(
Title: Re: Google AdSense in SMF, various positions...
Post by: TheListener on June 12, 2013, 04:08:43 PM
Quote from: rajpbm on June 12, 2013, 04:04:36 PM
my all postiong seems to be good but still i am not getting good CTR on google adsense
now tell me what to do ?
my CTR rate still less then 1  :(

How old is your forum?
Title: Re: Google AdSense in SMF, various positions...
Post by: Techhub on July 09, 2013, 01:14:48 AM
Quote from: trenchteam 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
Title: Re: Google AdSense in SMF, various positions...
Post by: timeonthewater on March 13, 2016, 05:12:18 PM
Hi Is there anymore recent information about this topic. I have been trying to get Ad-sense working in my forums. Using 2.0.11. I have been trying to put the Google code in the ad management section as I would any other ad but I get a blank space.

Is there a more recent method?
Title: Re: Google AdSense in SMF, various positions...
Post by: timeonthewater on March 14, 2016, 06:53:21 AM
My ad management mod is SMFADS v2.3. If I paste the Google code in Add Ads the space in the thread where I want the ad is blank. Is there more to the script than what Google gives me?
Title: Re: Google AdSense in SMF, various positions...
Post by: shinglis on July 11, 2016, 12:55:50 AM
Quote from: timeonthewater on March 14, 2016, 06:53:21 AM
My ad management mod is SMFADS v2.3. If I paste the Google code in Add Ads the space in the thread where I want the ad is blank. Is there more to the script than what Google gives me?

I have a similar issue, but think it's because my site / ads are still under review and not been fully approved in the 2 stage approval process.
Title: Re: Google AdSense in SMF, various positions...
Post by: devpatel1 on December 20, 2016, 06:44:03 AM
Hey,

The second one not  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.
Title: Re: Google AdSense in SMF, various positions...
Post by: Nicolredmay on August 24, 2017, 03:52:27 AM
I would love to install adsense manually if i could be guided to the exact locations in the codes where they should be installed
Title: Re: Google AdSense in SMF, various positions...
Post by: Shambles on August 24, 2017, 04:13:09 AM
Quote from: Nicolredmay
I would love to install adsense manually if i could be guided to the exact locations in the codes where they should be installed

Seeing as you've copied, word for word, the request in this post (https://www.simplemachines.org/community/index.php?topic=335525.msg2250303#msg2250303), why not follow that thread through? Or better still, read post #1 of this topic.
Title: Re: Google AdSense in SMF, various positions...
Post by: superfnf on June 11, 2018, 02:19:52 PM
I have created a new forum superfnf dot com using simple machine. Now I want to add advertisement in different positions, didn't get any better solution.

Please help me
Title: Re: Google AdSense in SMF, various positions...
Post by: vbgamer45 on June 11, 2018, 02:40:14 PM
Check out my ad management mod https://custom.simplemachines.org/mods/index.php?mod=255