Getting total/own points rewritten to filter:
[mailer.git] / inc / wrapper-functions.php
index 279c8dec7232e58b35d903c07d7a9667a3e694f0..eb9419c94e5f07279ce1377e9ab169636f293b3f 100644 (file)
@@ -2347,8 +2347,17 @@ function isVerboseSqlEnabled () {
 function getTotalPoints ($userid) {
        // Do we have cache?
        if (!isset($GLOBALS[__FUNCTION__][$userid])) {
+               // Init array for filter chain
+               $data = array(
+                       'userid' => $userid,
+                       'points' => 0
+               );
+
+               // Run filter chain for getting more point values
+               $data = runFilter('get_total_points', $data);
+
                // Determine it
-               $GLOBALS[__FUNCTION__][$userid] = countSumTotalData($userid, 'user_points', 'points') - countSumTotalData($userid, 'user_points', 'order_points') - countSumTotalData($userid, 'user_data', 'used_points');
+               $GLOBALS[__FUNCTION__][$userid] = $data['points']  - countSumTotalData($userid, 'user_data', 'used_points');
        } // END - if
 
        // Return cache