For D7, I recommend to go for a combination of these alternative, and often used, modules to subtract (or add) user points when some node is voted down (or such downvote is removed again, which may happen too ...):
Below are the required rules, for each of these cases (use the Rules UI to import them in your own site, after you enabled the required modules mentioned above). Assumptions made in these rules:
- They use a content type with machine name
article
(adapt this name to fit your own machine name, or omit that Rules Condition to enable for any content type that can be voted on).
- The value of a downvote matches with "
-1
".
Downvote a node
The rule below will subtract -2 (grant -2) user points for a downvote (to the author of the node) ... AND also -1 user point for the voter:
{ "rules_votedown_node" : {
"LABEL" : "votedown_node",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules", "voting_rules", "userpoints_rules" ],
"ON" : { "voting_rules_insert_node" : [] },
"IF" : [
{ "node_is_of_type" : {
"node" : [ "node" ],
"type" : { "value" : { "article" : "article" } }
}
},
{ "voting_rules_condition_check_vote_value" : { "vote" : [ "vote" ], "value" : "-1" } }
],
"DO" : [
{ "userpoints_action_grant_points" : {
"user" : [ "node:author" ],
"points" : "-2",
"tid" : "0",
"entity" : [ "" ],
"description" : "Receive downvote to [node:type-name] \u0022[node:title]\u0022",
"operation" : "DownvoteReceived",
"reference" : "By uid=[vote:uid], for [node:type-name] to q=\u003Ca href=\u0022\/node\/[node:nid]\u0022\u003E[node:title]\u003C\/a\u003E",
"display" : "1",
"moderate" : "default"
}
},
{ "userpoints_action_grant_points" : {
"user" : [ "vote:user" ],
"points" : "-1",
"tid" : "0",
"entity" : [ "" ],
"description" : "Issue downvote to [node:type-name] \u0022[node:title]\u0022",
"operation" : "DownvoteIssued",
"reference" : "From uid=[node:author:uid], for [node:type-name] to q=\u003Ca href=\u0022\/node\/[node:nid]\u0022\u003E[node:title]\u003C\/a\u003E",
"display" : "1",
"moderate" : "default"
}
}
]
}
}
Cancel the downvote a node
The rule below will grant +2 (= remove -2) user points for a cancelled downvote (to the author of the node) ... AND also +1 user point for the voter:
{ "rules_votedown_node_cancel" : {
"LABEL" : "votedown_node_cancel",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules", "voting_rules", "userpoints_rules" ],
"ON" : { "voting_rules_delete_node" : [] },
"IF" : [
{ "node_is_of_type" : {
"node" : [ "node" ],
"type" : { "value" : { "article" : "article" } }
}
},
{ "voting_rules_condition_check_vote_value" : { "vote" : [ "vote" ], "value" : "-1" } }
],
"DO" : [
{ "userpoints_action_grant_points" : {
"user" : [ "node:author" ],
"points" : "2",
"tid" : "0",
"entity" : [ "" ],
"description" : "Cancel downvote to [node:type-name] \u0022[node:title]\u0022",
"operation" : "DownvoteCancelled",
"reference" : "By uid=[vote:uid], for [node:type-name] to q=\u003Ca href=\u0022\/node\/[node:nid]\u0022\u003E[node:title]\u003C\/a\u003E",
"display" : "1",
"moderate" : "default"
}
},
{ "userpoints_action_grant_points" : {
"user" : [ "vote:user" ],
"points" : "1",
"tid" : "0",
"entity" : [ "" ],
"description" : "Withdraw downvote to [node:type-name] \u0022[node:title]\u0022",
"operation" : "DownvoteWithdrawn",
"reference" : "From uid=[node:author:uid], for [node:type-name] to q=\u003Ca href=\u0022\/node\/[node:nid]\u0022\u003E[node:title]\u003C\/a\u003E",
"display" : "1",
"moderate" : "default"
}
}
]
}
}
Even though it may not be obvious from just browsing the exported rules above, note the description
, operation
and reference
used in each of the User Point transactions.
Using such rules, the configuration of how much to charge for upvotes and/or downvotes is just a matter of adapting the values of the userpoints to be granted (or removed) using the Rules UI.
Also note the description
, operation
and reference
used in each of the User Points transactions. That will also improve the typical User Points reports (via the various details added in the actual user point transactions).
Using the Conditional Rules module, you can consolidate these rules in a single rule also (which simplifies maintaining them).
Homework: adapt the rules shown above to implement something similar to bounties on SE (= transfer some amount of User Points from one user to another).
PS: "if you vote something down you get docked reputation points" (on SE) is only true for answers, not for questions. To refine that like you would want that to be, is just a matter of adding an appropriate extra Rules Condition (eg based on a content type of so).