X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Frefback_functions.php;h=2a3fe253f2bbd2ea42091598e8b37bbc2706452b;hb=452578b5bf17d14099ee44956deb4e4dc0832874;hp=dc3d0681602bcc0dfe336b5705a4346d7145e95e;hpb=59bd8a9805c51c895a92cc12825f4cbdfd792597;p=mailer.git diff --git a/inc/libs/refback_functions.php b/inc/libs/refback_functions.php index dc3d068160..2a3fe253f2 100644 --- a/inc/libs/refback_functions.php +++ b/inc/libs/refback_functions.php @@ -10,7 +10,12 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Funktionen fuer Refback-Erweiterung * * -------------------------------------------------------------------- * - * * + * $Revision:: 856 $ * + * $Date:: 2009-03-06 20:24:32 +0100 (Fr, 06. Mär 2009) $ * + * $Tag:: 0.2.1-FINAL $ * + * $Author:: stelzi $ * + * Needs to be in all Files and every File needs "svn propset * + * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2008 by Roland Haeder * * For more information visit: http://www.mxchange.org * @@ -47,16 +52,17 @@ function ADD_REFBACK_POINTS ($uid, $ref, $points, $ref_points) { $return = $points; // Get all ref levels - $result_refs = SQL_QUERY("SELECT level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE level > 0 ORDER BY level ASC", __FILE__, __LINE__); + $result_refs = SQL_QUERY("SELECT level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE level > 0 ORDER BY level ASC", + __FUNCTION__, __LINE__); // "Walk" through all level - while (list($level, $perc) = SQL_FETCHROW($result_refs)) { + while ($content = SQL_FETCHARRAY($result_refs)) { // Reset ref depths unset($GLOBALS['ref_level']); // "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) { + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):uid={$uid},ref={$ref},level={$content['level']},points={$points}
\n"; + foreach (GET_REFBACK_USERID_ARRAY($uid, $content['level']) as $refid) { // Skip level zero or if both are the same if ($uid == $refid) continue; @@ -66,13 +72,13 @@ 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"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):points={$points},perc={$content['percents']},percents={$percents},level={$content['level']}
\n"; // Calculate points for refback - $refback = $points * ($perc / 100) * ($percents / 100); + $refback = $points * ($content['percents'] / 100) * ($percents / 100); // Update refback table ("refid" and "uid" must be exchanged!) SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_refs` SET points=points+%s WHERE userid=%s AND refid=%s LIMIT 1", - array($refback, $refid, $uid), __FILE__, __LINE__); + array($refback, $refid, $uid), __FUNCTION__, __LINE__); //* DEBUG: */ print __FUNCTION__."(".__LINE__."):refback={$refback},uid={$uid},refid={$refid} - UPDATE! (".SQL_AFFECTEDROWS().")
\n"; // Add points again, but only directly @@ -82,7 +88,7 @@ function ADD_REFBACK_POINTS ($uid, $ref, $points, $ref_points) { // Reduce points if refid is found if ($refid == $ref) { // Reduce points here! - $return = $points * ($perc / 100) - $refback; + $return = $points * ($content['percents'] / 100) - $refback; //* DEBUG: */ print __FUNCTION__."(".__LINE__."):points={$return} - REDUCED
\n"; } // END - if } // END - if @@ -112,7 +118,7 @@ function GET_REFBACK_PERCENTS ($uid, $ref) { // Get percents from database $result = SQL_QUERY_ESC("SELECT refback FROM `{!_MYSQL_PREFIX!}_user_refs` WHERE userid=%s AND refid=%s LIMIT 1", - array($ref, $uid), __FILE__, __LINE__); + array($ref, $uid), __FUNCTION__, __LINE__); // Entry found? (Should be!) if (SQL_NUMROWS($result) == 1) { @@ -145,15 +151,15 @@ function GET_REFBACK_USERID_ARRAY ($rid, $level) { FROM `{!_MYSQL_PREFIX!}_user_refs` WHERE refid=%s AND level=%s ORDER BY userid ASC", - array($rid,$level), __FILE__, __LINE__); + array($rid,$level), __FUNCTION__, __LINE__); // Entries found? //* DEBUG: */ print __FUNCTION__."(".__LINE__."):numRows=".SQL_NUMROWS($result)."
\n"; if (SQL_NUMROWS($result) > 0) { // Add all - while (list($userid) = SQL_FETCHROW($result)) { - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):rid={$rid},level={$level},userid={$userid}
\n"; - $userIds[] = $userid; + while ($content = SQL_FETCHARRAY($result)) { + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):rid={$rid},level={$level},userid={$content['userid']}
\n"; + $userIds[] = $content['userid']; } // END - while } // END - if @@ -167,7 +173,7 @@ ORDER BY userid ASC", } // Update "refback table" -function UPDATE_REFBACK_TABLE($uid) { +function UPDATE_REFBACK_TABLE ($uid) { //* DEBUG: */ print "----------------------- ".__FUNCTION__." - ENTRY ------------------------