define('SERVER_URL', "http://www.mxchange.org");
// This current patch level
-define('CURR_SVN_REVISION', "410");
+define('CURR_SVN_REVISION', "411");
// Take a prime number which is long (if you know a longer one please try it out!)
define('_PRIME', 591623);
function ADD_REFBACK_POINTS ($uid, $ref, $points) {
global $DEPTH, $cacheArray;
+ // Backup and reset ref depth
+ $cacheArray['depth'][$uid][$ref] = $DEPTH; $DEPTH = -1;
+
// Init points
$return = $points;
$refback = $points * $percents / 100;
// Add points again, but only directly
- //* DEBUG: */ echo __FUNCTION__.":refback={$refback},depth={$DEPTH}<br />\n";
- $cacheArray['depth'][$uid][$ref] = $DEPTH; $DEPTH = -1;
+ //* DEBUG: */ echo __FUNCTION__.":refback={$refback}<br />\n";
ADD_POINTS_REFSYSTEM($uid, $refback, false, "0", false, "direct");
- $DEPTH = $cacheArray['depth'][$uid][$ref];
- //* DEBUG: */ echo __FUNCTION__.":depth={$DEPTH} - RESTORE!<br />\n";
// Reduce points if refid is found
if ($refid == $ref) {
} // END - if
} // END foreach
+ // Restore ref depth
+ $DEPTH = $cacheArray['depth'][$uid][$ref];
+
// Return them
return $return;
}