EDIT VIEWTOPIC.PHP
In viewtopic.php in the main phpBB directory, at around line 826, you'll find:
Kód:
//
// Okay, let's do the loop, yeah come on baby let's do the loop
// and it goes like this ...
//
Right under that is the statement that begins the looping through the posts:
Kód:
for($i = 0; $i < $total_posts; $i++)
{
Under that I added...
Kód:
if ($i=="0") {
$adblock = $adblocktext;
} else {
$adblock = "";
}
Up near the beginning of the file, I defined the new variable $adblocktext thusly:
Kód:
$adblocktext = <<<EOM
<tr><td colspan=2 align=center>
Insert your Google AdSense Code Here
</td></tr>
<tr><td class="spaceRow" colspan="2" height="1"><img
src="templates/subSilver/images/spacer.gif"
alt="" width="1" height="1" /></td>
</tr>
EOM;
The table structure here is important. The first block puts in your Google AdSense code. The second block is a separator line.
Now, scroll down to the line 1170'ish range of the file and you'll find a block of variable declarations that begins with:
Kód:
$template->assign_block_vars('postrow', array(
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class,
In that block, on its own line, add:
Kód:
'AD_BLOCK' => $adblock,
Save that file.
EDIT VIEWTOPIC_BODY.TPL
Now go into the templates directory, and into the subdirectory of the template you are using (i.e. subSilver). Open the file viewtopic_body.tpl for editing.
Down around line 61, you'll find a line that says:
Kód:
<!-- END postrow -->
Right above it, add the following text...
Kód:
{postrow.AD_BLOCK}
Save the file, and you're done!
Now your forums will insert whatever you wish after the first post. And yes, you can insert Javascript. I tried the following...
Kód:
$adblocktext = <<<EOM
<tr><td colspan=2 align=center>
Insert Google Code Here <P>
<script language=javascript>
document.write("hoobastank");
</script>
</td></tr>
<tr><td class="spaceRow" colspan="2" height="1"><img
src="templates/subSilver/images/spacer.gif" alt="" width="1"
height="1" /></td>
</tr>
EOM;
and it worked just fine.
//neskusal som to ale, takychto uprav je velmi vela, staci hladat google.com, phpbbhacks.com etc..