]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/rallye_functions.php
More '0' to NULL and fix for failing extension deprecation if no admin is logged in
[mailer.git] / inc / libs / rallye_functions.php
index a9588b2d5c9a2e4981cf8a821bfd9adb8d5f6b49..baf0bdef927ec3a9a7a302eaea8cb7a9349df94b 100644 (file)
@@ -854,14 +854,14 @@ function addReferalRallyeTemplateSelection ($name = 'template', $default = '') {
 }
 
 // @TODO Please document this function
-function getReferalRallyeRefsCount ($currUserid, $old = '0') {
+function getReferalRallyeRefsCount ($currUserid, $oldReferralCount = '0') {
        // Check current refs
        if (isExtensionInstalledAndNewer('cache', '0.1.2')) {
                // Get refs from cache
                $count = '0';
                foreach ($GLOBALS['cache_array']['refsystem']['userid'] as $id => $userid) {
                        // Do we have a ref for this user?
-                       //* DEBUG: */ debugOutput('id='.$id.',userid='.$userid.',userid='.$userid.',old='.$old.',level='.$GLOBALS['cache_array']['refsystem']['level'][$id]);
+                       //* DEBUG: */ debugOutput('id='.$id.',userid='.$userid.',userid='.$userid.',oldReferralCount='.$oldReferralCount.',level='.$GLOBALS['cache_array']['refsystem']['level'][$id]);
                        if (($currUserid == $userid) && ($GLOBALS['cache_array']['refsystem']['level'][$id] == 1)) {
                                //* DEBUG: */ debugOutput('userid matches!');
                                foreach ($GLOBALS['cache_array']['refdepths']['level'] as $level) {
@@ -889,8 +889,8 @@ function getReferalRallyeRefsCount ($currUserid, $old = '0') {
                        incrementStatsEntry('cache_hits');
 
                        // Remove old refs
-                       //* DEBUG: */ debugOutput('+'.$count.'/'.$old.'+');
-                       $count -= $old;
+                       //* DEBUG: */ debugOutput('+'.$count.'/'.$oldReferralCount.'+');
+                       $count -= $oldReferralCount;
                } // END - if
        } else {
                // Load current refs from database
@@ -917,12 +917,12 @@ WHERE
                if (empty($count)) {
                        $count = '0';
                } else {
-                       $count -= $old;
+                       $count -= $oldReferralCount;
                }
        }
 
        // Return count
-       //* DEBUG: */ debugOutput('*'.$userid.'/'.$old.'/'.$count.'*');
+       //* DEBUG: */ debugOutput('*'.$userid.'/'.$oldReferralCount.'/'.$count.'*');
        return $count;
 }