Coming from here: "Userpoints - Fivestar integration"
:
http://drupal.org/node/876598

(somehow it was not possible to look up the userpoints module to move that issue into this module queue, therefore creating as new issue here)

Comments

Taxoman’s picture

Status: Active » Closed (fixed)

Ah, this is actually a feature request for a D7 version of http://drupal.org/project/userpoints_votingapi , but I cannot seem to reassign this issue there, so closing it.

chefarov’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Closed (fixed) » Active

As it seems from the discussion here, a D7 version of Userpoints_VotingAPI is probably postponed for the time being, since the Userpoints-Rules along with the VotingAPI-Rules integration, substitute the Userpoints_VotingAPI module.
The thing is that using Rules you can only apply a fixed number of points to the node's author(or to a referenced user), which is kind of akward when using fivestar since you don't expect the same number of points to be applied when 1/5 and 5/5 is casted, apparently. The number of points each rating corresponds to, should be assigned by the administrator.
The Drupal 6 corresponding code is here

Would it be easy for a moderator to apply the appropriate changes so a D7 version to be implemented? Eitherwise could you guide me somehow to try do so (not familiar with drupal programming) ?

Thanks for your time

estoyausente’s picture

I have a rule implementing this. I use the module flags for controlling that the vote only grant points once.

{ "rules_add_point_for_vote" : {
    "LABEL" : "Add_point_for_vote",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "userpoints_rules", "flag", "voting_rules" ],
    "ON" : [ "voting_rules_insert_node" ],
    "IF" : [
      { "userpoints_condition_check_points" : {
          "user" : [ "site:current-user" ],
          "tid" : "0",
          "threshold" : "60",
          "comparison" : "lt"
        }
      },
      { "NOT flag_flagged_node" : {
          "flag" : "voted",
          "node" : [ "node" ],
          "flagging_user" : [ "site:current-user" ]
        }
      }
    ],
    "DO" : [
      { "userpoints_rules_get_current_points" : {
          "USING" : { "user" : [ "site:current-user" ], "tid" : "0" },
          "PROVIDE" : { "loaded_points" : { "general_points" : "Number of points in the specified category." } }
        }
      },
      { "userpoints_action_grant_points" : {
          "user" : [ "site:current-user" ],
          "points" : "2",
          "tid" : "0",
          "entity" : [ "" ],
          "description" : "Votar una entrada de blog",
          "operation" : "Add",
          "display" : 1,
          "moderate" : "default",
          "expirydate" : [ "" ]
        }
      },
      { "flag_flagnode" : {
          "flag" : "voted",
          "node" : [ "node" ],
          "flagging_user" : [ "site:current-user" ],
          "permission_check" : 1
        }
      }
    ]
  }
}
manuel.adan’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Closing old issues as outdated. Feel free to reopen if needed.