Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Hi I was wondering if someone could please tell me what I change in the module file so that points go to the user who made the story instead of the user who voted. Im quite sure its simple just changing from user to node... look forward to peoples thoughts.
Cheers
Comment | File | Size | Author |
---|---|---|---|
#16 | userpoints_votingapi-317585.patch | 11.31 KB | Gekiboy |
#15 | userpoints_votingapi-317585.patch | 11.34 KB | Gekiboy |
#14 | userpoints_votingapi.module.patch | 10.9 KB | Gekiboy |
#11 | userpoints_votingapi4author.diff | 3.26 KB | mr.alinaki |
Comments
Comment #1
Chill35 CreditAttribution: Chill35 commentedPoints are given to the content, not to the person who voted.
Comment #2
Chill35 CreditAttribution: Chill35 commentedIf you want to know how much points have been given to all content authored by the same user x, then that is the question you must ask.
Comment #3
clint-jb CreditAttribution: clint-jb commentedNo I understand that points are given to the content... I want to keep it this way, I have it currently linked in with User Points though and it is allocating a point to each user individually who votes instead of giving each one of those votes to the author who made the node.
Cheers
Comment #4
Chill35 CreditAttribution: Chill35 commentedThen you'll have to check in with the User Points module.
Comment #5
jredding CreditAttribution: jredding commentedreclassifying again, Currently the userpoints voting api module gives a point to the "VOTER" and not to the "AUTHOR" of the node that is being voted upon (of course isn't this what the voting API does?).
Anyhow if this feature is still requested this is the place for it to be done.
Comment #6
jhedstromSubscribing. I have an upcoming project that will need this feature, so I'll be creating a patch if nobody beats me to it.
Comment #7
oradoe CreditAttribution: oradoe commentedIf you want to increase points of AUTHORs than VOTERs, then insert this function
function userpoints_votingapi_author($entity_type, $entity_id) {
$entity_id_name = $entity_type[0]."id";
$entity_type .= ($entity_type == "node")? "": "s";
$uid = db_result(db_query("SELECT uid FROM {%s} WHERE %s = %d", $entity_type, $entity_id_name, $entity_id));
return $uid;
}
and then this statement in both userpoints_votingapi_votingapi_insert() and userpoints_votingapi_votingapi_delete(), right before the first if statement
$vote['uid']=userpoints_votingapi_author($vote['content_type'], $vote['content_id']);
Frankly, I can rewrite the whole .module file to keep it clean and induplicate, but I have trouble in how to contribute and/or update/commit this module.
Best regards.
Comment #8
oradoe CreditAttribution: oradoe commentedfeel free to contact me at truongsinh.tran@vsaf.org
Comment #9
cardentey CreditAttribution: cardentey commentedSubscribing
Comment #10
nirad CreditAttribution: nirad commentedthe same issue is being worked on separately here: http://drupal.org/node/367005
Comment #11
mr.alinaki CreditAttribution: mr.alinaki commentedI've tried to modify userpoints_votingapi.module to give points to author and voter separately.
Comment #12
walker2238 CreditAttribution: walker2238 commentedSubscribe
Comment #13
mr.alinaki CreditAttribution: mr.alinaki commentedComment #14
Gekiboy CreditAttribution: Gekiboy commentedAn implementation I did myself which I would like to submit. This leaves the points to voters intact but at the same time provides a method to give positive or negative points to users based on how people voted on their content (negative votes can give a negative score). Also, deleted votes will nullify any points they assigned to the author.
Comment #15
Gekiboy CreditAttribution: Gekiboy commentedAn update to my implementation. If stops users from getting points from voting on their own content.
Comment #16
Gekiboy CreditAttribution: Gekiboy commentedTweaked the patch to work with the latest version of the userpoints_votingapi module.
Comment #17
Neil Adair CreditAttribution: Neil Adair commented+1
This patch applied cleanly to userpoints_votingapi-6.x-1.x-dev.tar.gz
Works well! Gives the user points to the author of the node. It accepts authors vote on his own node, but it is not included in the authors points.
Thanks for this patch! It does exactly what I was looking for.
Comment #18
entrepreneur27 CreditAttribution: entrepreneur27 commentedI would really like to use this feature, and I see from post #17 that the patch works. However I am not sure how to apply this patch. I would prefer to be using it in a module that someone has blessed.
Are there plans for this to be in the next release and if so when might that be?
If I want to use this patch myself, how would I go about doing that?
Comment #19
nirad CreditAttribution: nirad commentedyou need to use "patch" which is a unix-based tool that will alter a file based on the instructions in the patch file. if you are on windows, use this: http://gnuwin32.sourceforge.net/packages/patch.htm
Comment #21
kmillecam CreditAttribution: kmillecam commentedCommitted to dev.
Comment #23
aneuryzma CreditAttribution: aneuryzma commentedhi, has this patch been included in the following versions ? I'm currently using 6.x-1.41 and i cannot make user points work together with five stars.
thanks
Comment #24
aneuryzma CreditAttribution: aneuryzma commentedI've actually tried to apply the patch to a previous version of the module, but it doesn't work: userpoints_votingapi-6.x-1.x-dev.tar.gz
I'm trying to assign the Fivestars points to the nodes authors. Is this already integrated in the most recent version of the module ? I cannot make it work. thanks
Comment #25
Neil Adair CreditAttribution: Neil Adair commentedComment #21 says the patch was committed to dev. I don't know if that means it was included in the latest release (1.4.1)
You should try the dev version as is (don't try to patch it).
I used it with Vote Up/Down http://drupal.org/project/vote_up_down not Five Star
Neil
Comment #26
aneuryzma CreditAttribution: aneuryzma commentedIn my comment I specified I've applied the patch to the dev and not the latest release.
Anyway it seems not to be the issue... the latest release includes the patch if I'm not wrong.
Comment #27
bflora CreditAttribution: bflora commentedCan this be extended to work for comments? I'm using the user_karma module to award points to node and comment creators when their nodes and comments are voted up...but I'd sure love to migrate over to Userpoints as its more fully featured. Not sure how to pull that off.
Comment #28
BetoAveigaIsn't Voting Rules what you're looking for?
If you have integration of rules with the voting api then you can award or remove points.
The module is in alpha, but you could give it a try...
http://drupal.org/project/voting_rules