Closed (fixed)
Project:
Affiliates
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 Nov 2006 at 21:03 UTC
Updated:
22 Apr 2009 at 19:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedPlease let me know what you have in mind , thanks
Comment #2
babruix commentedAlso for me, userpoints module integration didn`t work, so i looked at code...
but userpoints module need array as params, so i changed this code to:
And its work for me!
Comment #3
Anonymous (not verified) commentedThanks for your help Babruix!
Ill try out the userpoints module and your patch later today.
Best, Paul
Comment #4
kbahey commentedActually, it is much better to add a hook to affiliates.
This means that when someone accrues points we do the following:
Then we can have modules act on that event whichever way we want.
So, we have a module called userpoints_affiliates.module, and in it we have:
The module can have a multiplier for points, or a fixed number of points for each point, or anything you want.
The possibilities are endless this way. So let us add a hook regardless.
As a separate topic, we can have userpoints be the underlying mechanism for storing points for affiliates as well, and the module would have a dependency on userpoints. This makes the database simpler, but adds some complexity.
Comment #5
fred0 commentedI agree with kbahey regarding hook, but I have been looking over the module's functionality and debating with myself regarding the idea of moving points to be dependent on userpoints. On the one hand, having a singular points system would be cleaner. On the other hand, categorization becomes more of an issue when trying to pull top affiliates data for blocks and pages. I am still thinking about it and may try to tackle it in the near future but, for now, I needed userpoints integration in its current form for Drupal 6 and the fix in #2 isn't proper (as kbahey suggests) as the $params line is in the older userpoints v2 api format.
Until I or someone else tackles a re-vamp of the points system overall, here is a patch that fixes userpoints for the v3 api and adds taxonomy categorization for the userpoints. I removed the point value field in the userpoints settings as it wasn't doing anything currently (it could be used as a multiplier, but I decided to hold off on that right now).
Also, I found some other problems in the code in general that this patch fixes:
First, the storage directory for the images was defined as /images/affiliates and that was causing errors since images isn't a default directory created by Drupal. I changed it to just be /affiliates so that it would be created in the directory defined in the Site Configuration>File System.
Second, there was a TRUE value mis-typed as TRE.
Third, the More button in the Top Affiliates block was failing if Drupal was installed in a subdirectory. I removed the leading / for the link and that cleared it up.
Comment #6
fred0 commentedNote that in addition to the .module patch in my previous post #5, there is a matching patch for the .install file I posted here: http://drupal.org/node/340053#comment-1173909
Comment #7
fred0 commentedHmm.. had another thought. I decided to keep the userpoints values code in the module, but just comment it out so that it doesn't get lost and could be activated later on or if someone should want to use it as a modifier.
Also added text and link to the taxonomy category description that explains that points are set in the Affiliates admin section on a per button basis and fixed the fieldset title display.
Oh, one other thing to note is that while the Affiliates module has click fraud prevention based on ip address in a given period, the userpoints function does not. It is possible to repeatedly click on a button and rack up userpoints. I'll look at fixing that tomorrow after getting some sleep.
Comment #8
fred0 commentedGot it! The attached patch supercedes my previous 2. It adds click fraud protection to userpoints and tweaks the add button interface (specifically changes the required flag for the redirect URL since the redirect function will go to homepage if not specified and adds some text to better explain the OR option of upload image and image url).
I think I'm done for now...
Oh, btw, Paul or kbahey: all the module files are missing the $id: info.
Comment #9
fred0 commentedI lied. Just discovered that the permissions settings were not fully functional. Only administer affiliates was being used. I added affiliate click to the point logging function so that one can control whose clicks get logged. I left the original perms line in for reference and commented it out.
Again, this patch supercedes all my previous posts.
Comment #10
fred0 commentedMore fixes...
-Re-fix More button URL from post #5
-Fix URL for userpoints category link to affiliates/admin
My head hurts now.
Comment #11
kbahey commentedCommitted to 6.x-1.x-dev.
I had to change a variable name, and define it at the top.
Thank you.
Comment #12
fred0 commentedIn the commit to the dev version, line 23 where the new variable is defined ends with a , when it should be a ;
Comment #13
kbahey commentedThanks.
Fixed.
Comment #14
fred0 commentedWith the Jan 9, 2009 6.x-1.0 release of Userpoints, the hook_userpoints function call changed. Here is patch to update for compatibility.
Comment #15
kbahey commentedCommitted.
Released in 6.x-1.2
Comment #17
jusyjim commentedHas anyone figured out points integration for the 5.x version?