From: Roland Häder Date: Sun, 1 Mar 2009 06:51:25 +0000 (+0000) Subject: Some variable rewrites X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=95b85ceebca7c97bdd966b1cc94234adfd1abd52;p=mailer.git Some variable rewrites --- diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index 24e0edbb1e..a9485c6070 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -320,10 +320,10 @@ function SQL_RESULT_FROM_ARRAY ($table, $columns, $idRow, $id, $F, $L) { } // END - if // Prepare the SQL statement - $SQL = "SELECT `".implode("`, `", $columns)."` FROM `{!_MYSQL_PREFIX!}_%s` WHERE ``='%s' LIMIT 1"; + $sql = "SELECT `".implode("`, `", $columns)."` FROM `{!_MYSQL_PREFIX!}_%s` WHERE ``='%s' LIMIT 1"; // Return the result - return SQL_QUERY_ESC($SQL, + return SQL_QUERY_ESC($sql, array( bigintval($id), $table, diff --git a/inc/libs/bonus_functions.php b/inc/libs/bonus_functions.php index 058770d325..6679aa5f2f 100644 --- a/inc/libs/bonus_functions.php +++ b/inc/libs/bonus_functions.php @@ -43,7 +43,7 @@ function BONUS_ADD_TURBO_POINTS ($mid, $uid, $type) { if (getConfig('bonus_active') != "Y") return false; // Init variables - $SQL = ""; $bonys = 0; $mail = 0; $column = ""; + $sql = ""; $bonys = 0; $mail = 0; $column = ""; // Select SQL command switch ($type) diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php index 5d99a7d5a5..4f2fd8fa34 100644 --- a/inc/libs/sponsor_functions.php +++ b/inc/libs/sponsor_functions.php @@ -120,18 +120,18 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_S if ((empty($POST['force'])) || (!IS_ADMIN())) $POST['force'] = 0; // SQL and message string is empty by default - $SQL = ""; $MSG = ""; + $sql = ""; $MSG = ""; // Update? if ($UPDATE) { // Update his data - $SQL = "UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET "; + $sql = "UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET "; foreach ($DATA['keys'] as $k => $v) { - $SQL .= $v."='%s', "; + $sql .= $v."='%s', "; } // Remove last ", " from SQL string - $SQL = substr($SQL, 0, -2)." WHERE id='%s' LIMIT 1"; + $sql = substr($sql, 0, -2)." WHERE id='%s' LIMIT 1"; $DATA['values'][] = bigintval(REQUEST_GET('id')); // Generate message @@ -160,7 +160,7 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_S $VALUES = str_repeat("%s', '", count($DATA['values']) - 1); // Generate string - $SQL = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_data` (".$KEYS.") VALUES ('".$VALUES."%s')"; + $sql = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_data` (".$KEYS.") VALUES ('".$VALUES."%s')"; // Generate message $MSG = SPONSOR_GET_MESSAGE(getMessage('ADMIN_SPONSOR_ADDED'), "added", $MSGs); @@ -186,9 +186,9 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_S $ret = "already"; } - if (!empty($SQL)) { + if (!empty($sql)) { // Run SQL command - $result = SQL_QUERY_ESC($SQL, $DATA['values'], __FUNCTION__, __LINE__); + $result = SQL_QUERY_ESC($sql, $DATA['values'], __FUNCTION__, __LINE__); } // Output message @@ -401,10 +401,10 @@ function SPONSOR_SAVE_DATA ($POST, $content) { $DATA = array(); // Prepare SQL string - $SQL = "UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET"; + $sql = "UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET"; foreach ($POST as $key => $value) { // Mmmmm, too less security here??? - $SQL .= " ".strip_tags($key)."='%s',"; + $sql .= " ".strip_tags($key)."='%s',"; // We will secure this later inside the SQL_QUERY_ESC() function $DATA[] = strip_tags($value); @@ -420,7 +420,7 @@ function SPONSOR_SAVE_DATA ($POST, $content) { $EMAIL = true; // Okay, has changed then add status with UNCONFIRMED and new hash code - $SQL .= " `status`='EMAIL', hash='%s',"; + $sql .= " `status`='EMAIL', hash='%s',"; // Generate hash code $HASH = md5(session_id().":".$POST['email'].":".GET_REMOTE_ADDR().":".GET_USER_AGENT().":".time()); @@ -429,10 +429,10 @@ function SPONSOR_SAVE_DATA ($POST, $content) { } // Remove last commata - $SQL = substr($SQL, 0, -1); + $sql = substr($sql, 0, -1); // Add SQL tail data - $SQL .= " WHERE id='%s' AND password='%s' LIMIT 1"; + $sql .= " WHERE id='%s' AND password='%s' LIMIT 1"; $DATA[] = bigintval(get_session('sponsorid')); $DATA[] = get_session('sponsorpass'); @@ -472,7 +472,7 @@ function SPONSOR_SAVE_DATA ($POST, $content) { if (SQL_AFFECTEDROWS() == 1) { if (!empty($templ) && !empty($subj)) { // Run SQL command and check for success - $result = SQL_QUERY_ESC($SQL, $DATA, __FUNCTION__, __LINE__); + $result = SQL_QUERY_ESC($sql, $DATA, __FUNCTION__, __LINE__); // Add all data to content global $DATA; diff --git a/inc/mails/beg_mails.php b/inc/mails/beg_mails.php index 8072c29321..b6e6ef3b4e 100644 --- a/inc/mails/beg_mails.php +++ b/inc/mails/beg_mails.php @@ -44,23 +44,23 @@ if ($GLOBALS['output_mode'] == 1) return; // Create timemark from saved month $mark = mktime(0, 0, 0, getConfig('last_month'), date("d", time()), date('Y', time())); -$SQL = ""; $MODE = ""; +$sql = ""; $MODE = ""; // Shall I sent activation or deactivation mail? -$SQL = "SELECT userid, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE (beg_ral_notify "; +$sql = "SELECT userid, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE (beg_ral_notify "; switch (getConfig('beg_rallye')) { case "Y": // Begging rallye is activated if (getConfig('beg_ral_en_notify') == "Y") { // Okay, let's check for member accounts - $SQL .= "= 0 OR (beg_ral_notify > 0 AND beg_ral_en_notify < beg_ral_di_notify)"; + $sql .= "= 0 OR (beg_ral_notify > 0 AND beg_ral_en_notify < beg_ral_di_notify)"; $MODE = "en"; } else { // Do not notify! - $SQL = ""; + $sql = ""; } break; @@ -68,20 +68,20 @@ case "N": // Begging rallye is deactivated if (getConfig('beg_ral_di_notify') == "Y") { // Okay, let's check for member accounts - $SQL .= " > 0 AND beg_ral_di_notify < beg_ral_en_notify"; + $sql .= " > 0 AND beg_ral_di_notify < beg_ral_en_notify"; $MODE = "di"; } else { // Do not notify! - $SQL = ""; + $sql = ""; } break; } -if (!empty($SQL)) { +if (!empty($sql)) { // The SQL command needs to be finisched here (only confirmed accounts!) - $SQL .= ") AND `status`='CONFIRMED' ORDER BY last_online ASC"; + $sql .= ") AND `status`='CONFIRMED' ORDER BY last_online ASC"; // Prepare data for the template define('__BEG_MIN_POINTS' , TRANSLATE_COMMA(getConfig('beg_points'))); @@ -99,7 +99,7 @@ if (!empty($SQL)) { } // Check for accounts to be notified - $result_main = SQL_QUERY($SQL, __FILE__, __LINE__); + $result_main = SQL_QUERY($sql, __FILE__, __LINE__); if (SQL_NUMROWS($result_main) > 0) { // Normal notification mails or bonus mails? $MAIL_MODE = ((getConfig('beg_notify_bonus') > 0) && ($MODE == "en") && (EXT_IS_ACTIVE("bonus"))); diff --git a/inc/mails/bonus_mails.php b/inc/mails/bonus_mails.php index ff07609ab5..6c90799735 100644 --- a/inc/mails/bonus_mails.php +++ b/inc/mails/bonus_mails.php @@ -44,38 +44,38 @@ if ($GLOBALS['output_mode'] == 1) return; // Create timemark from saved month $mark = mktime(0, 0, 0, getConfig('last_month'), date("d", time()), date('Y', time())); -$SQL = ""; $MODE = ""; +$sql = ""; $MODE = ""; // Shall I sent activation or deactivation mail? -$SQL = "SELECT userid, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE (bonus_ral_notify "; +$sql = "SELECT userid, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE (bonus_ral_notify "; switch (getConfig('bonus_active')) { case "Y": // Active rallye is activated if (getConfig('bonus_en_notify') == "Y") { // Okay, let's check for member accounts - $SQL .= "= 0 OR (bonus_ral_notify > 0 AND bonus_ral_en_notify < bonus_ral_di_notify)"; + $sql .= "= 0 OR (bonus_ral_notify > 0 AND bonus_ral_en_notify < bonus_ral_di_notify)"; $MODE = "en"; } else { // Do not notify! - $SQL = ""; + $sql = ""; } break; case "N": // Active rallye is deactivated if (getConfig('bonus_di_notify') == "Y") { // Okay, let's check for member accounts - $SQL .= " > 0 AND bonus_ral_di_notify < bonus_ral_en_notify"; + $sql .= " > 0 AND bonus_ral_di_notify < bonus_ral_en_notify"; $MODE = "di"; } else { // Do not notify! - $SQL = ""; + $sql = ""; } break; } -if (!empty($SQL)) { +if (!empty($sql)) { // The SQL command needs to be finisched here (only confirmed accounts!) - $SQL .= ") AND `status`='CONFIRMED' ORDER BY last_online ASC"; + $sql .= ") AND `status`='CONFIRMED' ORDER BY last_online ASC"; // Normal notification mails or bonus mails? $MAIL_MODE = ((getConfig('bonus_notify_points') > 0) && ($MODE == "en") && (EXT_IS_ACTIVE("bonus"))); @@ -88,7 +88,7 @@ if (!empty($SQL)) { $RECEIVER = ""; $UIDs = array(); // Check for accounts to be notified - $result_main = SQL_QUERY($SQL, __FILE__, __LINE__); + $result_main = SQL_QUERY($sql, __FILE__, __LINE__); if (SQL_NUMROWS($result_main) > 0) { // Okay lets notify all users! while (list($uid, $email) = SQL_FETCHROW($result_main)) { diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 288510d631..a8f107f87f 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -607,7 +607,7 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName = "_config", $whereStatement = $DATA_UPDATE = implode(", ", $DATA); // Generate SQL string - $SQL = sprintf("UPDATE `{!_MYSQL_PREFIX!}%s` SET %s WHERE %s LIMIT 1", + $sql = sprintf("UPDATE `{!_MYSQL_PREFIX!}%s` SET %s WHERE %s LIMIT 1", $tableName, $DATA_UPDATE, $whereStatement @@ -626,7 +626,7 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName = "_config", $whereStatement = $VALUEs = implode(", ", $VALUEs); // Generate SQL string - $SQL = sprintf("INSERT INTO {!_MYSQL_PREFIX!}%s (%s) VALUES (%s)", + $sql = sprintf("INSERT INTO {!_MYSQL_PREFIX!}%s (%s) VALUES (%s)", $tableName, $KEYs, $VALUEs @@ -637,7 +637,7 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName = "_config", $whereStatement = SQL_FREERESULT($result); // Simply run generated SQL string - SQL_QUERY($SQL, __FUNCTION__, __LINE__); + SQL_QUERY($sql, __FUNCTION__, __LINE__); // Rebuild cache REBUILD_CACHE("config", "config"); @@ -882,7 +882,7 @@ function ADMIN_BUILD_STATUS_HANDLER ($mode, $IDs, $table, $columns, $filterFunct // "Walk" through all entries foreach ($IDs as $id => $sel) { // Construct SQL query - $SQL = sprintf("UPDATE `{!_MYSQL_PREFIX!}_%s` SET", + $sql = sprintf("UPDATE `{!_MYSQL_PREFIX!}_%s` SET", SQL_ESCAPE($table) ); @@ -904,7 +904,7 @@ function ADMIN_BUILD_STATUS_HANDLER ($mode, $IDs, $table, $columns, $filterFunct // Does the entry exist? if ((isset($content[$column])) && (isset($statusInfo[$content[$column]]))) { // Add these entries for update - $SQL .= sprintf(" %s='%s',", SQL_ESCAPE($column), SQL_ESCAPE($statusInfo[$content[$column]])); + $sql .= sprintf(" %s='%s',", SQL_ESCAPE($column), SQL_ESCAPE($statusInfo[$content[$column]])); // Remember status if ($statusColumn == "unknown") { @@ -926,10 +926,10 @@ function ADMIN_BUILD_STATUS_HANDLER ($mode, $IDs, $table, $columns, $filterFunct // Are there brackets () at the end? if (substr($entries[$id], -2, 2) == "()") { // Direct SQL command found - $SQL .= sprintf(" %s=%s,", SQL_ESCAPE($key), SQL_ESCAPE($entries[$id])); + $sql .= sprintf(" %s=%s,", SQL_ESCAPE($key), SQL_ESCAPE($entries[$id])); } else { // Add regular entry - $SQL .= sprintf(" %s='%s',", SQL_ESCAPE($key), SQL_ESCAPE($entries[$id])); + $sql .= sprintf(" %s='%s',", SQL_ESCAPE($key), SQL_ESCAPE($entries[$id])); // Add entry $content[$key] = $entries[$id]; @@ -938,7 +938,7 @@ function ADMIN_BUILD_STATUS_HANDLER ($mode, $IDs, $table, $columns, $filterFunct } // END - foreach // Finish SQL statement - $SQL = substr($SQL, 0, -1) . sprintf(" WHERE %s=%s AND %s='%s' LIMIT 1", + $sql = substr($sql, 0, -1) . sprintf(" WHERE %s=%s AND %s='%s' LIMIT 1", $idColumn, bigintval($id), $statusColumn, @@ -946,7 +946,7 @@ function ADMIN_BUILD_STATUS_HANDLER ($mode, $IDs, $table, $columns, $filterFunct ); // Run the SQL - SQL_QUERY($SQL, __FUNCTION__, __LINE__); + SQL_QUERY($sql, __FUNCTION__, __LINE__); // Do we have an URL? if (isset($content['url'])) { @@ -967,7 +967,7 @@ function ADMIN_DELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFu // Shall we delete here or list for deletion? if ($deleteNow) { // The base SQL command: - $SQL = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_%s` WHERE %s IN (%s)"; + $sql = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_%s` WHERE %s IN (%s)"; // Delete them all $idList = ""; @@ -993,7 +993,7 @@ function ADMIN_DELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFu } // END - foreach // Run the query - SQL_QUERY($SQL, array($table, $idColumn, substr($idList, 0, -1)), __FUNCTION__, __LINE__); + SQL_QUERY($sql, array($table, $idColumn, substr($idList, 0, -1)), __FUNCTION__, __LINE__); // Was this fine? if (SQL_AFFECTEDROWS() == count($IDs)) { @@ -1023,7 +1023,7 @@ function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunc $content = array(); // Prepare SQL for this row - $SQL = sprintf("UPDATE `{!_MYSQL_PREFIX!}_ SET", + $sql = sprintf("UPDATE `{!_MYSQL_PREFIX!}_ SET", SQL_ESCAPE($table) ); foreach (REQUEST_POST_ARRAY() as $key => $entries) { @@ -1045,7 +1045,7 @@ function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunc } // END - if // Then add this value - $SQL .= sprintf(" %s='%s',", + $sql .= sprintf(" %s='%s',", SQL_ESCAPE($key), SQL_ESCAPE($entries[$id]) ); @@ -1062,10 +1062,10 @@ function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunc } // END - foreach // Finish SQL command - $SQL = substr($SQL, 0, -1) . " WHERE ".$idColumn."=".bigintval($id)." LIMIT 1"; + $sql = substr($sql, 0, -1) . " WHERE ".$idColumn."=".bigintval($id)." LIMIT 1"; // Run this query - SQL_QUERY($SQL, __FUNCTION__, __LINE__); + SQL_QUERY($sql, __FUNCTION__, __LINE__); // Add affected rows $affected += SQL_AFFECTEDROWS(); diff --git a/inc/modules/admin/what-email_archiv.php b/inc/modules/admin/what-email_archiv.php index 1095da6e65..730289b0f7 100644 --- a/inc/modules/admin/what-email_archiv.php +++ b/inc/modules/admin/what-email_archiv.php @@ -44,23 +44,23 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR("admin", __FILE__); // 0 1 2 3 4 5 6 7 8 9 10 -$SQL = "SELECT id, sender, subject, text, receivers, payment_id, data_type, timestamp, url, target_send, cat_id +$sql = "SELECT id, sender, subject, text, receivers, payment_id, data_type, timestamp, url, target_send, cat_id FROM `{!_MYSQL_PREFIX!}_pool` WHERE data_type='SEND' OR data_type='DELETED' ORDER BY timestamp DESC"; // Check for maximum pages -$result_normal = SQL_QUERY($SQL, __FILE__, __LINE__); +$result_normal = SQL_QUERY($sql, __FILE__, __LINE__); // Set offset an current page to default values if (!REQUEST_ISSET_GET(('page'))) REQUEST_GET('page') = "1"; if (!REQUEST_ISSET_GET(('offset'))) REQUEST_SET_GET('offset', getConfig('mails_page')); // Add limitation to SQL string -$SQL .= " LIMIT ".(REQUEST_GET('offset') * REQUEST_GET('page') - REQUEST_GET('offset')).", ".REQUEST_GET('offset'); +$sql .= " LIMIT ".(REQUEST_GET('offset') * REQUEST_GET('page') - REQUEST_GET('offset')).", ".REQUEST_GET('offset'); // Run SQL query for normal mails -$result = SQL_QUERY($SQL, __FILE__, __LINE__); +$result = SQL_QUERY($sql, __FILE__, __LINE__); // Calculate pages $PAGES = round(SQL_NUMROWS($result_normal) / getConfig('mails_page') + 0.5); diff --git a/inc/modules/admin/what-email_details.php b/inc/modules/admin/what-email_details.php index 40161f3807..e4e566b19a 100644 --- a/inc/modules/admin/what-email_details.php +++ b/inc/modules/admin/what-email_details.php @@ -52,7 +52,7 @@ ADD_DESCR("admin", __FILE__); // Normal mails ordered by your members // 0 1 2 3 4 5 6 7 8 9 10 -$SQL = "SELECT id, sender, subject, text, receivers, payment_id, data_type, timestamp, url, target_send, cat_id +$sql = "SELECT id, sender, subject, text, receivers, payment_id, data_type, timestamp, url, target_send, cat_id FROM `{!_MYSQL_PREFIX!}_pool` WHERE data_type IN('ADMIN','TEMP','NEW','ACTIVE') ORDER BY timestamp DESC"; @@ -63,7 +63,7 @@ $SQL2 = ""; if (REQUEST_ISSET_GET(('mid'))) { // Only a specific mail shall be displayed // 0 1 2 3 4 5 6 7 8 9 10 - $SQL = "SELECT id, sender, subject, text, receivers, payment_id, data_type, timestamp, url, target_send, cat_id + $sql = "SELECT id, sender, subject, text, receivers, payment_id, data_type, timestamp, url, target_send, cat_id FROM `{!_MYSQL_PREFIX!}_pool` WHERE id='".bigintval(REQUEST_GET('mid'))."' LIMIT 1"; @@ -71,7 +71,7 @@ if (REQUEST_ISSET_GET(('mid'))) { } elseif (REQUEST_ISSET_GET(('uid'))) { // All mails by a specific member shall be displayed // 0 1 2 3 4 5 6 7 8 9 10 - $SQL = "SELECT id, sender, subject, text, receivers, payment_id, data_type, timestamp, url, target_send, cat_id + $sql = "SELECT id, sender, subject, text, receivers, payment_id, data_type, timestamp, url, target_send, cat_id FROM `{!_MYSQL_PREFIX!}_pool` WHERE sender='".bigintval(REQUEST_GET('uid'))."' ORDER by timestamp DESC"; @@ -91,7 +91,7 @@ ORDER BY timestamp DESC"; } // Check for maximum pages -$result_normal = SQL_QUERY($SQL, __FILE__, __LINE__); +$result_normal = SQL_QUERY($sql, __FILE__, __LINE__); // Set offset an current page to default values if (!REQUEST_ISSET_GET(('page'))) REQUEST_GET('page') = "1"; @@ -103,14 +103,14 @@ if (!REQUEST_ISSET_GET(('mid'))) { $ADD = " LIMIT ".(bigintval(REQUEST_GET('offset')) * bigintval(REQUEST_GET('page')) - bigintval(REQUEST_GET('offset'))).", ".bigintval(REQUEST_GET('offset')); // For normal mails - $SQL .= $ADD; + $sql .= $ADD; // For bonus mails if (!empty($SQL2)) $SQL2 .= $ADD; } // END - if // Run SQL query for normal mails -$result_list = SQL_QUERY($SQL, __FILE__, __LINE__); +$result_list = SQL_QUERY($sql, __FILE__, __LINE__); if ((!empty($SQL2)) && ($WHO == _ALL)) $result_bonus = SQL_QUERY($SQL2, __FILE__, __LINE__); // Calculate pages diff --git a/inc/modules/admin/what-list_rallyes.php b/inc/modules/admin/what-list_rallyes.php index 98b6f61d17..2eca075459 100644 --- a/inc/modules/admin/what-list_rallyes.php +++ b/inc/modules/admin/what-list_rallyes.php @@ -47,17 +47,17 @@ $MSG = ""; if (REQUEST_ISSET_GET(('rallye'))) { // Activate / deactivate - $SQL = ""; + $sql = ""; if (REQUEST_ISSET_GET(('activate'))) { switch (REQUEST_GET('activate')) { case "1": // Activate - $SQL = "UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET is_active='Y' WHERE id=%s AND is_active='N' LIMIT 1"; + $sql = "UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET is_active='Y' WHERE id=%s AND is_active='N' LIMIT 1"; break; case "0": // Deactivate - $SQL = "UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET is_active='N' WHERE id=%s AND is_active='Y' LIMIT 1"; + $sql = "UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET is_active='N' WHERE id=%s AND is_active='Y' LIMIT 1"; break; } } @@ -68,11 +68,11 @@ if (REQUEST_ISSET_GET(('rallye'))) switch (REQUEST_GET('notify')) { case "1": // Activate - $SQL = "UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET send_notify='Y' WHERE id=%s AND send_notify='N' LIMIT 1"; + $sql = "UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET send_notify='Y' WHERE id=%s AND send_notify='N' LIMIT 1"; break; case "0": // Deactivate - $SQL = "UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET send_notify='N' WHERE id=%s AND send_notify='Y' LIMIT 1"; + $sql = "UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET send_notify='N' WHERE id=%s AND send_notify='Y' LIMIT 1"; break; } } @@ -83,19 +83,19 @@ if (REQUEST_ISSET_GET(('rallye'))) switch (REQUEST_GET('auto')) { case "1": // Activate - $SQL = "UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET auto_add_new_user='Y' WHERE id=%s AND auto_add_new_user='N' LIMIT 1"; + $sql = "UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET auto_add_new_user='Y' WHERE id=%s AND auto_add_new_user='N' LIMIT 1"; break; case "0": // Deactivate - $SQL = "UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET auto_add_new_user='N' WHERE id=%s AND auto_add_new_user='Y' LIMIT 1"; + $sql = "UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET auto_add_new_user='N' WHERE id=%s AND auto_add_new_user='Y' LIMIT 1"; break; } } // Run SQL command - if (!empty($SQL)) + if (!empty($sql)) { - $result = SQL_QUERY_ESC($SQL, array(bigintval(REQUEST_GET('rallye'))), __FILE__, __LINE__); + $result = SQL_QUERY_ESC($sql, array(bigintval(REQUEST_GET('rallye'))), __FILE__, __LINE__); } } elseif (REQUEST_ISSET_POST(('remove'))) diff --git a/inc/modules/admin/what-list_unconfirmed.php b/inc/modules/admin/what-list_unconfirmed.php index 2e44fc37c9..0c009ba6b8 100644 --- a/inc/modules/admin/what-list_unconfirmed.php +++ b/inc/modules/admin/what-list_unconfirmed.php @@ -51,7 +51,7 @@ if (REQUEST_ISSET_GET(('mid'))) { define('__LIST_UNCON_TITLE', getMessage('LIST_UNCONFIRMED_MEMBER_LINKS')); // SQL query for mail data - $SQL = "SELECT DISTINCT s.id, p.sender, p.subject, p.text, p.url, p.timestamp, s.max_rec FROM `{!_MYSQL_PREFIX!}_pool` AS p + $sql = "SELECT DISTINCT s.id, p.sender, p.subject, p.text, p.url, p.timestamp, s.max_rec FROM `{!_MYSQL_PREFIX!}_pool` AS p LEFT JOIN `{!_MYSQL_PREFIX!}_user_stats` AS s ON p.id=s.pool_id WHERE p.id='".REQUEST_GET('mid')."' LIMIT 1"; @@ -66,7 +66,7 @@ WHERE p.id='".REQUEST_GET('mid')."' LIMIT 1"; define('__LIST_UNCON_TITLE', getMessage('LIST_UNCONFIRMED_BONUS_LINKS')); // SQL query for mail data (both ids are required for compatiblity to above normal mail - $SQL = "SELECT id, id, subject, text, url, timestamp, mails_sent FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id='".REQUEST_GET('bid')."' LIMIT 1"; + $sql = "SELECT id, id, subject, text, url, timestamp, mails_sent FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id='".REQUEST_GET('bid')."' LIMIT 1"; // Column, type and ID for member's mail $col = "bonus_id"; $type = "BONUS"; $ID = REQUEST_GET('bid'); @@ -81,7 +81,7 @@ WHERE p.id='".REQUEST_GET('mid')."' LIMIT 1"; // Shall I display links or not? if ($listed === true) { // Load mail data - $result = SQL_QUERY($SQL, __FILE__, __LINE__); + $result = SQL_QUERY($sql, __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Mail order / bonus mail found! list($stats_id, $sender, $subj, $text, $url, $stamp, $max) = SQL_FETCHROW($result); diff --git a/inc/modules/admin/what-list_user.php b/inc/modules/admin/what-list_user.php index 30be6d5f63..8605c8c587 100644 --- a/inc/modules/admin/what-list_user.php +++ b/inc/modules/admin/what-list_user.php @@ -233,8 +233,8 @@ LIMIT 1", } // END = if // Prepare SQL and run it - $SQL = "SELECT userid, gender, surname, family, email, REMOTE_ADDR, refid, status, emails_sent, mails_confirmed, emails_received".$MORE." FROM `{!_MYSQL_PREFIX!}_user_data`".$whereStatement." ORDER BY ".REQUEST_GET(('sortby')); - $result_master = SQL_QUERY($SQL, __FILE__, __LINE__); + $sql = "SELECT userid, gender, surname, family, email, REMOTE_ADDR, refid, status, emails_sent, mails_confirmed, emails_received".$MORE." FROM `{!_MYSQL_PREFIX!}_user_data`".$whereStatement." ORDER BY ".REQUEST_GET(('sortby')); + $result_master = SQL_QUERY($sql, __FILE__, __LINE__); // Calculate page count (0.5 fixes a bug with page count) if (getConfig('user_limit') == 0) { @@ -249,8 +249,8 @@ LIMIT 1", if (!REQUEST_ISSET_GET(('offset'))) REQUEST_SET_GET('offset', getConfig('user_limit')); // Add limitation to SQL string and run him again - $SQL .= " LIMIT ".(REQUEST_GET('offset') * REQUEST_GET('page') - REQUEST_GET('offset')).", ".REQUEST_GET('offset'); - $result = SQL_QUERY($SQL, __FILE__, __LINE__); + $sql .= " LIMIT ".(REQUEST_GET('offset') * REQUEST_GET('page') - REQUEST_GET('offset')).", ".REQUEST_GET('offset'); + $result = SQL_QUERY($sql, __FILE__, __LINE__); $result_user = SQL_QUERY("SELECT emails_sent FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `status`='CONFIRMED'", __FILE__, __LINE__); $user_count = SQL_NUMROWS($result_user); diff --git a/inc/modules/admin/what-payments.php b/inc/modules/admin/what-payments.php index adbc2e95ab..d3a8c4f4b8 100644 --- a/inc/modules/admin/what-payments.php +++ b/inc/modules/admin/what-payments.php @@ -45,7 +45,6 @@ if (((!REQUEST_ISSET_POST(('t_wait'))) || (!REQUEST_ISSET_POST(('payment')))) && } if (IS_FORM_SENT()) { - $SQL = array(); switch (REQUEST_GET('do')) { case "add": ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_payments` (time, payment, mail_title, price) VALUES ('".REQUEST_POST('t_wait')."','".REQUEST_POST('payment')."','".REQUEST_POST('title')."','".REQUEST_POST('price')."')"); diff --git a/inc/modules/admin/what-refbanner.php b/inc/modules/admin/what-refbanner.php index f17446b43e..229a8beadf 100644 --- a/inc/modules/admin/what-refbanner.php +++ b/inc/modules/admin/what-refbanner.php @@ -54,7 +54,7 @@ if (REQUEST_ISSET_POST(('sel'))) $SEL = SELECTION_COUNT(REQUEST_POST('sel')); if (IS_FORM_SENT()) { // Fix older calls from add-new-banner-form if (!REQUEST_ISSET_GET(('mode'))) REQUEST_SET_GET('mode', "add"); - $SQL = ""; + $sql = ""; switch (REQUEST_GET('mode')) { case "add": diff --git a/inc/modules/admin/what-theme_edit.php b/inc/modules/admin/what-theme_edit.php index 30aa9d12e2..676e3156db 100644 --- a/inc/modules/admin/what-theme_edit.php +++ b/inc/modules/admin/what-theme_edit.php @@ -49,26 +49,26 @@ if (REQUEST_ISSET_POST(('sel'))) $SEL = SELECTION_COUNT(REQUEST_POST('sel')); if ($SEL > 0) { $OUT = ""; foreach (REQUEST_POST('sel') as $id => $sel) { - $SQL = ""; + $sql = ""; // Shall I de-/activate or delete themes? if (REQUEST_ISSET_POST(('status'))) { // Change status if (REQUEST_POST('active', $id) == "Y") { - $SQL = "UPDATE `{!_MYSQL_PREFIX!}_themes` SET theme_active='N' WHERE id='".$id."' LIMIT 1"; + $sql = "UPDATE `{!_MYSQL_PREFIX!}_themes` SET theme_active='N' WHERE id='".$id."' LIMIT 1"; } else { - $SQL = "UPDATE `{!_MYSQL_PREFIX!}_themes` SET theme_active='Y' WHERE id='".$id."' LIMIT 1"; + $sql = "UPDATE `{!_MYSQL_PREFIX!}_themes` SET theme_active='Y' WHERE id='".$id."' LIMIT 1"; } $OUT = getMessage('ADMIN_THEMES_UPDATED'); } elseif (REQUEST_ISSET_POST(('del'))) { // Delete themes - $SQL = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_themes` WHERE id='".$id."' LIMIT 1"; + $sql = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_themes` WHERE id='".$id."' LIMIT 1"; $OUT = getMessage('ADMIN_THEMES_DELETED'); } // Run SQL command? - if (!empty($SQL)) { + if (!empty($sql)) { // Run it - $result = SQL_QUERY($SQL, __FILE__, __LINE__); + $result = SQL_QUERY($sql, __FILE__, __LINE__); // Rebuild cache REBUILD_CACHE("themes", "them"); diff --git a/inc/modules/member/what-transfer.php b/inc/modules/member/what-transfer.php index 34eb22df63..aba730d1df 100644 --- a/inc/modules/member/what-transfer.php +++ b/inc/modules/member/what-transfer.php @@ -298,14 +298,14 @@ case "list_out": // List only outgoing transactions switch ($MODE) { case "list_in": - $SQL = "SELECT trans_id, from_uid, points, reason, time_trans FROM `{!_MYSQL_PREFIX!}_user_transfers_in` WHERE userid=%s ORDER BY time_trans DESC LIMIT ".getConfig('transfer_max'); + $sql = "SELECT trans_id, from_uid, points, reason, time_trans FROM `{!_MYSQL_PREFIX!}_user_transfers_in` WHERE userid=%s ORDER BY time_trans DESC LIMIT ".getConfig('transfer_max'); $NOTHING = TRANSFER_NO_INCOMING_TRANSFERS; define('__TRANSFER_SUM', TRANSFER_TOTAL_INCOMING); define('__TRANSFER_TITLE', TRANSFER_LIST_INCOMING); break; case "list_out": - $SQL = "SELECT trans_id, to_uid, points, reason, time_trans FROM `{!_MYSQL_PREFIX!}_user_transfers_out` WHERE userid=%s ORDER BY time_trans DESC LIMIT ".getConfig('transfer_max'); + $sql = "SELECT trans_id, to_uid, points, reason, time_trans FROM `{!_MYSQL_PREFIX!}_user_transfers_out` WHERE userid=%s ORDER BY time_trans DESC LIMIT ".getConfig('transfer_max'); $NOTHING = TRANSFER_NO_OUTGOING_TRANSFERS; define('__TRANSFER_SUM', TRANSFER_TOTAL_OUTGOING); define('__TRANSFER_TITLE', TRANSFER_LIST_OUTGOING); @@ -314,7 +314,7 @@ case "list_out": // List only outgoing transactions // Run the SQL command $total = 0; - $result = SQL_QUERY_ESC($SQL, array($GLOBALS['userid']), __FILE__, __LINE__); + $result = SQL_QUERY_ESC($sql, array($GLOBALS['userid']), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { $OUT = ""; $SW = 2; while (list($tid, $uid, $points, $reason, $stamp) = SQL_FETCHROW($result)) { diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index deded196d3..3a85acbd81 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -680,20 +680,20 @@ function VALIDATE_MENU_ACTION ($MODE, $act, $wht, $UPDATE=false) { //* DEBUG: */ echo __LINE__.":".$MODE."/".$act."/".$wht."*
\n"; if (($MODE != "admin") && ($UPDATE === true)) { // Update guest or member menu - $SQL = SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_%s_menu` SET counter=counter+1 WHERE `action`='%s' AND `what`='%s'".$ADD." LIMIT 1", + $sql = SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_%s_menu` SET counter=counter+1 WHERE `action`='%s' AND `what`='%s'".$ADD." LIMIT 1", array($MODE, $act, $wht), __FUNCTION__, __LINE__, false); } elseif (($wht != "overview") && (!empty($wht))) { // Other actions - $SQL = SQL_QUERY_ESC("SELECT id, what FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE `action`='%s' AND `what`='%s'".$ADD." ORDER BY action DESC LIMIT 1", + $sql = SQL_QUERY_ESC("SELECT id, what FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE `action`='%s' AND `what`='%s'".$ADD." ORDER BY action DESC LIMIT 1", array($MODE, $act, $wht), __FUNCTION__, __LINE__, false); } else { // Admin login overview - $SQL = SQL_QUERY_ESC("SELECT id, what FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE `action`='%s' AND (what='' OR `what` IS NULL)".$ADD." ORDER BY action DESC LIMIT 1", + $sql = SQL_QUERY_ESC("SELECT id, what FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE `action`='%s' AND (what='' OR `what` IS NULL)".$ADD." ORDER BY action DESC LIMIT 1", array($MODE, $act), __FUNCTION__, __LINE__, false); } // Run SQL command - $result = SQL_QUERY($SQL, __FUNCTION__, __LINE__); + $result = SQL_QUERY($sql, __FUNCTION__, __LINE__); if ($UPDATE === true) { // Check updated/affected rows $ret = (SQL_AFFECTEDROWS() == 1);