]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/bonus_functions.php
Several template fixes/code cleanups, default module titles added:
[mailer.git] / inc / libs / bonus_functions.php
index c6768029f0219a4162909c4c336b4cbefb002ffc..acdc940d724fc5790b354bbe5808a9895f893e9e 100644 (file)
@@ -65,7 +65,7 @@ function addTurboBonus ($mid, $userid, $type) {
                default:
                        logDebugMessage(__FUNCTION__, __LINE__, sprintf("Invalid type %s detected.", $type));
                        break;
-       }
+       } // END - switch
 
        // Is a column name set?
        if (empty($column)) {
@@ -235,7 +235,7 @@ function handleBonusPoints ($mode) {
        }
 
        // Check his amount first
-       $total = countSumTotalData(getBonusUserId(), 'user_points', 'points') - countSumTotalData(getBonusUserId(), 'user_data', 'used_points');
+       $total = getTotalPoints(getBonusUserId());
 
        // Subtract points from...
        switch (getConfig('bonus_mode')) {
@@ -314,6 +314,10 @@ LIMIT 1',
        }
 }
 
+///////////////////////////////////////////////////////////////////////////////
+//                             Wrapper functions                             //
+///////////////////////////////////////////////////////////////////////////////
+
 // Determines wether the "bonus rallye" is active
 function isBonusRallyeActive () {
        // Do we have cache?
@@ -326,5 +330,17 @@ function isBonusRallyeActive () {
        return $GLOBALS['bonus_rallye_active'];
 }
 
+// Determines wether the "bonus new_member_notify" is active
+function isBonusNewMemberNotifyEnabled () {
+       // Do we have cache?
+       if (!isset($GLOBALS['bonus_new_member_notify_active'])) {
+               // Just determine it
+               $GLOBALS['bonus_new_member_notify_active'] = (getConfig('bonus_new_member_notify') == 'Y');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS['bonus_new_member_notify_active'];
+}
+
 // [EOF]
 ?>