Tiếp theo bài viết về Social Bookmark Invision, bài viết này tớ sẽ chia sẻ với các bạn Mod quản lý Google Adsense cho Invision với tỷ lệ click cao nhất có thể và khả năng tùy biến cao. Mod này được sửa từ Google Ads của Vandim88, do không liên lạc được với tác giả nên tớ theo qui định GPL mà cải tiến và chia sẻ lại với cộng đồng.
Bản nâng cấp cho phép bạn tùy biến định dạng format cho từng vị trí riêng như thế trình bày trang đẹp hơn mà lại hiệu quả hơn nhiều và đương nhiên lợi nhuận cao hơn.
Description Invision Google Adsense
With this mod u could set up an ad to be displayed in different positions in the board or in a topic. The multi format of ads would be displayed between the first and second post, after the first post, in the header or footer of board. A new addition is the group permission so u could set the groups who would avoid seeing ads. You can custumize you setting through board admin.
Google Ads Invision Mod
With this mod you would be able to show differents formats of google ads in 5 different places across the board.
Inside Topics After the first post on every page
Inside Forums At The top
Inside Forums At The Bottom
On the board index Page at the top
On the board index Page at the Bottom
Download
Download Topic Ads – Invision IPB Google Adsense Manager Mod
[download=4]
Files Affected
sources/classes/class_display.php (1 Edit)
sources/action_public/forums.php (2 Edit)
sources/lib/func_topic_linear.php (1 Edit)
1 Template Bit Changed
1 Template Bit Added
Requirements
This mod was designed to be installed using the Universal Mod Installer, available from IPSBeyond or Invision Modding
Files Uploaded:
mod_install/googleads.xml To mod_install/
IPB Versions:
IPB 2.2 / 2.2.1
Support
Support will be provided at Bulletin-Board quang ba Web.
Change Log
1.1.0 – Add customized format for different places
1.0.0 – Initial Release (Vandim88)
Install Mod Invision Adsense Manager
Running The Installers
Using the Universall Mod Installer After Uploading the googleads.xml To the Mod_install Directory then run the installation script from the ACP -> COMPONENTS -> Universall Mod Installer
Open: sources/classes/class_display.php
Find:
$this->ipsclass->skin['_wrapper'] = str_replace( "<% CSS %>" , $css , $this->ipsclass->skin['_wrapper']);
Add Above:
if($this->ipsclass->vars['google_ads_header'])
{
if (preg_match("/(^|,)".$this->ipsclass->member['mgroup']."(,|$)/", $this->ipsclass->vars['google_view_groups']))
{
$adt = $this->ipsclass->compiled_templates['skin_global']->ga_header();
$this->ipsclass->skin['_wrapper'] = str_replace( "" , $adt , $this->ipsclass->skin['_wrapper']);
}
}
if($this->ipsclass->vars['google_ads_footer'])
{
if (preg_match("/(^|,)".$this->ipsclass->member['mgroup']."(,|$)/", $this->ipsclass->vars['google_view_groups']))
{
$adb = $this->ipsclass->compiled_templates['skin_global']->ga_footer();
$this->ipsclass->skin['_wrapper'] = str_replace( "" , $adb , $this->ipsclass->skin['_wrapper']);
}
}
Save & Upload.
Open: sources/action_public/forums.php
Find:
//-----------------------------------------
// Start printing the page
//-----------------------------------------
Add Above:
//-----------------------------------------
// Show google ads by vadim88
//-----------------------------------------
if($this->ipsclass->vars['google_ads_forums'])
{
if (preg_match("/(^|,)".$this->ipsclass->member['mgroup']."(,|$)/", $this->ipsclass->vars['google_view_groups']))
{
$this->output .= $this->ipsclass->compiled_templates['skin_global']->google_ads();
}
}
Find:
//-----------------------------------------
// Multi-moderation?
//-----------------------------------------
Add Above:
//-----------------------------------------
// Show Google ads by vadim88
//-----------------------------------------
if($this->ipsclass->vars['google_ads_forums_bottom'])
{
if (preg_match("/(^|,)".$this->ipsclass->member['mgroup']."(,|$)/", $this->ipsclass->vars['google_view_groups']))
{
$this->output .= $this->ipsclass->compiled_templates['skin_global']->google_ads();
}
}
Save & Upload.
Open: sources/lib/func_topic_linear.php
Find:
}
//-----------------------------------------
// Print the footer
//-----------------------------------------
Add Above:
if($this->ipsclass->vars['google_ads_topics'])
{
if (preg_match("/(^|,)".$this->ipsclass->member['mgroup']."(,|$)/", $this->ipsclass->vars['google_view_groups']))
{
$this->post_count++;
if ($this->post_count == 1)
{
$ad = array (
'name_css' => 'normalname',
'post_css' => ($post_count % 2 ? 'post1' : 'post2'),
'pid' => '0',
'post' => $this->ipsclass->compiled_templates['skin_global']->google_ads(),
);
$bot_poster = array (
'_members_display_name' => 'Googlebot',
'avatar' => '

',
);
$this->post_count++;
$ad['post_date'] = $row['post_date'];
$this->output .= $this->ipsclass->compiled_templates['skin_topic']->RenderRow( $ad, $bot_poster );
}
}
}
Save & Upload.
Goto ACP -> LOOK & FEEL -> Edit Template HTML -> Edit Board Header & Footer Wrapper
Find:
< % MEMBER BAR %>
OR
< % NAVIGATION %>
Add Below:
Find:
< % BOARD %>
Add Below:
Save & Upload.
Configuration Invison Topic Ads
After installation is done, and you have edited the files required it is importent that you go to ACP -> TOOLS & SETTINGS -> Google Ads and configure the settings there to your needs.
Also to change the Google Ad Please Goto: ACP -> LOOK & FEEL -> Edit Template HTML -> ALL Global HTML -> Google_ads, change the google ad to yours.