Added new features to Userpoints Rules.
- Event that integrates with Userpoints. Now it is possible to execute a rule every time than some points have been grant.
- Conditions: to evaluate if the total default category user points are greater/equal (>=) and less than (<) a configured number
With this two features it is possible to implement some of the features running as contributed Userpoints, and send mails, show messages, change node information, create nodes, change user roles,.... everything that can be done with Rules.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | userpoints_rules_upgrade.patch | 4.59 KB | jcmarco |
Comments
Comment #1
jcmarco commentedUpgrade patch
Comment #2
jredding commentedvery, very cool. Rules integration adds a ton of power to userpoints.
Comment #3
jredding commentedI haven't tested the code but I gave it an eyeballing. I don't see anything egregious and the code looks clean (for what its worth).
I have one question.
I noticed the use of $user in the function, for example
I know Drupal bounces around on this but isn't $user typically used to refer to the currently logged in user and $account used for user objects passed between functions?
I actually don't think this is a big deal but it popped out to me
Comment #4
kbahey commentedI will commit this, and change the $user as well.
Comment #5
kbahey commentedCommitted. Thank you.
All instances of $user changed to $account per jredding review.
Comment #7
socialnicheguru commentedI am a noob in regards to rules.
How would I configure the following:
Whenever $user->points < 100, then print a message to the screen or have a block appear.
I want this to happen regardless of the event. So in this case, the event is the condition.
is there a way to make this happen?
Ultimately I would like an item placed in one's shopping cart which I think I can do with cart links.