X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Flibs%2Frefback_functions.php;h=5f9293a3c14c36da4cee08667a9af2fff726282a;hp=83aa8a9e3621b54ff20e26bc8ea6cf4db0690b8a;hb=6586600d8020147192e5f28ca2a3a0153f774d3c;hpb=4e7273a155c9afa62cf0e094f96e206455b8bdde diff --git a/inc/libs/refback_functions.php b/inc/libs/refback_functions.php index 83aa8a9e36..5f9293a3c1 100644 --- a/inc/libs/refback_functions.php +++ b/inc/libs/refback_functions.php @@ -54,9 +54,9 @@ function ADD_REFBACK_POINTS ($uid, $ref, $points, $ref_points) { // "Walk" through all level while (list($level, $perc) = SQL_FETCHROW($result_refs)) { // Reset ref depths - $DEPTH = -1; + unset($DEPTH); - // "Walk through all refids + // "Walk" through all refids //* DEBUG: */ print __FUNCTION__."(".__LINE__."):uid={$uid},ref={$ref},level={$level},points={$points}
\n"; foreach (GET_REFBACK_USERID_ARRAY($uid, $level) as $refid) { // Skip level zero or if both are the same @@ -69,7 +69,7 @@ function ADD_REFBACK_POINTS ($uid, $ref, $points, $ref_points) { // Some percents given? if ($percents > 0) { //* DEBUG: */ print __FUNCTION__."(".__LINE__."):points={$points},perc={$perc},percents={$percents},level={$level}
\n"; - // Get points for refback + // Calculate points for refback $refback = $points * ($perc / 100) * ($percents / 100); // Update refback table ("refid" and "uid" must be exchanged!) @@ -79,7 +79,7 @@ function ADD_REFBACK_POINTS ($uid, $ref, $points, $ref_points) { // Add points again, but only directly //* DEBUG: */ print __FUNCTION__."(".__LINE__."):refback={$refback}
\n"; - ADD_POINTS_REFSYSTEM($uid, $refback, false, "0", false, "direct"); + ADD_POINTS_REFSYSTEM(sprintf("refback:%s", $refid), $uid, $refback, false, "0", false, "direct"); // Reduce points if refid is found if ($refid == $ref) { @@ -123,7 +123,7 @@ function GET_REFBACK_PERCENTS ($uid, $ref) { } else { // Debug log //* DEBUG: */ print __FUNCTION__."(".__LINE__."): NO ENTRY FOUND! :-(
\n"; - DEBUG_LOG(__FUNCTION__.": uid={$uid},ref={$ref} - No entry found! :-("); + DEBUG_LOG(__FUNCTION__, __LINE__, " uid={$uid},ref={$ref} - No entry found! :-("); } // Free result @@ -247,7 +247,7 @@ function UPDATE_REFBACK_TABLE($uid) { if ((($cacheArray['up_refid'][$cacheArray['back_level']] == $uid) || ($cacheArray['up_refid'][$cacheArray['back_level']] == 0)) && (GET_EXT_VERSION("cache") >= "0.1.2") && (!isset($cacheArray['back_cached']))) { // Remove cache here //* DEBUG: */ print __FUNCTION__."(".__LINE__."):uid={$uid},ref={$cacheArray['up_refid'][$cacheArray['back_level']]} - CACHE!
\n"; - if ($cacheInstance->cache_file("refback", true)) $cacheInstance->cache_destroy(); + if ($cacheInstance->loadCacheFile("refback")) $cacheInstance->destroyCacheFile(); $cacheArray['back_cached'] = 1; } // END - if