Invision Board Adsense Integration

This modification will integrade adsense ads to the bottom of every topic in order to increase visibility of the advertisement and gain higher Click Through Rate.

Difficulty :
Very Easy

Files Affected :
/sources/Topics.php
/Skin/s*/skin_topic.php

Download : Adsense Integration Mod

Demo : Adsense Integration Demo


##########################
##
## Mod Title : IPB Adsense Integration
## Author: fred
## Website: www.qoolventure.com
## Email : frederick.goh [at] gmail.com
## Date: 15/Jan/05
## Invision version: 1.3 final
## What it adds: embed adsense add under every topic
## Mod version 1.0
## What it requires to be installed: nothing
##
## Files affected:
##
## /sources/Topics.php
## /Skin/s*/skin_topic.php
##
##########################

##########################
Open /sources/Topics.php
##########################

##########################
Find around line 675
##########################

//--------------------------------------------------------------

if ( ($post_count != 0 and $first == 0) or ($first > 0) )
{
$row['delete_button'] = $this->delete_button($row['pid'], $poster);
}

$row['edit_button'] = $this->edit_button($row['pid'], $poster, $row['post_date']);
$row['post_date'] = $std->get_date( $row['post_date'], 'LONG' );
$row['post_icon'] = $row['icon_id']
? "<img src='".$ibforums->vars['img_url']."/icon{$row['icon_id']}.gif' alt='' />&nbsp;&nbsp;"
: "";

$row['ip_address'] = $this->view_ip($row, $poster);

$row['report_link'] = (($ibforums->vars['disable_reportpost'] != 1) and ( $ibforums->member['id'] ))
? $this->html->report_link($row)
: "";

//--------------------------------------------------------------

##########################
Add above
##########################

//--------------Adsense Integration----------------------------

if($post_count == 0) {
$row['adsense'] = "<br /><script type=\"text/javascript\"><!-- \n\r";
$row['adsense'] .= "google_ad_client = \"xx\"; \n\r";
$row['adsense'] .= "google_ad_width = xx; \n\r";
$row['adsense'] .= "google_ad_height = xx; \n\r";
$row['adsense'] .= "google_ad_format = \"xx\"; \n\r";
$row['adsense'] .= "google_ad_channel =\"xx\"; \n\r";
$row['adsense'] .= "google_ad_type = \"xx\"; \n\r";
$row['adsense'] .= "google_color_border = \"xx\"; \n\r";
$row['adsense'] .= "google_color_bg = \"xx\"; \n\r";
$row['adsense'] .= "google_color_link = \"xx\"; \n\r";
$row['adsense'] .= "google_color_url = \"xx\"; \n\r";
$row['adsense'] .= "google_color_text = \"xx\"; \n\r";
$row['adsense'] .= "//--></script> \n\r";
$row['adsense'] .= "<script type=\"text/javascript\" \n\r";
$row['adsense'] .= " src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"> \n\r";
$row['adsense'] .= "</script> \n\r";
}
else
$row['adsense'] = "";

//--------------Adsense Integration----------------------------

##########################
Save, close, and upload!
##########################


##########################
Modify /Skin/s*/skin_topic.php via control panel
##########################

//
// Go into your Admin control panel and navigate to > skins & templates > HTML Templates >
// Topic View Section > Post Entry (Edit single)
//

##########################
Find
##########################

</table>
<div class='darkrow1' style='height:5px'><!-- --></div>

##########################
Add above
##########################

<tr>
<td colspan='2' bgcolor='#FFFFFF' align='center'>{$post['adsense']}</td>
</tr>

##########################
Save
##########################



[ Home ]
Frederick Goh '2005