From: Roland Häder Date: Sun, 28 Sep 2008 01:35:19 +0000 (+0000) Subject: Fixes for ref level in refback X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=753a31bd03c08d20a0fbcd1be78011fdb109088d;p=mailer.git Fixes for ref level in refback --- diff --git a/inc/databases.php b/inc/databases.php index 38743f11d9..9752967174 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -113,7 +113,7 @@ define('USAGE_BASE', "usage"); 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); diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 13023de6f4..84d2a4ddbf 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -1268,6 +1268,9 @@ function ADD_POINTS_REFSYSTEM($uid, $points, $send_notify=false, $rid="0", $lock 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; @@ -1287,11 +1290,8 @@ function ADD_REFBACK_POINTS ($uid, $ref, $points) { $refback = $points * $percents / 100; // Add points again, but only directly - //* DEBUG: */ echo __FUNCTION__.":refback={$refback},depth={$DEPTH}
\n"; - $cacheArray['depth'][$uid][$ref] = $DEPTH; $DEPTH = -1; + //* DEBUG: */ echo __FUNCTION__.":refback={$refback}
\n"; ADD_POINTS_REFSYSTEM($uid, $refback, false, "0", false, "direct"); - $DEPTH = $cacheArray['depth'][$uid][$ref]; - //* DEBUG: */ echo __FUNCTION__.":depth={$DEPTH} - RESTORE!
\n"; // Reduce points if refid is found if ($refid == $ref) { @@ -1302,6 +1302,9 @@ function ADD_REFBACK_POINTS ($uid, $ref, $points) { } // END - if } // END foreach + // Restore ref depth + $DEPTH = $cacheArray['depth'][$uid][$ref]; + // Return them return $return; }