PDA

View Full Version : Adsense revenue share 0.2



wecan
04-09-2010, 08:30 PM
Adsense revenue share
Version: 0.2
Author: wecan & ties
Created: 2010/04/09
Last Updated: 2010/06/03
Tested on: Hotaru 1.1.4 ~ 1.3.0
Plugins Required: None
Plug & Play: No - needs template edit
Supported: Yes, you can try to ask :)

Description
Show adsense code with the admin pub id or the user pub id. So profit made by ads in the posts of one user is split between the admin/site and the user.

Features

Add formfield in the user settings page for the pub id
Add formfield in the admin settings page for the pub id and for the percentage of user pub id
Add formfield in the admin settings page to admit to share adsense width the user only after x news posted
Save settings smile and money sack in the admin page :D


Instructions
1. Upload the "ads_rev" folder to your plugins folder.
2. Install it from Plugin Management in Admin.
3. Configure Adsense Revenue Share in Admin -> Plugin Settings -> Ads revenue share
4. Copy this PHP code and paste where you want in sb_post.php (your theme folder). You can modify these parameters, of course.
<?php
$h->pluginHook('displayAdd','',array(
'google_ad_width' => 468,
'google_ad_height' => 60,
'google_ad_format' => "468x60_as",
'google_ad_type' => "text_image",
'google_color_border' => "336699",
'google_color_bg' => "0000FF",
'google_color_link' => "FFFFFF",
'google_color_text' => "000000",
'google_color_url' => "008000",
'google_ui_features' => "rc:0"
));
//note: not all fields are required, go to www.adsense-generator.com/ to see which things you need
//note2: google_ad_client will be overwritten by the script
?> If there is a feature you would like to see please let me know and I'll do my best to get it implemented. If you have any other questions feel free to ask! I'm waiting for your comments and remember to rate this thread ;)

Revision History
v.0.2 2010/04/10 - wecan / ties - Released first public version

williamd
04-09-2010, 09:46 PM
Looks great!

ties
04-10-2010, 11:06 AM
Do only use this code on SbBase post!
Because this plugin uses the post author to (possibly) share revenue and there is a limit of the number of adds to be displayed.

For other locations just use the regular code.
For the sidebar, use a textwidget and paste in your regular code.

Nick
05-09-2010, 11:29 AM
Thanks again for this. We're using it on BloggerTools.net (http://bloggertools.net) :)

wecan
05-09-2010, 02:52 PM
Thanks again for this. We're using it on BloggerTools.net (http://bloggertools.net) :)
As soon as I have a bit of time I will do the next version... I will call Adsense Revolution Manager, with a lot of new features ;)
I would work more for the Hotaru project, a very good project, if I had more time ;)

seekyt
09-16-2010, 06:11 PM
I have a quick question - since this no longer applies to sb_post (bookmarking is the new plugin), can we still not use the code in the sidebar?

I am very familiar with the AdSense revenue sharing api and the TOS involved with AdSense, and I know one thing for certain is that you can only have one publisher's ads showing per page. This means if I have my own ads in the sidebar, I would have to disable the sidebar on post pages if I wanted to use the revenue sharing plugin.

So, with that in mind, if I use the code above (modified of course for appearance purposes) in the sidebar, will the plugin not recognize the page and apply the user's publisher ID to sidebar ads?

Thanks!

petsagouris
12-09-2010, 02:51 PM
wecan any news about the "Adsense Revolution Manager"?

seekyt
03-19-2012, 07:02 PM
There is an annoying error with this plugin that I can't wrap my head around, and I'm wondering if anyone has fixed it. When the user inserts their ID into their user Settings, the field reverts to blank after being saved, and takes a bunch of refreshes to show up. If the user changes their ID due to a Typo, the old ID starts to show up again in its place until you refresh a few times. This leads to users worrying whether or not their AdSense ID has been saved.

Does anyone see an error in the code that is causing this? I sure can't find it or figure out why.

nothingman
05-08-2013, 02:16 PM
Has anyone tested and got this working with the current version (v1.5.0 beta)? Where should the following snippet of code be added as sb_post.php isn't there anymore)?


<?php
$h->pluginHook('displayAdd','',array(
'google_ad_width' => 468,
'google_ad_height' => 60,
'google_ad_format' => "468x60_as",
'google_ad_type' => "text_image",
'google_color_border' => "336699",
'google_color_bg' => "0000FF",
'google_color_link' => "FFFFFF",
'google_color_text' => "000000",
'google_color_url' => "008000",
'google_ui_features' => "rc:0"
));
//note: not all fields are required, go to www.adsense-generator.com/ to see which things you need
//note2: google_ad_client will be overwritten by the script
?>

shibuya246
05-08-2013, 02:23 PM
Has anyone tested and got this working with the current version (v1.5.0 beta)? Where should the following snippet of code be added as sb_post.php isn't there anymore)?


<?php
$h->pluginHook('displayAdd','',array(
'google_ad_width' => 468,
'google_ad_height' => 60,
'google_ad_format' => "468x60_as",
'google_ad_type' => "text_image",
'google_color_border' => "336699",
'google_color_bg' => "0000FF",
'google_color_link' => "FFFFFF",
'google_color_text' => "000000",
'google_color_url' => "008000",
'google_ui_features' => "rc:0"
));
//note: not all fields are required, go to www.adsense-generator.com/ to see which things you need
//note2: google_ad_client will be overwritten by the script
?>

sb_post is part of the sb plugin which was deprecated a long time ago and replaced with the bookmarking plugin
http://forums.hotarucms.org/showthread.php?332-SB-Base-1-1

You can try the bookmarking_post.php file in templates folder of bookmarking plugin instead

nothingman
05-08-2013, 03:47 PM
sb_post is part of the sb plugin which was deprecated a long time ago and replaced with the bookmarking plugin
http://forums.hotarucms.org/showthread.php?332-SB-Base-1-1

You can try the bookmarking_post.php file in templates folder of bookmarking plugin instead

Thanks Shibuya. I tried that but it looks like it's not configurable as Ads revenue share is not clickable in Admin -> Plugin Settings -> Ads revenue share.

BTW, I posted the code in bookmarking_post.php around line 89.


<?php if ($h->vars['use_content']) { ?>
<div class="show_post_content">
<?php echo nl2br($h->post->content); ?>
<?php $h->pluginHook('show_post_content_post'); ?>
</div>
<?php } ?>
<?php
$h->pluginHook('displayAdd','',array(
'google_ad_width' => 468,
'google_ad_height' => 60,
'google_ad_format' => "468x60_as",
'google_ad_type' => "text_image",
'google_color_border' => "336699",
'google_color_bg' => "0000FF",
'google_color_link' => "FFFFFF",
'google_color_text' => "000000",
'google_color_url' => "008000",
'google_ui_features' => "rc:0"
));
//note: not all fields are required, go to www.adsense-generator.com/ to see which things you need
//note2: google_ad_client will be overwritten by the script
?>

nothingman
05-08-2013, 03:55 PM
Thanks Shibuya. I tried that but it looks like it's not configurable as Ads revenue share is not clickable in Admin -> Plugin Settings -> Ads revenue share.

Aha! Went to ads_rev_settings.php and noticed that we can access the settings by accessing it like this:

http://www.mysitename.com/admin_index.php?page=plugin_settings&plugin=ads_rev