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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Chill35’s picture

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

Chill35’s picture

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.

clint-jb’s picture

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

Chill35’s picture

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.

jredding’s picture

Project: User Points » User Points Voting API
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.

jhedstrom’s picture

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

oradoe’s picture

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.

oradoe’s picture

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

cardentey’s picture

Subscribing

nirad’s picture

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

mr.alinaki’s picture

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

walker2238’s picture

Subscribe

mr.alinaki’s picture

Category: support » feature
Status: Active » Needs review
Gekiboy’s picture

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.

Gekiboy’s picture

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

Gekiboy’s picture

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

Neil Adair’s picture

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

entrepreneur27’s picture

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?

nirad’s picture

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

kmillecam’s picture

Status: Needs review » Fixed

Committed to dev.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

aneuryzma’s picture

hi, 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

aneuryzma’s picture

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

Neil Adair’s picture

Comment #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

aneuryzma’s picture

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

bflora’s picture

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

BetoAveiga’s picture

Isn'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