Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Aiheen aloitti: CommunityZ - helmikuu 21, 2005, 03:56:31 AP

Otsikko: Add google adsense
Kirjoitti: CommunityZ - helmikuu 21, 2005, 03:56:31 AP
<script type="text/javascript"><!--
google_ad_client = "pub-0258112475836059";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_channel ="";
google_color_border = "336699";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "008000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>


Where should i add it?
my site is www.everythingtalk.com using default theme.
Thank you for your help.
Otsikko: Re: Add google adsense
Kirjoitti: A.M.A - helmikuu 21, 2005, 04:13:40 AP
It depends on where exactly you need it to appear .. if you want it to appear below the menu forum for example, you have to add it to index.template.php right after echo '
template_menu();

echo '
</div>';
Otsikko: Re: Add google adsense
Kirjoitti: CommunityZ - helmikuu 21, 2005, 07:28:46 AP
I see put it after ECHO
No wonder it didn't work for me just now I put it after DIV
Thank you.

Where to put if i want to put the code at the bottom before Info Center?
If it possible to add this code after the post and only viewable(google ads) by visitors like what vB doing ? (this is not neccessary, just asking) :) Thank you.
Otsikko: Re: Add google adsense
Kirjoitti: A.M.A - helmikuu 21, 2005, 08:16:04 AP
Lainaus käyttäjältä: CommunityZ - helmikuu 21, 2005, 07:28:46 AP
If it possible to add this code after the post and only viewable(google ads) by visitors like what vB doing ? (this is not neccessary, just asking) :) Thank you.

in Display.template.php look for:
echo '<img src="', $settings['images_url'], '/blank.gif" alt="" id="fetchSessionTemp" />';
add before it:
if ($context['user']['is_guest'])
echo '
<div align=center>
<script type="text/javascript"><!--
google_ad_client = "pub-0258112475836059";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_channel ="";
google_color_border = "336699";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "008000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>';


Lainaus käyttäjältä: CommunityZ - helmikuu 21, 2005, 07:28:46 AP
Where to put if i want to put the code at the bottom before Info Center?
in BoardIndex.template.php look for:
// Here's where the "Info Center" starts...
echo '
and put the code after echo '
Otsikko: Re: Add google adsense
Kirjoitti: CommunityZ - helmikuu 21, 2005, 09:21:26 IP
Thank you all working now.
Otsikko: Re: Add google adsense
Kirjoitti: Enigma - helmikuu 22, 2005, 04:03:11 IP
thanks for your help. i needed this info too.