Assign Points To Node Creator

clint-jb - October 6, 2008 - 12:53
Project:User Points Voting API
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

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

#1

Chill35 - October 6, 2008 - 16:31

Points are given to the content, not to the person who voted.

#2

Chill35 - October 6, 2008 - 16:32

If 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.

#3

clint-jb - October 6, 2008 - 19:45

No 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

#4

Chill35 - October 6, 2008 - 21:38
Project:Plus 1» User Points
Version:6.x-2.3» 6.x-1.x-dev
Component:Miscellaneous» Code: userpoints API

Then you'll have to check in with the User Points module.

#5

jredding - January 9, 2009 - 08:47
Project:User Points» User Points Voting API
Version:6.x-1.x-dev» 6.x-1.x-dev
Component:Code: userpoints API» Code

reclassifying 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.

#6

jhedstrom - February 18, 2009 - 01:50

Subscribing. I have an upcoming project that will need this feature, so I'll be creating a patch if nobody beats me to it.

#7

oradoe - February 21, 2009 - 08:40

If 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.

#8

oradoe - February 21, 2009 - 06:36

feel free to contact me at truongsinh.tran@vsaf.org

#9

cardentey - March 18, 2009 - 21:13

Subscribing

#10

nirad - March 27, 2009 - 22:29

the same issue is being worked on separately here: http://drupal.org/node/367005

#11

Mr.Alinaki - April 3, 2009 - 04:58

I've tried to modify userpoints_votingapi.module to give points to author and voter separately.

AttachmentSize
userpoints_votingapi4author.diff 3.26 KB

#12

walker2238 - April 6, 2009 - 20:35

Subscribe

#13

Mr.Alinaki - April 30, 2009 - 12:33
Category:support request» feature request
Status:active» needs review

#14

Gekiboy - June 30, 2009 - 23:30

An 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.

AttachmentSize
userpoints_votingapi.module.patch 10.9 KB

#15

Gekiboy - July 15, 2009 - 18:25

An update to my implementation. If stops users from getting points from voting on their own content.

AttachmentSize
userpoints_votingapi-317585.patch 11.34 KB

#16

Gekiboy - July 17, 2009 - 23:29

Tweaked the patch to work with the latest version of the userpoints_votingapi module.

AttachmentSize
userpoints_votingapi-317585.patch 11.31 KB

#17

NeilAdair - July 19, 2009 - 19:58

+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.

#18

entrepreneur27 - September 15, 2009 - 20:03

I 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?

#19

nirad - October 14, 2009 - 16:13

you 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

 
 

Drupal is a registered trademark of Dries Buytaert.