1

I've a content type 'Content' with the field 'Value' (an integer). Every time a Content has been published, I'd like to grant the Content's author some User Points, equal to the value in the 'Value' field.

I tried solving the first part of my problem with the Rules module like this:

*Event: A node has been published

*Conditions: Content is of type 'Content'

*Actions: Grant points to a user: ...

However, it's impossible to pick node:field-value in the Points section. I also tried:

*Event: A node has been published

*Conditions: Content is of type 'Content'

*Actions:

 - Calculate a value: `[node:field-value]` "+" 0. (Variable name = result)

 - Grant points to a user: ...

But then, the variable 'result' is not available. How can I solve this issue?

2

I finally found a solution! I completed the second scenario (the amount of User Points is calculated) successfuly! Apparently, the User Points module didn't know that the calculation was an integer. Therefore, I had to add an extra action Convert data type: Target type: Integer, Value to convert: [result], Rounding behavior: Always down. I called it 'total' and granted the user this amount of User Points.

0

Same you can achieve using the Userpoint module: userpoint module provides an API for users to gain or lose points for performing certain actions on your site.

The User Points and userpoints_basic modules provide the ability for users to gain points when they perform certain actions, such as:

  • posting a node (different points can be awarded for different node types, e.g. page, story, forum, image, ...etc.)
  • posting a comment
  • moderating a comment

When the nodes or comments are deleted the previously gained points are subtracted. If a node or comment author is changed the points are transferred respectively.

The number of points for each of the above actions is configurable by the site administrator and a transaction log is created for each point (similar to a bank account.

Uerpoints module doc: https://drupal.org/documentation/modules/userpoints

User point rules integration doc: https://drupal.org/node/873386

Link for configuring the rules as per your requirement: https://drupal.org/node/874390

  • I thought my question made clear that I'm already using the User Points module. As far as I know, gained points aren't substracted automatically after deleting content and points aren't transferred when the author is changed. I had to set up some Rules to achieve this. Or must I enable these options somewhere? Also, your third link is a way to check whether the user has/had a certain amount of points after points were added/substracted from him/her. What I need, however, is a Rule to check if the added points themselves are more than 5. But I found a solution for this problem, using Rules. – Jeroen Oct 2 '13 at 21:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.