Back to Modification Graveyard

CMS Article - Google Adsense share for each publishers
Mod Version: 1.00, by killer_t

This thread is in the Modification Graveyard.
vB Version: 4.1.6 Rating: (0 vote - 0 average) Installs: 0
Released: 20 Sep 2011 Last Update: Never Downloads:
Not Supported  

Hi at all, to first sorry for my bad English!

This mod is a combination between some mod that I found in this forum, with the help of some people, especially from Dead Eddie.

What is it? It enables publishers to place your advertising in their articles.

Why? because it would encourage them to write better articles, with each click to their article, they will earn $.

Ok let's start!

1- You need to create (only number) a extra field in user profile via admin panel.

Code:
admincp > User Profile Fields > Add New User Profile Field 
Select Single-Line Text Box
Title -  Google Adsense
Description - Put Your Adsense Code here Only Numbers.
Max length of allowed user input - 16
Field Length - 25
Field Required - No
Field Editable by User - Yes
Private Field - No
Field Searchable on Members List - No	
Show on Members List - No
Regular Expression -  ^[0-9]{16}$
Display Page - Edit Profile
2 - Write down the name of the field ( my is field10 ) and change all fieldx in below code with your field name.

3 - Edit the vbcms_content_article_page template, and insert this code where you want to display advertising:

Code:
<div class="adv">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-{vb:raw fieldx}";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "flash_image";
google_ad_channel = "1840127099_1447974476";
google_color_border = "E1E1E1";
google_color_bg = "E1E1E1";
google_color_link = "FFFFFF";
google_color_text = "FFFFFF";
google_color_url = "FFFFFF";
google_ui_features = "rc:0";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
</div>
4 - Edit vbcms_article_populate_end plugin ( Admincp > Plugins & Product > Plugin Manager), and add this code at the end:

PHP Code:
if(self::VIEW_PAGE == $viewtype){
$field vB::$vbulletin->db->query_first('SELECT fieldx FROM ' TABLE_PREFIX ' userfield AS userfield WHERE userid = ' $view->authorid);

$view->fieldx $field['fieldx'];

The End.
Now you (and your publishers) can add Google Adsense Code in profile field.
You can Add (max3 for Google adsense terms) Advertising module in the vbcms_content_article_page.


Google adsense terms not allowed to use different adsense code in same page. So please careful if you have different Adsense code in your header/footer.

Download

No files for download.

Similar Mods

Mini Mods earnmoneyworld.com google adsense Revenue Share | 100% revenue share with members vBulletin 4.x Template Modifications

vblts.ru supports vBulletin®, 2022-2024