投票APIにルールを追加するモジュールがあります:http : //drupal.org/project/voting_rules
Userpointsはネイティブルールをサポートしています。
私はテスト環境にすべてを設定し、新しいルールを追加しました
Event: User votes on a Node
Condition: User has role(s)
Parameter: User: [vote:user], Roles: authenticated user
Condition: Check the value of the vote
Parameter: Vote: [vote], Operator: is greather than, Data value: 0
Action
Grant points to a user
Parameter: User: [vote:user], Points: 5, Points category: General, Operation: Insert, Moderate: Use the site defaul
追加情報:あなたが有効にする必要がありuserpointsとuserpoints_rulesなどvoting_rulesを
これがルールのエクスポートです
{ "rules_reward_voter" : {
"LABEL" : "reward voter",
"PLUGIN" : "reaction rule",
"REQUIRES" : [ "rules", "voting_rules", "userpoints_rules" ],
"ON" : [ "voting_rules_insert_node" ],
"IF" : [
{ "user_has_role" : { "account" : [ "vote:user" ], "roles" : { "value" : { "2" : "2" } } } },
{ "voting_rules_condition_check_vote_value" : { "vote" : [ "vote" ], "operator" : "\u003E", "value" : "0" } }
],
"DO" : [
{ "userpoints_action_grant_points" : {
"user" : [ "vote:user" ],
"points" : "5",
"tid" : "0",
"entity" : [ "" ],
"operation" : "Insert",
"display" : 1,
"moderate" : "default"
}
}
]
}
}