From a947e52bac90c5cbfafc911898bd1c9d965b9fd7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 28 Sep 2008 01:32:40 +0000 Subject: [PATCH] Fixes for level= --- inc/databases.php | 2 +- inc/libs/bonus_functions.php | 2 +- inc/modules/admin/what-config_points.php | 4 ++-- inc/modules/admin/what-config_rallye_prices.php | 4 ++-- inc/modules/member/what-points.php | 2 +- inc/mysql-manager.php | 8 ++++---- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/inc/databases.php b/inc/databases.php index 92a9536db5..38743f11d9 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', "409"); +define('CURR_SVN_REVISION', "410"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/libs/bonus_functions.php b/inc/libs/bonus_functions.php index b132a99311..1404119753 100644 --- a/inc/libs/bonus_functions.php +++ b/inc/libs/bonus_functions.php @@ -138,7 +138,7 @@ function BONUS_MAKE_RANK_ROWS($data, $type, $uid) for ($rank = 1; $rank <= $max; $rank++) { // Load data - $result_users = SQL_QUERY_ESC("SELECT userid, points, timemark FROM "._MYSQL_PREFIX."_bonus_turbo WHERE %s=%s AND level=%s LIMIT 1", + $result_users = SQL_QUERY_ESC("SELECT userid, points, timemark FROM "._MYSQL_PREFIX."_bonus_turbo WHERE %s=%s AND level='%s' LIMIT 1", array($type, $data, $rank), __FILE__, __LINE__); list($userid, $points, $mark) = SQL_FETCHROW($result_users); diff --git a/inc/modules/admin/what-config_points.php b/inc/modules/admin/what-config_points.php index 7241b9727c..8307ed99a0 100644 --- a/inc/modules/admin/what-config_points.php +++ b/inc/modules/admin/what-config_points.php @@ -83,7 +83,7 @@ if (isset($_POST['ok'])) { $id = bigintval($id); // Update entry - $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_refdepths SET level=%s, percents='%s' WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_refdepths SET level='%s', percents='%s' WHERE id=%s LIMIT 1", array(bigintval($value), $_POST['perc'][$id], $id), __FILE__, __LINE__); } $TEXT = REF_DEPTHS_SAVED; @@ -134,7 +134,7 @@ WHERE mails_confirmed < %s", $REF, $REF); { if (strpos($SQL[0], "INSERT") > -1) { - $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_refdepths WHERE level=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_refdepths WHERE level='%s' LIMIT 1", array(bigintval($_POST['lvl'])), __FILE__, __LINE__); SQL_FREERESULT($result); } diff --git a/inc/modules/admin/what-config_rallye_prices.php b/inc/modules/admin/what-config_rallye_prices.php index 6515750a36..463e7ed90d 100644 --- a/inc/modules/admin/what-config_rallye_prices.php +++ b/inc/modules/admin/what-config_rallye_prices.php @@ -48,7 +48,7 @@ if (!empty($_GET['rallye'])) if ((!empty($_POST['level'])) && ((!empty($_POST['points'])) || (!empty($_POST['info'])))) { // Submitted data is valid, but maybe we already have this price level? - $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_rallye_prices WHERE rallye_id=%s AND price_level=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_rallye_prices WHERE rallye_id=%s AND price_level='%s' LIMIT 1", array(bigintval($_GET['rallye']), bigintval($_POST['level'])), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 0) @@ -104,7 +104,7 @@ VALUES ('%s','%s','%s','%s')", $id = bigintval($id); // Update entry - $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_rallye_prices SET rallye_id=%s, price_level=%s, points='%s', info='%s' WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_rallye_prices SET rallye_id=%s, price_level='%s', points='%s', info='%s' WHERE id=%s LIMIT 1", array($_POST['rallye_id'][$id], bigintval($level), $_POST['points'][$id], $_POST['infos'][$id], $id), __FILE__, __LINE__); } diff --git a/inc/modules/member/what-points.php b/inc/modules/member/what-points.php index 0cb4d3cbcd..46387bf9fc 100644 --- a/inc/modules/member/what-points.php +++ b/inc/modules/member/what-points.php @@ -73,7 +73,7 @@ while (list($lvl, $per) = SQL_FETCHROW($result_depths)) { } // Load referral counts - $result_refs = SQL_QUERY_ESC("SELECT counter FROM "._MYSQL_PREFIX."_refsystem WHERE userid=%s AND level=%s LIMIT 1", + $result_refs = SQL_QUERY_ESC("SELECT counter FROM "._MYSQL_PREFIX."_refsystem WHERE userid=%s AND level='%s' LIMIT 1", array($GLOBALS['userid'], bigintval($lvl)), __FILE__, __LINE__); if (SQL_NUMROWS($result_refs) == 1) { list($REFS) = SQL_FETCHROW($result_refs); diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 40cde51120..13023de6f4 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -1106,7 +1106,7 @@ function GET_REF_LEVEL_PERCENTS ($level) { } } else { // Get referal data - $result_lvl = SQL_QUERY_ESC("SELECT percents FROM "._MYSQL_PREFIX."_refdepths WHERE level=%s LIMIT 1", + $result_lvl = SQL_QUERY_ESC("SELECT percents FROM "._MYSQL_PREFIX."_refdepths WHERE level='%s' LIMIT 1", array(bigintval($level)), __FILE__, __LINE__); // Entry found? @@ -1372,7 +1372,7 @@ function UPDATE_REF_COUNTER ($uid) { //* DEBUG: */ echo __FUNCTION__.":uid={$uid},level={$cacheArray['ref_level'][$uid]}
\n"; // Update counter - $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_refsystem SET counter=counter+1 WHERE userid=%s AND level=%s LIMIT 1", + $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_refsystem SET counter=counter+1 WHERE userid=%s AND level='%s' LIMIT 1", array(bigintval($uid), $cacheArray['ref_level'][$uid]), __FILE__, __LINE__); // When no entry was updated then we have to create it here @@ -1450,7 +1450,7 @@ function UPDATE_REFBACK_TABLE($uid) } // END - if // Check existence - $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_refs WHERE userid=%s AND level=%s AND refid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_refs WHERE userid=%s AND level='%s' AND refid=%s LIMIT 1", array(bigintval($uid), $cacheArray['back_level'], bigintval($cacheArray['up_refid'][$cacheArray['back_level']])), __FILE__, __LINE__); // Do we have no entry? @@ -1471,7 +1471,7 @@ function UPDATE_REFBACK_TABLE($uid) $uid = $old; // Shall we add this as well? - $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_refs WHERE userid=%s AND level=%s AND refid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_refs WHERE userid=%s AND level='%s' AND refid=%s LIMIT 1", array(bigintval($uid), ($cacheArray['back_level']-$minus), bigintval($cacheArray['up_refid'][$cacheArray['back_level']])), __FILE__, __LINE__); // Do we have no entry? -- 2.39.5