| 1 |
<?php |
<?php |
| 2 |
// $Id$ |
// $Id: userpoints_rules.rules.inc,v 1.1 2009/08/11 15:40:49 kbahey Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 41 |
/** |
/** |
| 42 |
* Rules action - grant points to a user. |
* Rules action - grant points to a user. |
| 43 |
*/ |
*/ |
| 44 |
function userpoints_action_grant_points($account_uid, $settings) { |
function userpoints_action_grant_points($account, $settings) { |
| 45 |
userpoints_userpointsapi(array('uid' => $account_uid, 'points' => $settings['points'])); |
userpoints_userpointsapi(array('uid' => $account->uid, 'points' => $settings['points'])); |
| 46 |
} |
} |
| 47 |
|
|
| 48 |
/** |
/** |
| 101 |
/** |
/** |
| 102 |
* Rules Condition - Userpoints amount is >= than |
* Rules Condition - Userpoints amount is >= than |
| 103 |
*/ |
*/ |
| 104 |
function userpoints_rules_amount($account_uid, $settings) { |
function userpoints_rules_amount($account, $settings) { |
| 105 |
$balance = userpoints_get_current_points($account_uid, $settings['type']); |
$balance = userpoints_get_current_points($account->uid, $settings['type']); |
| 106 |
return ($balance >= $settings['amount']); |
return ($balance >= $settings['amount']); |
| 107 |
} |
} |