The thread "How to add Adsense Code in SMF" may not be helpful for experienced web-publishers who have already nurtured Simple Machines Forum a lot, but I think, it will be helpful for anyone who has installed Simple Machines Forum recently and who is considering to install Adsense Code in Simple Machines Forum ( SMF).
Here are the steps to show Ads just below the header section.
First of all, locate the file index.template.php.
Now goto the following section:
// The logo, user information, news, and menu.
echo '
......
Note the HTML just below that:
It is a table to show logo, user information and menu.
Now find following line:
</td>
</tr>
Finally, insert a new table row and paste Adsense Code there.
<td colspan="2" valign="middle" align="center" class="tborder" style="border-width: 1px 0 0 0; font-size: smaller;">
<script type="text/javascript"><!--
google_ad_client = "YOUR PUBLISHER ACCOUNT ID";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="3949701292";
google_color_border = "336699";
google_color_bg = "FFFFFF";
google_color_link = "0066CC";
google_color_url = "006699";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
</tr>
This will show Adsense Ads just below the header section.
To show Adsense Ads at the bottom of the webpages (above the footer section):
Locate the following lines in the same file i.e. index.template.php
// Don't show a login box, just a break.
else
echo '
<br />';
Below that line Type the following code:
echo '
<table cellspacing="0" cellpadding="3" border="0" align="center" width="95%" class="tborder">
<tr>
<td align="center">
<script type="text/javascript"><!--
google_ad_client = "YOUR PUBLISHER ACCOUNT ID";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="3949701292";
google_color_border = "336699";
google_color_bg = "FFFFFF";
google_color_link = "0066CC";
google_color_url = "006699";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
</tr>
</table>';
Now the Ads will be displayed both below the header and above the footer section of the webpages.
Regards,
Sid

