• Welcome to Simple Machines Community Forum. Please login or sign up.

Advice: Another How-to Place for Adsense (Above 'unread posts')

Started by Aes-Sedai, April 17, 2007, 08:04:55 PM

Previous topic - Next topic

Aes-Sedai

Some users, as always might not want to exactly see the ads Adsense displays, and will never click on them either.

This will put the Adsense code above the place where it says 'show unread posts since last visit' etc. Which also, for us newbies, is a collapsable area where everyone can just collapse the area when they don't want to see ads.

To give them this choice, go to index.template.php:

Find:

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

Add After:
// Begin Adsense on Index.
echo '
<table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;" class="">
<tr>

<td valign="top" width="100%" height="100%">
<div style="overflow: auto; width: 100%;" align="center">

[color=purple]Adsense Code[/color]

</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
</div>
</tr>
</table>
';

// End of Adsense on Index.


It's the same HTML layout for Adsense that Nite0859 used, just in a different place where users can collapse it. Most credit to Nite0859 and his thread: http://www.simplemachines.org/community/index.php?action=post;topic=153647.15;num_replies=22, all I did was put it in a different place.

Advertisement: