}
// @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) {
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
if (empty($count)) {
$count = '0';
} else {
- $count -= $old;
+ $count -= $oldReferralCount;
}
}
// Return count
- //* DEBUG: */ debugOutput('*'.$userid.'/'.$old.'/'.$count.'*');
+ //* DEBUG: */ debugOutput('*'.$userid.'/'.$oldReferralCount.'/'.$count.'*');
return $count;
}