Ever wanted to have Google Adsense within your forums threads, heres how.
Open: modules/Forums/viewtopic.php:
Find:
|
Code:
|
//
// 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:
|
Code:
|
for($i = 0; $i < $total_posts; $i++)
{ |
Under that code add:
|
Code:
|
if ($i=="0") {
$adblock = $adblocktext;
} else {
$adblock = "";
} |
Find on Line 1:
Next Line add:
|
Code:
|
$adblocktext = <<<EOM
<tr><td colspan=2 align=center>
Insert your Google AdSense Code Here
</td></tr>
EOM; |
Find:
|
Code:
|
$template->assign_block_vars('postrow', array(
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class, |
Next Line add:
|
Code:
|
'AD_BLOCK' => $adblock, |
Save and close.
Now go into the themes directory, and into the subdirectory of the theme you are using (i.e. themes/Your_Theme).
Open forums/viewtopic_body.tpl
Find:
Right above it, add the following:
Save the file, and you're done!
Now your forums will insert related Google Adsense adverts refering to the topic, after the first post.
As with Google Adsense codes, you can edit Colors to match your theme.
If you need a Google Adsense signup :
HERE
DEMO:
www.gamers-crib.com