]> git.mxchange.org Git - mailer.git/blobdiff - inc/wrapper-functions.php
New wrapper function introduced, more EL rewrites:
[mailer.git] / inc / wrapper-functions.php
index bc89dfc63f560e1c950c87ad75646ade19ef57ad..56620b901933277a19059475f389d7a1043d05f5 100644 (file)
@@ -1826,5 +1826,17 @@ function isVerboseSqlEnabled () {
        return $GLOBALS['is_verbose_sql_enabled'];
 }
 
+// "Getter" for total user points
+function getTotalPoints ($userid) {
+       // Do we have cache?
+       if (!isset($GLOBALS['total_points'][$userid])) {
+               // Determine it
+               $GLOBALS['total_points'][$userid] = countSumTotalData($userid, 'user_points', 'points') - countSumTotalData($userid, 'user_data', 'used_points');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS['total_points'][$userid];
+}
+
 // [EOF]
 ?>