วันพฤหัสบดีที่ 23 สิงหาคม พ.ศ. 2550

How to add Adsense Code in SMF


Hi everybody,

The article "How to add Adsense Code in SMF by Code" 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:


<body>';
// The logo, user information, news, and menu.echo ' ......

Note the HTML just below that:




<table cellspacing="0" cellpadding="0" border="0" align="center" width="95%" class="tborder>"

It is a table to show logo, user information and menu. Now find following line:

$context['current_time'], '

Finally, insert a new table row and paste Adsense Code there.

<tr><td colspan="2" valign="middle" align="center" class="tborder" style="border-width: 1px 0 0 0; font-size: smaller;">

// Insert your google adsense here

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

</table>';
// 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">

// Insert your google adsense here

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


Now the Ads will be displayed both below the header and above the footer section of the webpages.

Goodluck.

ไม่มีความคิดเห็น: