I am glad to see this feature in adsense.module. It is very helpful for me. Anyway, I decided to run 4.7.x so I generated a patch from your code for 4.6.x. The patch generated 3 rejected hunks that all hunks were easily fixed. This is the result of patching final code against cvs.

There was a bug that ads would be disabled if $author_client was empty and $percentage was 100. I have fixed it by below patch.

--- adsense.module.orig 2006-01-08 04:04:42.000000000 +0700
+++ adsense.module      2006-01-08 03:54:18.000000000 +0700
@@ -868,7 +868,7 @@
 
 function _adsense_choose_client($site_client, $author_client) {
   $percentage = variable_get(ADSENSE_PERCENTAGE, 0);
-  if (!$percentage) {
+  if (!$percentage || !$author_client) {
     return $site_client;
   }

This patch has been included in the attachment.

CommentFileSizeAuthor
adsense.module_revenue.patch11.51 KBsugree

Comments

RobRoy’s picture

I'm looking to use revenue sharing in 4.7.0. If I apply this patch to HEAD will I be golden? Or, is there another one I need?

kbahey’s picture

Just use the 4.7 version of Adsense module. It has all the features now.

nullify’s picture

Category: feature » support

I'm using the v4.7 of the adsense module, I also wish to use revenue sharing that is built into the adsense module. Unfortunately this relies on the User Referral module (referral.module) which is not compatible with Drupal 4.7. So the revenue sharing in the adsense 4.7 module doesn't work. Is there a solution that I am missing?

Any help greatly appreciated.

kbahey’s picture

The user referral module is not needed for revenue sharing to work.

nullify’s picture

If the referral module is not needed, why does the adsense 4.7 module say this in admin|settings|adsense|revenue sharing:

[x] Enable Revenue Sharing
"... The referral feature requires the referral module to be installed."

The text is next to the "enable revenue sharing" checkbox so it reads as if the referral module is required if you want to enable that option. But maybe it is talking about one (or both) of percentage splits that can be configured, it's not intuitive if that's the case. Can you shed some light on this please?

One more question please, how would the following option work without the referral module: "Percentage of node views going to user who referred the author." Does adsense 4.7 handle referral signups now, if so what would be the URL to use for referring new users, and is there any way to see who referred who (like there was with the referral module.)

kbahey’s picture

It says the "referral feature", not the "revenue sharing". In other words it is an option add on to revenue sharing.

I have not ported the referral module to 4.7 yet, and there is no time frame for that, until some client is willing to sponsor that effort.

Meanwhile, just use normal revenue sharing in 4.7.

nullify’s picture

Thanks for your time Khalid, I understand now.

I walked through the code which answered a couple more questions that I had.

I'd like to offer some ui feedback: move the text saying "requires the referral module to be installed" down to the referral percentage combo box that it relates too. That way the user is in no doubt that it relates to that option without having to understand the terms.

Many thanks.

kbahey’s picture

Status: Needs review » Closed (fixed)

So, is revenue sharing working for you now? If not, then re-open this issue again, I am closing it.

As for the UI change, can you please open another issue against "User Interface" as the component, and attach a patch if you know how to make one and have the time to do it. Otherwise, the before and after text should be fine.