7
To display adsense code after the first news story
For Classic view, edit news/templates/news_index.html
Change the table from:
<table width='100%' border='0'>
<tr>
<{section name=i loop=$columns}>
<td width="<{$columnwidth}>%">
<{foreach item=story from=$columns[i]}>
<{include file="db:news_item.html" story=$story}>
<{/foreach}>
td>
<{/section}>
tr>
table>
to:
<table width='100%' border='0'>
<tr>
<{counter start=0 print=false assign=storycount}>
<{section name=i loop=$columns}>
<td width="<{$columnwidth}>%">
<{foreach item=story from=$columns[i]}>
<{include file="db:news_item.html" story=$story}>
<{if $storycount == 0}>
<script type="text/javascript">
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
script>
<{counter}>
<{/if}>
<{/foreach}>
td>
<{/section}>
tr>
table>
If you show News by Topic in your index you could display an ad after the first topic by editing news/templates/news_by_topic.html
Look around line 25 for the end of the loops:
div><br />
<{/foreach}>
td>
<{/section}>
and change it to:
div><br />
<{if $storycount == 0}>
<script type="text/javascript">
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
script>
<br /><br />
<{/if}>
<{counter start=0 print=false assign=storycount}>
<{counter}>
<{/foreach}>
td>
<{/section}>
This should work with all versions, but has only been tested on my local with XOOPS 2.2.4.
Good Luck!