} // 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,
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)
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
$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);
$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
$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);
$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());
}
// 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');
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;
// 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;
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')));
}
// 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")));
// 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")));
$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)) {
$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
$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
SQL_FREERESULT($result);
// Simply run generated SQL string
- SQL_QUERY($SQL, __FUNCTION__, __LINE__);
+ SQL_QUERY($sql, __FUNCTION__, __LINE__);
// Rebuild cache
REBUILD_CACHE("config", "config");
// "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)
);
// 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") {
// 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];
} // 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,
);
// Run the SQL
- SQL_QUERY($SQL, __FUNCTION__, __LINE__);
+ SQL_QUERY($sql, __FUNCTION__, __LINE__);
// Do we have an URL?
if (isset($content['url'])) {
// 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 = "";
} // 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)) {
$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) {
} // END - if
// Then add this value
- $SQL .= sprintf(" %s='%s',",
+ $sql .= sprintf(" %s='%s',",
SQL_ESCAPE($key),
SQL_ESCAPE($entries[$id])
);
} // 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();
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);
// 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";
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";
} 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";
}
// 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";
$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
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;
}
}
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;
}
}
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')))
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";
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');
// 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);
} // 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) {
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);
}
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')."')");
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":
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");
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);
// 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)) {
//* DEBUG: */ echo __LINE__.":".$MODE."/".$act."/".$wht."*<br />\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);