- } // END - if
- break;
-
- case "UID": // ... userid's account
- // Check his amount first
- $TOTAL = GET_TOTAL_DATA(getConfig('bonus_uid'), "user_points", "points") - GET_TOTAL_DATA(getConfig('bonus_uid'), "user_data", "used_points");
- if ($TOTAL >= $points) {
- // Subtract points from userid's account
- SUB_POINTS("bonus_payout_uid", getConfig('bonus_uid'), $points);
- } else {
- // Try to subtract from jackpot
- $dummy = SUB_JACKPOT($points);
- }
- break;
+ break;
+
+ case 'UID': // ... userid's account
+ // Check his amount first
+ $total = countSumTotalData(getConfig('bonus_userid'), 'user_points', 'points') - countSumTotalData(getConfig('bonus_userid'), 'user_data', 'used_points');
+ if ($total >= $points) {
+ // Subtract points from userid's account
+ subtractPoints('bonus_payout_userid', getConfig('bonus_userid'), $points);
+ } elseif (isExtensionActive('jackpot')) {
+ // Try to subtract from jackpot
+ $dummy = subtractPointsFromJackpot($points);
+ }
+ break;