From: Roland Häder Date: Thu, 19 Feb 2009 22:37:27 +0000 (+0000) Subject: Previous fix fixed, a lot constants rewritten (unfinished) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5bdeaf8b452206598b6c6cd4f941145b11a0eccc;p=mailer.git Previous fix fixed, a lot constants rewritten (unfinished) --- diff --git a/beg.php b/beg.php index d1c103f611..077e3cdcc5 100644 --- a/beg.php +++ b/beg.php @@ -70,7 +70,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { if ("".($_GET['uid'] + 0)."" !== "".$_GET['uid']."") { if (EXT_IS_ACTIVE("nickname")) { // Maybe we have found a nickname? - $result = SQL_QUERY_ESC("SELECT userid, beg_clicks, ref_payout, status, last_online FROM `{!MYSQL_PREFIX!}_user_data` WHERE nickname='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT userid, beg_clicks, ref_payout, status, last_online FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' LIMIT 1", array($_GET['uid']), __FILE__, __LINE__); } else { // Nickname entered but nickname is not active @@ -79,7 +79,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { } } else { // Direct userid - $result = SQL_QUERY_ESC("SELECT userid, beg_clicks, ref_payout, status, last_online FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT userid, beg_clicks, ref_payout, status, last_online FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($_GET['uid'])), __FILE__, __LINE__); } @@ -121,11 +121,11 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { // User id valid and not webmaster's id? if (($uid > 0) && (getConfig('beg_uid') != $uid)) { // Update counter - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET beg_clicks=beg_clicks+1 WHERE userid=%s AND status='CONFIRMED' LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET beg_clicks=beg_clicks+1 WHERE userid=%s AND status='CONFIRMED' LIMIT 1", array($uid), __FILE__, __LINE__); // Check for last entry for userid w/o IP number - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_beg_ips` WHERE (timeout > (UNIX_TIMESTAMP() - ".getConfig('beg_timeout').") OR (timeout > (UNIX_TIMESTAMP() - ".getConfig('beg_uid_timeout').") AND userid=%s)) AND (remote_ip='%s' OR sid='%s') LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_beg_ips` WHERE (timeout > (UNIX_TIMESTAMP() - ".getConfig('beg_timeout').") OR (timeout > (UNIX_TIMESTAMP() - ".getConfig('beg_uid_timeout').") AND userid=%s)) AND (remote_ip='%s' OR sid='%s') LIMIT 1", array($uid, GET_REMOTE_ADDR(), session_id()), __FILE__, __LINE__); // Entry not found, points set and not logged in? @@ -136,7 +136,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { // Remember remote address, userid and timestamp for next click // but only when there is no admin begging. // Admins shall be able to test it! - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_beg_ips` (userid, remote_ip,sid, timeout) VALUES ('%s','%s','%s', UNIX_TIMESTAMP())", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_beg_ips` (userid, remote_ip,sid, timeout) VALUES ('%s','%s','%s', UNIX_TIMESTAMP())", array($uid, GET_REMOTE_ADDR(), session_id()), __FILE__, __LINE__); // Was is successfull? @@ -211,7 +211,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { $msg = GEN_ERROR_CODE_FROM_ACCOUNT_STATUS($status); } elseif (($uid == "0") || ($status == "failed")) { // Inalid or locked account, so let's find out - $result = SQL_QUERY_ESC("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE nickname='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' LIMIT 1", array($_GET['uid']), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Locked account diff --git a/birthday_confirm.php b/birthday_confirm.php index 75ea9aa846..a40adc6cef 100644 --- a/birthday_confirm.php +++ b/birthday_confirm.php @@ -60,8 +60,8 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { // Check if link is not clicked so far $result = SQL_QUERY_ESC("SELECT b.points, d.gender, d.surname, d.family, d.status, d.ref_payout -FROM `{!MYSQL_PREFIX!}_user_birthday` AS b -INNER JOIN `{!MYSQL_PREFIX!}_user_data` AS d +FROM `{!_MYSQL_PREFIX!}_user_birthday` AS b +INNER JOIN `{!_MYSQL_PREFIX!}_user_data` AS d ON b.userid=d.userid WHERE b.userid=%s AND b.chk_value='%s' LIMIT 1", array($uid, $chk), __FILE__, __LINE__); @@ -83,7 +83,7 @@ WHERE b.userid=%s AND b.chk_value='%s' LIMIT 1", ADD_POINTS_REFSYSTEM("birthday_confirm", $uid, $data['points'], false, "0", $locked, strtolower(getConfig('birthday_mode'))); // Remove entry from table - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_user_birthday` WHERE userid=%s AND chk_value='%s' LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_birthday` WHERE userid=%s AND chk_value='%s' LIMIT 1", array($uid, $chk), __FILE__, __LINE__); // Update mediadata if version is 0.0.4 or newer diff --git a/click.php b/click.php index 2cb035d082..ee59e6f825 100644 --- a/click.php +++ b/click.php @@ -46,7 +46,7 @@ require("inc/config.php"); if (((!empty($_GET['user'])) || (!empty($_GET['reseller']))) && (!empty($_GET['banner']))) { // Update clicks counter... - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_refbanner` SET clicks=clicks+1 WHERE id=%s LIMIT 1", array(bigintval($_GET['banner'])), __FILE__, __LINE__); + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_refbanner` SET clicks=clicks+1 WHERE id=%s LIMIT 1", array(bigintval($_GET['banner'])), __FILE__, __LINE__); if (SQL_AFFECTEDROWS() == 1) { if (!empty($_GET['user'])) { LOAD_URL("ref.php?refid=".bigintval($_GET['user'])); diff --git a/doubler.php b/doubler.php index 9af55bf61c..182b473cbb 100644 --- a/doubler.php +++ b/doubler.php @@ -51,7 +51,7 @@ require("inc/config.php"); // Is the "doubler" extension active? if (!EXT_IS_ACTIVE("doubler")) { // Redirect to index - LOAD_URL("modules.php?module=index&msg=".CODE_EXTENSION_PROBLEM."&ext=doubler"); + LOAD_URL("modules.php?module=index&msg={!CODE_EXTENSION_PROBLEM!}&ext=doubler"); } // END - if // Is the script installed? @@ -67,11 +67,11 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { // Do we have nickname or userid set? if ($probe_nickname) { // Nickname in URL, so load the ID - $result = SQL_QUERY_ESC("SELECT userid, status FROM `{!MYSQL_PREFIX!}_user_data` WHERE nickname='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT userid, status FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' LIMIT 1", array(bigintval($GLOBALS['refid'])), __FILE__, __LINE__); } else { // Direct userid entered - $result = SQL_QUERY_ESC("SELECT userid, status FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT userid, status FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($GLOBALS['refid'])), __FILE__, __LINE__); } @@ -103,11 +103,11 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { $probe_nickname = ((EXT_IS_ACTIVE("nickname")) && (("".round($_POST['userid'])."") != $_POST['userid'])); if ($probe_nickname) { // Nickname in URL, so load the ID - $result = SQL_QUERY_ESC("SELECT userid, status, password FROM `{!MYSQL_PREFIX!}_user_data` WHERE nickname='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT userid, status, password FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' LIMIT 1", array($_POST['userid']), __FILE__, __LINE__); } else { // Direct userid entered - $result = SQL_QUERY_ESC("SELECT userid, status, password FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT userid, status, password FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($_POST['userid'])), __FILE__, __LINE__); } @@ -136,7 +136,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { if (($points - getConfig('doubler_left') - $_POST['points'] * getConfig('doubler_charge')) >= 0) // Enough points are left so let's continue with the doubling process // Create doubling "account" width *DOUBLED* points - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_doubler` (userid, refid, points, remote_ip, timemark, completed, is_ref) VALUES ('%s','%s','%s','".GET_REMOTE_ADDR()."', UNIX_TIMESTAMP(), 'N','N')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_doubler` (userid, refid, points, remote_ip, timemark, completed, is_ref) VALUES ('%s','%s','%s','".GET_REMOTE_ADDR()."', UNIX_TIMESTAMP(), 'N','N')", array($uid, bigintval($GLOBALS['refid']), bigintval($_POST['points'] * 2)), __FILE__, __LINE__); // Subtract entered points @@ -150,7 +150,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { // Add second line for the referal but only when uid != refid if (($GLOBALS['refid'] > 0) && ($GLOBALS['refid'] != $uid)) { // Okay add a refid line and apply refid percents - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_doubler` (userid, refid, points, remote_ip, timemark, completed, is_ref) VALUES ('%s',0,'%s','".GET_REMOTE_ADDR()."',UNIX_TIMESTAMP(),'N','Y')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_doubler` (userid, refid, points, remote_ip, timemark, completed, is_ref) VALUES ('%s',0,'%s','".GET_REMOTE_ADDR()."',UNIX_TIMESTAMP(),'N','Y')", array( bigintval($GLOBALS['refid']), bigintval($_POST['points'] * 2 * getConfig('doubler_ref')) @@ -167,39 +167,39 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { define('__DOUBLER_MSG', LOAD_TEMPLATE("doubler_reflink", true, $_POST['userid'])); } else { // Not enougth points left - define('__ERROR_MSG', DOUBLER_FORM_NO_POINTS_LEFT); + define('__ERROR_MSG', getMessage('DOUBLER_FORM_NO_POINTS_LEFT')); } } elseif ($status == "CONFIRMED") { // Account is unconfirmed! - define('__ERROR_MSG', DOUBLER_FORM_WRONG_PASS); + define('__ERROR_MSG', getMessage('DOUBLER_FORM_WRONG_PASS')); } elseif ($status == "UNCONFIRMED") { // Account is unconfirmed! - define('__ERROR_MSG', DOUBLER_FORM_STATUS_UNCONFIRMED); + define('__ERROR_MSG', getMessage('DOUBLER_FORM_STATUS_UNCONFIRMED')); } elseif ($status == "LOCKED") { // Account is locked by admin / holiday! - define('__ERROR_MSG', DOUBLER_FORM_STATUS_LOCKED); + define('__ERROR_MSG', getMessage('DOUBLER_FORM_STATUS_LOCKED')); } elseif ($_POST['points'] < getConfig('doubler_min')) { // Not enougth points entered - define('__ERROR_MSG', DOUBLER_FORM_POINTS_MIN); + define('__ERROR_MSG', getMessage('DOUBLER_FORM_POINTS_MIN')); } elseif ($_POST['points'] > getConfig('doubler_max')) { // Too much points entered - define('__ERROR_MSG', DOUBLER_FORM_POINTS_MAX); + define('__ERROR_MSG', getMessage('DOUBLER_FORM_POINTS_MAX')); } elseif ($probe_nickname) { // Cannot resolv nickname -> userid - define('__ERROR_MSG', DOUBLER_FORM_404_NICKNAME); + define('__ERROR_MSG', getMessage('DOUBLER_FORM_404_NICKNAME')); } else { // Wrong password or account not found - define('__ERROR_MSG', DOUBLER_FORM_404_MEMBER); + define('__ERROR_MSG', getMessage('DOUBLER_FORM_404_MEMBER')); } } elseif (empty($_POST['userid'])) { // Login not entered - define('__ERROR_MSG', DOUBLER_FORM_404_LOGIN); + define('__ERROR_MSG', getMessage('DOUBLER_FORM_404_LOGIN')); } elseif (empty($_POST['pass'])) { // Password not entered - define('__ERROR_MSG', DOUBLER_FORM_404_PASSWORD); + define('__ERROR_MSG', getMessage('DOUBLER_FORM_404_PASSWORD')); } elseif (empty($_POST['points'])) { // points not entered - define('__ERROR_MSG', DOUBLER_FORM_404_POINTS); + define('__ERROR_MSG', getMessage('DOUBLER_FORM_404_POINTS')); } } @@ -238,21 +238,21 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { // Text "Enter login" if (EXT_IS_ACTIVE("nickname")) { // Choose login/nickname - define('DOUBLER_ENTER_LOGIN', GUEST_ENTER_LOGIN_NICKNAME); + define('DOUBLER_ENTER_LOGIN', getMessage('GUEST_ENTER_LOGIN_NICKNAME')); } else { // Simple login ID - define('DOUBLER_ENTER_LOGIN', GUEST_ENTER_LOGIN); + define('DOUBLER_ENTER_LOGIN', getMessage('GUEST_ENTER_LOGIN')); } // Which mail-send-mode did the admin setup? switch (getConfig('doubler_send_mode')) { case "DIRECT": - define('DOUBLER_PAYOUT_TIME', DOUBLER_PAYOUT_TIME_DIRECT); + define('DOUBLER_PAYOUT_TIME', getMessage('DOUBLER_PAYOUT_TIME_DIRECT')); break; case "RESET": - define('DOUBLER_PAYOUT_TIME', DOUBLER_PAYOUT_TIME_RESET); + define('DOUBLER_PAYOUT_TIME', getMessage('DOUBLER_PAYOUT_TIME_RESET')); break; } diff --git a/inc/autopurge/purge-general.php b/inc/autopurge/purge-general.php index 8e8f722ffc..a11fc14b33 100644 --- a/inc/autopurge/purge-general.php +++ b/inc/autopurge/purge-general.php @@ -53,17 +53,17 @@ if ((getConfig('auto_purge_active') == "Y") && (getConfig('auto_purge') > 0)) { // Then check for outdated mail order. We don't delete them just the confirmation links will be deleted. $result = SQL_QUERY_ESC("SELECT s.id, s.userid, s.pool_id, t.price -FROM `{!MYSQL_PREFIX!}_user_stats` AS s -LEFT JOIN `{!MYSQL_PREFIX!}_payments` AS t +FROM `{!_MYSQL_PREFIX!}_user_stats` AS s +LEFT JOIN `{!_MYSQL_PREFIX!}_payments` AS t ON s.payment_id=t.id WHERE s.timestamp_ordered <= (UNIX_TIMESTAMP() - %s) ORDER BY s.userid", array(bigintval($PURGE)), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Start deleting procedure $uid = 0; $points = 0; - while(list($mid, $sender, $pool, $price) = SQL_FETCHROW($result)) { + while (list($mid, $sender, $pool, $price) = SQL_FETCHROW($result)) { // Check if confirmation links are purged or not - $result_links = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_user_links` WHERE stats_id=%s LIMIT 1", + $result_links = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_links` WHERE stats_id=%s LIMIT 1", array(bigintval($mid)), __FILE__, __LINE__); if (SQL_NUMROWS($result_links) == 1) { // Free memory @@ -80,11 +80,11 @@ WHERE s.timestamp_ordered <= (UNIX_TIMESTAMP() - %s) ORDER BY s.userid", $uid = $sender; $points += $price; $admin_points += $price; // Remove confirmation links from queue - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_user_links` WHERE stats_id=%s", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_links` WHERE stats_id=%s", array(bigintval($mid)), __FILE__, __LINE__); // Update status of order - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_pool` SET data_type='DELETED' WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET data_type='DELETED' WHERE id=%s LIMIT 1", array(bigintval($pool)), __FILE__, __LINE__); } // END - if } // END - while @@ -99,14 +99,14 @@ WHERE s.timestamp_ordered <= (UNIX_TIMESTAMP() - %s) ORDER BY s.userid", // Is the 'bonus' extension installed and activated? if (EXT_IS_ACTIVE("bonus", true)) { // Check for bonus campaigns - $result = SQL_QUERY_ESC("SELECT id, points FROM `{!MYSQL_PREFIX!}_bonus` WHERE data_type='SEND' AND timestamp <= %s ORDER BY id", + $result = SQL_QUERY_ESC("SELECT id, points FROM `{!_MYSQL_PREFIX!}_bonus` WHERE data_type='SEND' AND timestamp <= %s ORDER BY `id`", array(bigintval($PURGE)), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Start deleting procedure $points = 0; while (list($bid, $price) = SQL_FETCHROW($result)) { // Check if confirmation links are purged or not - $result_links = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s", + $result_links = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s", array(bigintval($bid)), __FILE__, __LINE__); if (SQL_NUMROWS($result_links) > 0) { // At least one link was found, enougth to pay back the points @@ -116,11 +116,11 @@ WHERE s.timestamp_ordered <= (UNIX_TIMESTAMP() - %s) ORDER BY s.userid", SQL_FREERESULT($result_links); // Remove confirmation links from queue - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s", array(bigintval($bid)), __FILE__, __LINE__); // Update status of order - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_bonus` SET data_type='DELETED' WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_bonus` SET data_type='DELETED' WHERE id=%s LIMIT 1", array(bigintval($bid)), __FILE__, __LINE__); } // END - if } // END - while diff --git a/inc/autopurge/purge-inact.php b/inc/autopurge/purge-inact.php index 65250b8a9d..3303cda344 100644 --- a/inc/autopurge/purge-inact.php +++ b/inc/autopurge/purge-inact.php @@ -67,7 +67,7 @@ if (getConfig('autopurge_inactive') == "Y") { // Check for all accounts $result_inactive = SQL_QUERY_ESC("SELECT DISTINCT d.userid, d.email, d.last_online -FROM `{!MYSQL_PREFIX!}_user_data` AS d +FROM `{!_MYSQL_PREFIX!}_user_data` AS d WHERE d.status='CONFIRMED' AND d.joined < (UNIX_TIMESTAMP() - %s) AND d.last_online < (UNIX_TIMESTAMP() - %s) AND d.ap_notified < (UNIX_TIMESTAMP() - %s) ".$EXCLUDE_LIST." ORDER BY d.userid", array($since, $since, $since), __FILE__, __LINE__); @@ -79,7 +79,7 @@ ORDER BY d.userid", array($since, $since, $since), __FILE__, __LINE__); define('__INACTIVE_TIME' , (getConfig('ap_in_time') / 60 / 60)); // Mark found accounts as inactive and send an email - while(list($uid, $email, $last) = SQL_FETCHROW($result_inactive)) { + while (list($uid, $email, $last) = SQL_FETCHROW($result_inactive)) { // Remember userids for the admin $UIDs .= $uid.", "; @@ -91,7 +91,7 @@ ORDER BY d.userid", array($since, $since, $since), __FILE__, __LINE__); SEND_EMAIL($email, AUTOPURGE_MEMBER_INACTIVE_SUBJECT, $msg); // Update this account - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET ap_notified=UNIX_TIMESTAMP() WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET ap_notified=UNIX_TIMESTAMP() WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); } // END - while @@ -109,7 +109,7 @@ ORDER BY d.userid", array($since, $since, $since), __FILE__, __LINE__); // here for e.g. excluding holiday users $time = bigintval(getConfig('ap_in_time')); $result_inactive = SQL_QUERY_ESC("SELECT d.userid, d.email, d.last_online -FROM `{!MYSQL_PREFIX!}_user_data` AS d +FROM `{!_MYSQL_PREFIX!}_user_data` AS d WHERE status='CONFIRMED' AND joined < (UNIX_TIMESTAMP() - %s) AND last_online < (UNIX_TIMESTAMP() - %s) AND ap_notified < (UNIX_TIMESTAMP() - %s) ".$EXCLUDE_LIST." ORDER BY userid", diff --git a/inc/autopurge/purge-mails.php b/inc/autopurge/purge-mails.php index 0adcd3e187..d1aeb1d3de 100644 --- a/inc/autopurge/purge-mails.php +++ b/inc/autopurge/purge-mails.php @@ -48,7 +48,7 @@ if (getConfig('ap_del_mails') == "Y") { // Okay, let's check for them... $since = bigintval(getConfig('ap_dm_timeout')); $result_mails = SQL_QUERY_ESC("SELECT sender\ -FROM `{!MYSQL_PREFIX!}_pool` +FROM `{!_MYSQL_PREFIX!}_pool` WHERE data_type='DELETED' AND timestamp <= (UNIX_TIMESTAMP() - %s) ORDER BY sender ASC", array($since), __FILE__, __LINE__); @@ -59,20 +59,20 @@ ORDER BY sender ASC", // Do we have "purged" mails? if (SQL_NUMROWS($result_mails) > 0) { // Okay, check for their sender's - while(list($sender) = SQL_FETCHROW($result_mails)) { + while (list($sender) = SQL_FETCHROW($result_mails)) { // Check now... - $fount = SQL_NUMROWS(SQL_QUERY_ESC("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $fount = SQL_NUMROWS(SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($sender)), __FILE__, __LINE__)); if ($found == 0) { // Okay we found some mails! - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_pool` WHERE sender=%s", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_pool` WHERE sender=%s", array(bigintval($sender)), __FILE__, __LINE__); $DELETED += SQL_AFFECTEDROWS(); // Reset query (to prevent possible errors) ... $since = bigintval(getConfig('ap_dm_timeout')); $result_mails = SQL_QUERY_ESC("SELECT sender -FROM `{!MYSQL_PREFIX!}_pool` +FROM `{!_MYSQL_PREFIX!}_pool` WHERE data_type='DELETED' AND timestamp <= (UNIX_TIMESTAMP() - %s) ORDER BY sender ASC", array($since), __FILE__, __LINE__); @@ -86,7 +86,7 @@ ORDER BY sender ASC", // Now let's check for stats entries as well $since = bigintval(getConfig('ap_dm_timeout')); $result_mails = SQL_QUERY_ESC("SELECT sender -FROM `{!MYSQL_PREFIX!}_user_stats` +FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE data_type='DELETED' AND timestamp_send <= (UNIX_TIMESTAMP() - %s) ORDER BY sender ASC", array($since), __FILE__, __LINE__); @@ -94,18 +94,18 @@ ORDER BY sender ASC", // Do we have "purged" mails? if (SQL_NUMROWS($result_mails) > 0) { // Okay, check for their sender's - while(list($sender) = SQL_FETCHROW($result_mails)) { + while (list($sender) = SQL_FETCHROW($result_mails)) { // Check now... - $found = SQL_NUMROWS(SQL_QUERY_ESC("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($sender)), __FILE__, __LINE__)); + $found = SQL_NUMROWS(SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($sender)), __FILE__, __LINE__)); if ($found == 0) { // Okay we found some mails! - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_user_stats` WHERE sender=%s", array(bigintval($sender)), __FILE__, __LINE__); + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE sender=%s", array(bigintval($sender)), __FILE__, __LINE__); $DELETED += SQL_AFFECTEDROWS(); // Reset query (to prevent possible errors) ... $since = bigintval(getConfig('ap_dm_timeout')); $result_mails = SQL_QUERY_ESC("SELECT sender -FROM `{!MYSQL_PREFIX!}_user_stats` +FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE data_type='DELETED' AND timestamp_send <= (UNIX_TIMESTAMP() - %s) ORDER BY sender ASC", array($since), __FILE__, __LINE__); diff --git a/inc/autopurge/purge-tsks.php b/inc/autopurge/purge-tsks.php index 470c7cb2ea..7c82489ddd 100644 --- a/inc/autopurge/purge-tsks.php +++ b/inc/autopurge/purge-tsks.php @@ -50,7 +50,7 @@ if ((GET_EXT_VERSION("task") > "0.0") && (getConfig('ap_tasks') == "Y")) { // Purge deleted tasks (no notification to admin) SQL_QUERY_ESC("DELETE LOW_PRIORITY -FROM `{!MYSQL_PREFIX!}_task_system` +FROM `{!_MYSQL_PREFIX!}_task_system` WHERE status='DELETED' AND task_created <= (UNIX_TIMESTAMP() - %s)", array($since), __FILE__, __LINE__); $DELETED = SQL_AFFECTEDROWS(); diff --git a/inc/autopurge/purge-unconfirmed.php b/inc/autopurge/purge-unconfirmed.php index 5313b4dd7b..f834a18be5 100644 --- a/inc/autopurge/purge-unconfirmed.php +++ b/inc/autopurge/purge-unconfirmed.php @@ -48,7 +48,7 @@ if (getConfig('autopurge_unconfirmed') == "Y") { // Init variables and find unconfirmed accounts which I shall auto-purge $time = bigintval(getConfig('ap_un_time')); $result_uncon = SQL_QUERY_ESC("SELECT userid, email, joined -FROM `{!MYSQL_PREFIX!}_user_data` +FROM `{!_MYSQL_PREFIX!}_user_data` WHERE status='UNCONFIRMED' AND joined < (UNIX_TIMESTAMP() - %s) ORDER BY userid ASC", array($time), __FILE__, __LINE__); diff --git a/inc/doubler_send.php b/inc/doubler_send.php index 7bc256c5a1..02d7b56d84 100644 --- a/inc/doubler_send.php +++ b/inc/doubler_send.php @@ -56,16 +56,16 @@ if (empty($DOUBLER_UID)) $DOUBLER_UID = 0; // Check for doubles which we can pay out $min = bigintval(getConfig('doubler_min') * 2); $result_total = SQL_QUERY_ESC("SELECT DISTINCT d.id, d.userid, d.points, d.remote_ip, d.timemark -FROM `{!MYSQL_PREFIX!}_doubler` AS d -LEFT JOIN `{!MYSQL_PREFIX!}_user_data` AS u +FROM `{!_MYSQL_PREFIX!}_doubler` AS d +LEFT JOIN `{!_MYSQL_PREFIX!}_user_data` AS u ON d.userid=u.userid WHERE u.status='CONFIRMED' AND d.points <= %s AND d.points >= %s AND d.completed='N' AND d.is_ref='N' ORDER BY d.timemark", array($DOUBLER_POINTS, $min), __FILE__, __LINE__); // Check for accounts with limitation $result_main = SQL_QUERY_ESC("SELECT DISTINCT d.id, d.userid, d.points, d.remote_ip, d.timemark -FROM `{!MYSQL_PREFIX!}_doubler` AS d -LEFT JOIN `{!MYSQL_PREFIX!}_user_data` AS u +FROM `{!_MYSQL_PREFIX!}_doubler` AS d +LEFT JOIN `{!_MYSQL_PREFIX!}_user_data` AS u ON d.userid=u.userid WHERE u.status='CONFIRMED' AND d.points <= %s AND d.points >= %s AND d.completed='N' AND d.is_ref='N' ORDER BY d.timemark @@ -78,7 +78,7 @@ if (((SQL_NUMROWS($result_total) > 0) && (getConfig('doubler_sent_all') == "Y")) if ((SQL_NUMROWS($result_total) > 0) && (getConfig('doubler_sent_all') == "Y")) $result_load = $result_total; // At least one account was found - while(list($id, $uid, $points, $ip, $time) = SQL_FETCHROW($result_load)) { + while (list($id, $uid, $points, $ip, $time) = SQL_FETCHROW($result_load)) { // Only double when points are enougth! if ($DOUBLER_POINTS >= $points) { // Check for his ref points @@ -89,7 +89,7 @@ if (((SQL_NUMROWS($result_total) > 0) && (getConfig('doubler_sent_all') == "Y")) if (($ref > 0) && ($DOUBLER_UID == $uid) && (!empty($ref))) { // Referal points found so add them and set line(s) to completed='Y' $points += $ref; - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_doubler` SET completed='Y' WHERE refid=%s AND completed='N' AND is_ref='Y'", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_doubler` SET completed='Y' WHERE refid=%s AND completed='N' AND is_ref='Y'", array(bigintval($uid)), __FILE__, __LINE__); } else { // No referal points found @@ -103,7 +103,7 @@ if (((SQL_NUMROWS($result_total) > 0) && (getConfig('doubler_sent_all') == "Y")) } // END - if // Set entry as "payed" - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_doubler` SET completed='Y' WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_doubler` SET completed='Y' WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); $OK = false; diff --git a/inc/extensions.php b/inc/extensions.php index c98644a484..91646a16cc 100644 --- a/inc/extensions.php +++ b/inc/extensions.php @@ -216,7 +216,7 @@ function EXTENSION_REGISTER ($ext_name, $task_id, $dry_run = false, $logout = tr RUN_FILTER('pre_extension_installed', array('dry_run' => $dry_run, 'sqls' => $SQLs)); // Register extension - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_extensions` (ext_name, ext_active, ext_version) VALUES ('%s','%s','%s')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_extensions` (ext_name, ext_active, ext_version) VALUES ('%s','%s','%s')", array($ext_name, $EXT_ALWAYS_ACTIVE, $EXT_VERSION), __FILE__, __LINE__); // Remove cache file(s) if extension is active @@ -243,7 +243,7 @@ function EXTENSION_REGISTER ($ext_name, $task_id, $dry_run = false, $logout = tr } } elseif (($task_id > 0) && (!empty($ext_name))) { // Remove task from system when id and extension's name is valid - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_task_system` WHERE id=%s AND status='NEW' LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_task_system` WHERE id=%s AND status='NEW' LIMIT 1", array(bigintval($task_id)), __FILE__, __LINE__); } @@ -296,7 +296,7 @@ function EXTENSION_RUN_SQLS ($ext_id, $load_mode) { // Removal mode? if ($load_mode == "remove") { // Delete this extension (remember to remove it from your server *before* you click on welcome! - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_extensions` WHERE ext_name='%s' LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_extensions` WHERE ext_name='%s' LIMIT 1", array($ext_name), __FILE__, __LINE__); } // END - if } // END - if @@ -337,7 +337,7 @@ function EXT_IS_ACTIVE ($ext_name) { } elseif (($ext_name == "cache") || (GET_EXT_VERSION("cache") == "")) { //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "DB! ext_name={$ext_name}"); // Load from database - $result = SQL_QUERY_ESC("SELECT ext_active FROM `{!MYSQL_PREFIX!}_extensions` WHERE ext_name='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT ext_active FROM `{!_MYSQL_PREFIX!}_extensions` WHERE ext_name='%s' LIMIT 1", array($ext_name), __FILE__, __LINE__); // Entry found? @@ -383,7 +383,7 @@ function GET_EXT_VERSION ($ext_name) { incrementConfigEntry('cache_hits'); } elseif (!is_object($cacheInstance)) { // Load from database - $result = SQL_QUERY_ESC("SELECT ext_version FROM `{!MYSQL_PREFIX!}_extensions` WHERE ext_name='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT ext_version FROM `{!_MYSQL_PREFIX!}_extensions` WHERE ext_name='%s' LIMIT 1", array($ext_name), __FILE__, __LINE__); // Is the extension there? @@ -479,7 +479,7 @@ function EXTENSION_UPDATE ($ext_name, $ext_ver, $dry_run = false) { CREATE_EXTENSION_UPDATE_TASK(GET_CURRENT_ADMIN_ID(), $ext_name, $cacheArray['update_ver'][$ext_name], addslashes($NOTES)); // Update extension's version - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_extensions` SET ext_version='%s' WHERE ext_name='%s' LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_version='%s' WHERE ext_name='%s' LIMIT 1", array($cacheArray['update_ver'][$ext_name], $ext_name), __FILE__, __LINE__); // Remove arrays @@ -545,7 +545,7 @@ function EXTENSION_VERBOSE_TABLE ($queries = array(), $title = ADMIN_SQLS_EXECUT $OUT = LOAD_TEMPLATE("admin_ext_sql_table", true, $content); } elseif ((GET_EXT_VERSION("sql_patches") >= "0.0.7") && (getConfig('verbose_sql') == "Y")) { // No addional SQL commands to run - $OUT = LOAD_TEMPLATE("admin_settings_saved", true, ADMIN_NO_ADDITIONAL_SQLS); + $OUT = LOAD_TEMPLATE("admin_settings_saved", true, getMessage('ADMIN_NO_ADDITIONAL_SQLS')); } // END - if // Return output @@ -568,7 +568,7 @@ function GET_EXT_NAME ($ext_id) { incrementConfigEntry('cache_hits'); } elseif (!EXT_IS_ACTIVE("cache")) { // Load from database - $result = SQL_QUERY_ESC("SELECT ext_name FROM `{!MYSQL_PREFIX!}_extensions` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT ext_name FROM `{!_MYSQL_PREFIX!}_extensions` WHERE id=%s LIMIT 1", array(bigintval($ext_id)), __FILE__, __LINE__); list($ret) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -590,7 +590,7 @@ function GET_EXT_ID ($ext_name) { incrementConfigEntry('cache_hits'); } elseif (!EXT_IS_ACTIVE("cache")) { // Load from database - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_extensions` WHERE ext_name='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_extensions` WHERE ext_name='%s' LIMIT 1", array($ext_name), __FILE__, __LINE__); list($ret) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -603,7 +603,7 @@ function GET_EXT_ID ($ext_name) { // Activate given extension function ACTIVATE_EXTENSION ($ext_name) { // Activate the extension - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_extensions` SET ext_active='Y' WHERE ext_name='%s' LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_active='Y' WHERE ext_name='%s' LIMIT 1", array($ext_name), __FILE__, __LINE__); // Extension has been activated? @@ -616,7 +616,7 @@ function ACTIVATE_EXTENSION ($ext_name) { // Deactivate given extension function DEACTIVATE_EXTENSION($ext_name) { // Activate the extension - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_extensions` SET ext_active='N' WHERE ext_name='%s' LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_active='N' WHERE ext_name='%s' LIMIT 1", array($ext_name), __FILE__, __LINE__); // Extension has been activated? @@ -655,7 +655,7 @@ function CREATE_EXTENSION_UPDATE_TASK ($admin_id, $ext_name, $ext_ver, $notes) { // Check if task is not there if (DETERMINE_TASK_ID_BY_SUBJECT($subject) == 0) { // Task not created so it's a brand-new extension which we need to register and create a task for! - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_task_system` (assigned_admin, userid, status, task_type, subject, text, task_created) VALUES ('%s','0','NEW','EXTENSION_UPDATE','%s','%s', UNIX_TIMESTAMP())", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_task_system` (assigned_admin, userid, status, task_type, subject, text, task_created) VALUES ('%s','0','NEW','EXTENSION_UPDATE','%s','%s', UNIX_TIMESTAMP())", array($admin_id, $subject, $notes), __FILE__, __LINE__); } // END - if } // END - if @@ -682,7 +682,7 @@ function CREATE_NEW_EXTENSION_TASK ($admin_id, $subject, $ext) { } // Task not created so it's a brand-new extension which we need to register and create a task for! - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_task_system` (assigned_admin, userid, status, task_type, subject, text, task_created) + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_task_system` (assigned_admin, userid, status, task_type, subject, text, task_created) VALUES (%s,0,'NEW','EXTENSION','%s','%s',UNIX_TIMESTAMP())", array( $admin_id, @@ -701,7 +701,7 @@ function CREATE_EXTENSION_DEACTIVATION_TASK ($ext) { // Not installed and do we have created a task for the admin? if ((DETERMINE_TASK_ID_BY_SUBJECT($subject) == 0) && (GET_EXT_VERSION($ext) != "")) { // Task not created so add it - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_task_system` (assigned_admin, userid, status, task_type, subject, text, task_created) + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_task_system` (assigned_admin, userid, status, task_type, subject, text, task_created) VALUES (0,0,'NEW','EXTENSION_DEACTIVATION','%s','%s',UNIX_TIMESTAMP())", array( $subject, @@ -734,7 +734,7 @@ function MODULE_HAS_MENU ($mod, $forceDb = false) { } } elseif ((GET_EXT_VERSION("sql_patches") >= "0.3.6") && ((!EXT_IS_ACTIVE("cache")) || ($forceDb === true))) { // Check database for entry - $result = SQL_QUERY_ESC("SELECT has_menu FROM `{!MYSQL_PREFIX!}_mod_reg` WHERE module='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT has_menu FROM `{!_MYSQL_PREFIX!}_mod_reg` WHERE module='%s' LIMIT 1", array($mod), __FILE__, __LINE__); // Entry found? @@ -767,7 +767,7 @@ function DETERMINE_EXTENSION_TASK_ID ($ext_name) { $task_id = 0; // Search for extension task's id - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_task_system` WHERE task_type='EXTENSION' AND subject='[%s:]' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_task_system` WHERE task_type='EXTENSION' AND subject='[%s:]' LIMIT 1", array($ext_name), __FILE__, __LINE__); // Entry found? @@ -789,7 +789,7 @@ function DETERMINE_TASK_ID_BY_SUBJECT ($subject) { $task_id = 0; // Search for task id - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_task_system` WHERE subject LIKE '%s%%' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_task_system` WHERE subject LIKE '%s%%' LIMIT 1", array($subject), __FILE__, __LINE__); // Entry found? diff --git a/inc/extensions/ext-active.php b/inc/extensions/ext-active.php index 6939a6199c..9cf42e0818 100644 --- a/inc/extensions/ext-active.php +++ b/inc/extensions/ext-active.php @@ -50,7 +50,7 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','active','Heute Online', 10, 'N','Y')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','active','Heute Online', 10, 'N','Y')"; // Load CSS file? $EXT_CSS = "Y"; @@ -58,8 +58,8 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE what='active' LIMIT 1"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE what='config_active' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE what='active' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_active' LIMIT 1"; // Unregister filter UNREGISTER_FILTER('online_extra_links', 'ADD_LINK_ACTIVE_LIST', true, $dry_run); @@ -67,12 +67,12 @@ case "remove": // Do stuff when removing extension case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET visible='N', locked='N' WHERE what='active' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='N' WHERE what='active' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET visible='N', locked='Y' WHERE what='active' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE what='active' LIMIT 1"; break; case "update": // Update an extension @@ -99,8 +99,8 @@ case "update": // Update an extension break; case "0.0.5": // SQL queries for v0.0.5 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD active_limit BIGINT(20) UNSIGNED NOT NULL DEFAULT 10"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_active','Aktiv-Liste','Einstellungen an der Aktiv-Liste (Heute Online im Gastbereich) vornehmen.', 8)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD active_limit BIGINT(20) UNSIGNED NOT NULL DEFAULT 10"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_active','Aktiv-Liste','Einstellungen an der Aktiv-Liste (Heute Online im Gastbereich) vornehmen.', 8)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Aktiven-Liste im Gastbereich ist nun einschränkbar."; diff --git a/inc/extensions/ext-admins.php b/inc/extensions/ext-admins.php index a3624c8c1e..6d02c75fae 100644 --- a/inc/extensions/ext-admins.php +++ b/inc/extensions/ext-admins.php @@ -50,17 +50,17 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('admins', NULL, 'Admin-Management','Administratoren anlegen, löschen oder Passwort/E-Mail Adresse ändern.','1')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('admins','admins_add','Admin hinzufügen','Neuen Admin-Account anlegen','0')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('admins','admins_edit','Admin-Account ändern','Bestehende Admin-Accounts bearbeiten: E-Mail-Adresse, Passwort und/oder Login-Name ändern.','1')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('admins', NULL, 'Admin-Management','Administratoren anlegen, löschen oder Passwort/E-Mail Adresse ändern.','1')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('admins','admins_add','Admin hinzufügen','Neuen Admin-Account anlegen','0')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('admins','admins_edit','Admin-Account ändern','Bestehende Admin-Accounts bearbeiten: E-Mail-Adresse, Passwort und/oder Login-Name ändern.','1')"; break; case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE action='admins' LIMIT 6"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_admins_acls`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_admins_mails`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_admins` DROP default_acl"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='admins' LIMIT 6"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_admins_acls`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_admins_mails`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_admins` DROP default_acl"; // Remove filters UNREGISTER_FILTER('sql_admin_extra_data', 'ADD_EXTRA_SQL_DATA', true, $dry_run); @@ -80,7 +80,7 @@ case "update": // Update an extension switch ($EXT_VER) { case "0.2": // SQL queries for v0.2 - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('admins','admins_contact','Admin kontaktieren','Kontaktiert einen Admin per Mail oder Nachricht (nur wenn messaging-Erweiterung installiert ist).','2')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('admins','admins_contact','Admin kontaktieren','Kontaktiert einen Admin per Mail oder Nachricht (nur wenn messaging-Erweiterung installiert ist).','2')"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Fügt den Menüpunkt "Admin kontaktieren" hinzu."; @@ -88,18 +88,18 @@ case "update": // Update an extension case "0.3": // SQL queries for v0.3 // Add admin menu - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('admins','config_admins','ACL einstellen','Richten Sie Zugriffskontrollzeilen für jeden Admin individuell ein, um ihm nur bestimmte Bereiche des Admin-Bereiches zugänglich zu machen oder zu sperren.','4')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('admins','config_admins','ACL einstellen','Richten Sie Zugriffskontrollzeilen für jeden Admin individuell ein, um ihm nur bestimmte Bereiche des Admin-Bereiches zugänglich zu machen oder zu sperren.','4')"; // Which is the default setting when you create a new admin login? - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD admins_default_acl ENUM('deny','allow') NOT NULL DEFAULT 'deny'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD admins_default_acl ENUM('deny','allow') NOT NULL DEFAULT 'deny'"; // Default is deny everything - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_admins` ADD default_acl ENUM('deny','allow') NOT NULL DEFAULT 'deny'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_admins` ADD default_acl ENUM('deny','allow') NOT NULL DEFAULT 'deny'"; // But allow current admin everything (THIS SHALL BE YOU!) - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admins` SET default_acl='allow' WHERE login='".get_session('admin_login')."' LIMIT 1"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_admins_acls`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_admins_acls` ( + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admins` SET default_acl='allow' WHERE login='".get_session('admin_login')."' LIMIT 1"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_admins_acls`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_admins_acls` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, admin_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, action_menu VARCHAR(255) NOT NULL DEFAULT '', @@ -114,26 +114,26 @@ PRIMARY KEY (id) break; case "0.3.1": // SQL queries for v0.3.1 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_admins_acls` MODIFY id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_admins_acls` MODIFY id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT"; break; case "0.4.0": // SQL queries for v0.4.0 - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_admins_mails`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_admins_mails` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_admins_mails`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_admins_mails` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, admin_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, mail_template VARCHAR(255) NOT NULL, KEY (admin_id), PRIMARY KEY (id) ) TYPE=MyISAM"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('admins','admins_mails','Admin-Mails','Stellen Sie hier ein, welcher Admin welche Mail erhalten soll. Sie können dies (derzeit) jedoch erst, wenn einmal die Mail versendet wurde!','5')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('admins','admins_mails','Admin-Mails','Stellen Sie hier ein, welcher Admin welche Mail erhalten soll. Sie können dies (derzeit) jedoch erst, wenn einmal die Mail versendet wurde!','5')"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Kontrollieren Sie, welche Mails welcher Admin oder alle (admin_id=0) bekommen soll oder im UserLog (admin_id=-1) verzeichnet werden soll. Standartmässig wird weiter an alle versendet."; break; case "0.4.1": // SQL queries for v0.4.1 - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admins_mails` WHERE mail_template LIKE '% %'"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admins_mails` WHERE mail_template LIKE '% %'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Admins-Mails-Tabelle geleert."; @@ -199,7 +199,7 @@ PRIMARY KEY (id) break; case "0.5.6": // SQL queries for v0.5.6 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET what='admins_contct' WHERE what='admins_contact' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET what='admins_contct' WHERE what='admins_contact' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Namenskonflikt zwischen den Erweiterungen admins und (kommender) contact."; @@ -211,7 +211,7 @@ PRIMARY KEY (id) break; case "0.5.8": // SQL queries for v0.5.8 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET what='admins_contct' WHERE what='admins_contact' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET what='admins_contct' WHERE what='admins_contact' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Ein Punkt in der Versionsnummernliste verhinderte das 0.5.6-Update."; @@ -253,14 +253,14 @@ PRIMARY KEY (id) break; case "0.6.6": // SQL queries for v0.5.6 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET what='admins_contct' WHERE what='admins_contact' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET what='admins_contct' WHERE what='admins_contact' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Namenskonflikt zwischen den Erweiterungen admins und (kommender) contact."; break; case "0.6.7": // SQL queries for v0.6.7 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_admins` ADD la_mode ENUM('global','OLD','NEW') NOT NULL DEFAULT 'global'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_admins` ADD la_mode ENUM('global','OLD','NEW') NOT NULL DEFAULT 'global'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Namenskonflikt zwischen den Erweiterungen admins und (kommender) contact. Beseitigung eines Fehlers HTTP_POSR_VARS beim Ändern von Administratoren."; @@ -272,7 +272,7 @@ PRIMARY KEY (id) break; case "0.6.9": // SQL queries for v0.6.9 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET title = 'Admin-Management' WHERE action = 'admins' AND (what='' OR what IS NULL) LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET title = 'Admin-Management' WHERE action = 'admins' AND (what='' OR `what` IS NULL) LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Verwaltung nach Management umbenannt."; @@ -295,10 +295,10 @@ PRIMARY KEY (id) break; case "0.7.2": // SQL queries for v0.7.2 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_admins` DROP login_failtures"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_admins` DROP last_failture"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_admins` ADD login_failures BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_admins` ADD last_failure TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_admins` DROP login_failtures"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_admins` DROP last_failture"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_admins` ADD login_failures BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_admins` ADD last_failure TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Schreibweise korregiert."; diff --git a/inc/extensions/ext-admintheme1.php b/inc/extensions/ext-admintheme1.php index 00957bdff4..3b42449509 100644 --- a/inc/extensions/ext-admintheme1.php +++ b/inc/extensions/ext-admintheme1.php @@ -50,10 +50,10 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // Remove all other themes - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_extensions` WHERE ext_name LIKE 'admintheme%'"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET action='stats' WHERE what='usr_online' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET action='stats' WHERE what='email_stats' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET action='misc' WHERE what='maintenance' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_extensions` WHERE ext_name LIKE 'admintheme%'"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET action='stats' WHERE what='usr_online' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET action='stats' WHERE what='email_stats' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET action='misc' WHERE what='maintenance' LIMIT 1"; break; case "remove": // Do stuff when removing extension diff --git a/inc/extensions/ext-admintheme_default.php b/inc/extensions/ext-admintheme_default.php index ceaf384697..bb9e45ccad 100644 --- a/inc/extensions/ext-admintheme_default.php +++ b/inc/extensions/ext-admintheme_default.php @@ -50,10 +50,10 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // Remove all other menu themes - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_extensions` WHERE ext_name LIKE 'admintheme%'"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET action='misc' WHERE what='usr_online' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET action='stats' WHERE what='email' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET action='setup' WHERE what='maintenance' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_extensions` WHERE ext_name LIKE 'admintheme%'"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET action='misc' WHERE what='usr_online' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET action='stats' WHERE what='email' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET action='setup' WHERE what='maintenance' LIMIT 1"; break; case "remove": // Do stuff when removing extension diff --git a/inc/extensions/ext-autopurge.php b/inc/extensions/ext-autopurge.php index 095d4b38bc..ff66f2cb1f 100644 --- a/inc/extensions/ext-autopurge.php +++ b/inc/extensions/ext-autopurge.php @@ -50,22 +50,22 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_pool` MODIFY data_type ENUM('TEMP','SEND','NEW','ADMIN','ACTIVE','DELETED') NOT NULL DEFAULT 'TEMP'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_pool` MODIFY data_type ENUM('TEMP','SEND','NEW','ADMIN','ACTIVE','DELETED') NOT NULL DEFAULT 'TEMP'"; if (EXT_IS_ACTIVE("bonus")) { - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_bonus` MODIFY data_type ENUM('NEW','QUEUE','SEND','DELETED') NOT NULL DEFAULT 'NEW'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_bonus` MODIFY data_type ENUM('NEW','QUEUE','SEND','DELETED') NOT NULL DEFAULT 'NEW'"; } break; case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_pool` MODIFY data_type ENUM('TEMP','SEND','NEW','ADMIN','ACTIVE') NOT NULL DEFAULT 'TEMP'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_pool` MODIFY data_type ENUM('TEMP','SEND','NEW','ADMIN','ACTIVE') NOT NULL DEFAULT 'TEMP'"; if (EXT_IS_ACTIVE("bonus")) { - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_bonus` MODIFY data_type ENUM('NEW','QUEUE','SEND') NOT NULL DEFAULT 'NEW'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_bonus` MODIFY data_type ENUM('NEW','QUEUE','SEND') NOT NULL DEFAULT 'NEW'"; } - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE what IN('config_autopurge','list_autopurge') LIMIT 2"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` DROP ap_notified"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN('config_autopurge','list_autopurge') LIMIT 2"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP ap_notified"; break; case "activate": // Do stuff when admin activates this extension @@ -82,14 +82,14 @@ case "update": // Update an extension switch ($EXT_VER) { case "0.1": // SQL queries for v0.1 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD autopurge_inactive ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD autopurge_unconfirmed ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD ap_inactive_since BIGINT(20) UNSIGNED NOT NULL DEFAULT '2592000'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD ap_inactive_time BIGINT(20) UNSIGNED NOT NULL DEFAULT '25200'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD ap_unconfirmed_time BIGINT(20) UNSIGNED NOT NULL DEFAULT '432000'"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_autopurge','Auto-Löschung','Automatisch inaktive oder nicht bestätigte Accounts löschen.','12')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_autopurge','Inaktive finden','Lassen Sie sich vor dem täglichen Reset anzeigen, welche Mitglieder als inaktiv erkannt werden und welche gelöscht werden.','10')"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD ap_notified BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD autopurge_inactive ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD autopurge_unconfirmed ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD ap_inactive_since BIGINT(20) UNSIGNED NOT NULL DEFAULT '2592000'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD ap_inactive_time BIGINT(20) UNSIGNED NOT NULL DEFAULT '25200'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD ap_unconfirmed_time BIGINT(20) UNSIGNED NOT NULL DEFAULT '432000'"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_autopurge','Auto-Löschung','Automatisch inaktive oder nicht bestätigte Accounts löschen.','12')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_autopurge','Inaktive finden','Lassen Sie sich vor dem täglichen Reset anzeigen, welche Mitglieder als inaktiv erkannt werden und welche gelöscht werden.','10')"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD ap_notified BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Automatisches Lö:schen von inaktiven bzw. nicht bestätigten Accounts hinzugefügt."; @@ -127,17 +127,17 @@ case "update": // Update an extension break; case "0.1.9": // SQL queries for v0.1.9 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD autopurge_tasks ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD ap_tasks_time BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getConfig('one_day')*7)."'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD autopurge_tasks ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD ap_tasks_time BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getConfig('one_day')*7)."'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Bereinigung von zu löschenden Aufgaben klappt wieder. Zeitlimit für genanntes kann eingestellt werden (Default = 7 Tage).

Bitte aktualisieren Sie auch die Admin-Templates!"; break; case "0.2.0": // SQL queries for v0.2.0 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD ap_in_notify ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD ap_un_notify ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD ap_tasks_notify ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD ap_in_notify ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD ap_un_notify ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD ap_tasks_notify ENUM('Y','N') NOT NULL DEFAULT 'Y'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Mail wird bei Löschung von Aufgaben ausgesendet.

Bitte aktualisieren Sie auch die Admin-Templates!"; @@ -204,9 +204,9 @@ case "update": // Update an extension break; case "0.3.3": // SQL queries for v0.3.3 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD ap_del_mails ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD ap_dm_notify ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD ap_dm_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '86400'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD ap_del_mails ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD ap_dm_notify ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD ap_dm_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '86400'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Von bereits gelöschten Mitgliedern die Mails löschen integriert."; diff --git a/inc/extensions/ext-bank.php b/inc/extensions/ext-bank.php index f34653cd4a..b571558af6 100644 --- a/inc/extensions/ext-bank.php +++ b/inc/extensions/ext-bank.php @@ -50,8 +50,8 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_bank_accounts`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_bank_accounts` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bank_accounts`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_bank_accounts` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, uid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, account_created BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -77,8 +77,8 @@ INDEX (account_created), INDEX (account_locked), INDEX (last_tan_stamp) ) TYPE=MyISAM"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_bank_transfers`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_bank_transfers` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bank_transfers`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_bank_transfers` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, to_account_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, from_account_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -90,8 +90,8 @@ PRIMARY KEY (id), INDEX (to_account_id, from_account_id), INDEX (day_bookkeeping, day_available) ) TYPE=MyISAM"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_bank_packages`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_bank_packages` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bank_packages`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_bank_packages` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, title VARCHAR(255) NOT NULL DEFAULT '', description TINYTEXT, @@ -114,8 +114,8 @@ PRIMARY KEY (id) // what the member shall get for the specified income. output_system_mode // must be extended with the mode you get for free: output_system_mode:LOGIN // should be fine. More than one entry and not DISABLED ;) are not supported. - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_bank_tanlist`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_bank_tanlist` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bank_tanlist`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_bank_tanlist` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, idx TINYINT(3) UNSIGNED NOT NULL DEFAULT 0, account_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -126,50 +126,50 @@ UNIQUE (account_id, tan) ) TYPE=MyISAM"; // Admin menu queries - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank', NULL, 'Bank-Accounts','Verwalten Sie hier alle Bank-Accounts Ihrer Mitglieder, sowie Angebotspakete und Überweisungen.', 6)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','add_bank_package','Angebotspaket hinzufügen','Neues Angebotspaket erstellen.', 1)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','list_bank_package','Angebotspakete auflisten','Listet alle erstellten Angebotspakete auf.', 2)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','edit_bank_package','Angebotspaket ändern','Nach Auswahl eines Angebotspaketes können Sie dieses hier verändern. Bitte beachten Sie, dass Ihre Mitglieder keine Mail dabei erhalten!', 3)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','lock_bank_package','Angebotspaket ent-/sperren','Nehmen Sie Angebotspakete zur temporären Überarbeitung zuvor heraus, dann können Sie in Ruhe drüber nachdenken und Berechnungen anstellen. Freigabe ist hier auch möglich.', 4)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','del_bank_package','Angebotspaket löschen','Nach Auswahl eines Angebotspaketes können Sie mit abschliessender Bestätigung Angebotspakete ganz löschen. Bitte beachten Sie, dass dies nur möglich ist, wenn auch alle Accounts dieses nicht mehr nutzen!', 5)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','add_bank_account','Konto anlegen','Legen Sie hier Konten für die Mitglieder an (falls Ihre Mitglieder nicht zurecht kommen).', 6)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','list_bank_account','Konten auflisten','Auflistung aller Konto oder eines auswählbaren Mitglieds.', 7)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','edit_bank_account','Konto ändern','Ändern Sie hier bestehende Konten, z.B. den Dispositionskredit usw. PINs und TANs sind hier nicht änderbar! Bestätigungsmails sind optional versendbar.', 8)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','lock_bank_account','Konto ent-/sperren','Sperren Sie hier Konten bei Bedarf. Auch das Freischalten ist hier möglich. Eine Benachrichtigung per Mail wird dann an das Mitglied ausgesendet.', 9)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','del_bank_account','Konto löschen','Löschen von Konten mit Bestätigungsmail. Wenn Sie ein Mitglieder-Account löschen, so müssen Sie derzeit seine angelegten Konten auch löschen!', 10)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','send_bank_tanlist','TAN-Liste aussenden','Listet zuerst Anfragen von Mitgliedern auf, die eine neue (i)TAN-Liste benötigen, anschliessend kann die Liste dann ausgesendet werden.', 11)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','lock_bank_tanlist','TAN-Liste ent-/sperren','Bestehende TAN-Listen können auf Kundenwunsch hin gesperrt und wieder entsperrt werden. Dies passiert auch, wenn der Kunde x-mal (siehe Angebotspakete) eine verkehrte TAN eingegeben hat. Einzelne TANs sind nicht ent-/sperrbar.', 12)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','list_bank_trans','Überweisungen auflisten','Nach Auswahl eines Mitgliedes und einem Konto (benötgt JavaScript!) können Sie seitenweise die Überweisungen durchschauen.', 13)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank', NULL, 'Bank-Accounts','Verwalten Sie hier alle Bank-Accounts Ihrer Mitglieder, sowie Angebotspakete und Überweisungen.', 6)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','add_bank_package','Angebotspaket hinzufügen','Neues Angebotspaket erstellen.', 1)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','list_bank_package','Angebotspakete auflisten','Listet alle erstellten Angebotspakete auf.', 2)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','edit_bank_package','Angebotspaket ändern','Nach Auswahl eines Angebotspaketes können Sie dieses hier verändern. Bitte beachten Sie, dass Ihre Mitglieder keine Mail dabei erhalten!', 3)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','lock_bank_package','Angebotspaket ent-/sperren','Nehmen Sie Angebotspakete zur temporären Überarbeitung zuvor heraus, dann können Sie in Ruhe drüber nachdenken und Berechnungen anstellen. Freigabe ist hier auch möglich.', 4)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','del_bank_package','Angebotspaket löschen','Nach Auswahl eines Angebotspaketes können Sie mit abschliessender Bestätigung Angebotspakete ganz löschen. Bitte beachten Sie, dass dies nur möglich ist, wenn auch alle Accounts dieses nicht mehr nutzen!', 5)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','add_bank_account','Konto anlegen','Legen Sie hier Konten für die Mitglieder an (falls Ihre Mitglieder nicht zurecht kommen).', 6)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','list_bank_account','Konten auflisten','Auflistung aller Konto oder eines auswählbaren Mitglieds.', 7)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','edit_bank_account','Konto ändern','Ändern Sie hier bestehende Konten, z.B. den Dispositionskredit usw. PINs und TANs sind hier nicht änderbar! Bestätigungsmails sind optional versendbar.', 8)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','lock_bank_account','Konto ent-/sperren','Sperren Sie hier Konten bei Bedarf. Auch das Freischalten ist hier möglich. Eine Benachrichtigung per Mail wird dann an das Mitglied ausgesendet.', 9)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','del_bank_account','Konto löschen','Löschen von Konten mit Bestätigungsmail. Wenn Sie ein Mitglieder-Account löschen, so müssen Sie derzeit seine angelegten Konten auch löschen!', 10)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','send_bank_tanlist','TAN-Liste aussenden','Listet zuerst Anfragen von Mitgliedern auf, die eine neue (i)TAN-Liste benötigen, anschliessend kann die Liste dann ausgesendet werden.', 11)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','lock_bank_tanlist','TAN-Liste ent-/sperren','Bestehende TAN-Listen können auf Kundenwunsch hin gesperrt und wieder entsperrt werden. Dies passiert auch, wenn der Kunde x-mal (siehe Angebotspakete) eine verkehrte TAN eingegeben hat. Einzelne TANs sind nicht ent-/sperrbar.', 12)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('bank','list_bank_trans','Überweisungen auflisten','Nach Auswahl eines Mitgliedes und einem Konto (benötgt JavaScript!) können Sie seitenweise die Überweisungen durchschauen.', 13)"; // Member menu - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('bank', NULL, 'Bank-Account','N','Y', 3)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('bank','bank_infos','Angebotspakete','N','Y', 1)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('bank','bank_create','Konto anlegen','N','Y', 2)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('bank','bank_deposit','Auf Konto einzahlen','N','Y', 3)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('bank','bank_withdraw','Vom Konto abheben','N','Y', 4)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('bank','bank_output','Kontoauszug','N','Y', 5)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('bank','bank_change','Paket wechseln','N','Y', 6)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('bank','bank_remove','Konto Kündigen','N','Y', 7)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('bank', NULL, 'Bank-Account','N','Y', 3)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('bank','bank_infos','Angebotspakete','N','Y', 1)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('bank','bank_create','Konto anlegen','N','Y', 2)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('bank','bank_deposit','Auf Konto einzahlen','N','Y', 3)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('bank','bank_withdraw','Vom Konto abheben','N','Y', 4)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('bank','bank_output','Kontoauszug','N','Y', 5)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('bank','bank_change','Paket wechseln','N','Y', 6)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('bank','bank_remove','Konto Kündigen','N','Y', 7)"; break; case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_bank_accounts`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_bank_transfers`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_bank_packages`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_bank_tanlist`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE action='bank' LIMIT 14"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_member_menu` WHERE action='bank' LIMIT 8"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bank_accounts`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bank_transfers`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bank_packages`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bank_tanlist`"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='bank' LIMIT 14"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE action='bank' LIMIT 8"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='Y', locked='N' WHERE action='bank' LIMIT 8"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE action='bank' LIMIT 8"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='N', locked='Y' WHERE action='bank' LIMIT 8"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE action='bank' LIMIT 8"; break; case "update": // Update an extension diff --git a/inc/extensions/ext-beg.php b/inc/extensions/ext-beg.php index 4b209a3c93..846ad3177f 100644 --- a/inc/extensions/ext-beg.php +++ b/inc/extensions/ext-beg.php @@ -50,15 +50,15 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_beg','Bettel-Link','IP-Sperre, {!POINTS!}-Vergütung usw. können Sie hier einstellen.', 10)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','beg','{!POINTS!} erbetteln!',4,'Y','Y')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','beg','Ihr Bettel-Link',6,'Y','Y')"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD beg_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '600'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD beg_uid_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT 1800"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD beg_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00100"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD beg_clicks BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_beg_ips`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_beg_ips` ( + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_beg','Bettel-Link','IP-Sperre, {!POINTS!}-Vergütung usw. können Sie hier einstellen.', 10)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','beg','{!POINTS!} erbetteln!',4,'Y','Y')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','beg','Ihr Bettel-Link',6,'Y','Y')"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD beg_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '600'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD beg_uid_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT 1800"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD beg_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00100"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD beg_clicks BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_beg_ips`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_beg_ips` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, remote_ip VARCHAR(15) NOT NULL DEFAULT '0.0.0.0', @@ -73,24 +73,24 @@ PRIMARY KEY(id) case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE what='config_beg' OR what='list_beg' LIMIT 2"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE what='beg' LIMIT 1"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_member_menu` WHERE what='beg' OR what='beg2' LIMIT 2"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_beg_ips`"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_beg' OR what='list_beg' LIMIT 2"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE what='beg' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='beg' OR what='beg2' LIMIT 2"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_beg_ips`"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET visible='Y', locked='N' WHERE what='beg' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='Y', locked='N' WHERE what='beg' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_mod_reg` SET locked='N', hidden='N', admin_only='N', mem_only='N' WHERE module='beg' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y', `locked`='N' WHERE what='beg' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='beg' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='N', hidden='N', admin_only='N', mem_only='N' WHERE module='beg' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET visible='N', locked='Y' WHERE what='beg' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='N', locked='Y' WHERE what IN('beg','beg2') LIMIT 2"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_mod_reg` SET locked='Y' WHERE module='beg' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE what='beg' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what IN('beg','beg2') LIMIT 2"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='Y' WHERE module='beg' LIMIT 1"; break; case "update": // Update an extension @@ -107,7 +107,7 @@ case "update": // Update an extension break; case "0.0.3": // SQL queries for v0.0.3 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD beg_points_max FLOAT(20,5) UNSIGNED NOT NULL DEFAULT '0.10000'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD beg_points_max FLOAT(20,5) UNSIGNED NOT NULL DEFAULT '0.10000'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Maximale Obergrenze an {!POINTS!} einstellbar (Standart: 0,1 {!POINTS!})"; @@ -124,14 +124,14 @@ case "update": // Update an extension break; case "0.0.6": // SQL queries for v0.0.6 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD beg_uid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD beg_uid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Ein Mitgliedsaccount (empfehlenswert ist Ihr eigenes!) kann zum Abbuchen der {!POINTS!} verwendet werden. Template admin_config_beg.tpl (und pro!) nicht vergessen, zu aktualisieren."; break; case "0.0.8": // SQL queries for v0.0.8 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD beg_ip_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT 1800"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD beg_ip_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT 1800"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Zeitsperre gegen die selbe IP-Nummer hinzugefügt."; @@ -154,15 +154,15 @@ case "update": // Update an extension case "0.1.2": // SQL queries for v0.1.2 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD beg_mode ENUM('DIRECT','REF') NOT NULL DEFAULT 'REF'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD beg_ranks TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD beg_active ENUM('Y','N') NOT NULL DEFAULT 'N'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD beg_rallye ENUM('Y','N') NOT NULL DEFAULT 'N'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD beg_points FLOAT(21,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD beg_mode ENUM('DIRECT','REF') NOT NULL DEFAULT 'REF'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD beg_ranks TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD beg_active ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD beg_rallye ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD beg_points FLOAT(21,5) UNSIGNED NOT NULL DEFAULT 0.00000"; $VIS = "N"; $LOCKED = "Y"; if (EXT_IS_ACTIVE("beg")) { $VIS = "Y"; $LOCKED = "N"; } - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','beg2','Bettel-Rallye','".$VIS."','".$LOCKED."','7')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_beg','Bettel-Rallye','Listet alle Teilnehmer der monatlichen Bettel-Rallye auf.','12')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','beg2','Bettel-Rallye','".$VIS."','".$LOCKED."','7')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_beg','Bettel-Rallye','Listet alle Teilnehmer der monatlichen Bettel-Rallye auf.','12')"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Optionale Bettel-Rallye möglich. Und die erbettelten {!POINTS!} können entweder nur dem bettelndem Mitglied direkt oder auch seinem Werber gutgeschrieben werden können."; @@ -179,7 +179,7 @@ case "update": // Update an extension break; case "0.1.5": // SQL queries for v0.1.5 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET title='Bettellink/-rallye', descr='IP-Sperre, {!POINTS!}-Vergütung und auch die Bettel-Rallye können Sie hier einstellen.' WHERE what='config_beg' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET title='Bettellink/-rallye', descr='IP-Sperre, {!POINTS!}-Vergütung und auch die Bettel-Rallye können Sie hier einstellen.' WHERE what='config_beg' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Fehlendes Template im Admin-Bereich hinzugefügt. Im Admin-Bereich Hinweis hinzugefügt, wenn Bettel-Rallye inaktiv ist. Bitte Script inc/monthly_beg.php löschen!"; @@ -191,14 +191,14 @@ case "update": // Update an extension break; case "0.1.7": // SQL queries for v0.1.7 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD beg_ral_en_notify ENUM('Y','N') NOT NULL DEFAULT 'N'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD beg_ral_di_notify ENUM('Y','N') NOT NULL DEFAULT 'N'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD beg_new_mem_notify ENUM('Y','N') NOT NULL DEFAULT 'N'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD beg_notify_bonus FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD beg_notify_wait BIGINT(20) UNSIGNED NOT NULL DEFAULT '30'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD beg_ral_notify BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD beg_ral_en_notify BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD beg_ral_di_notify BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD beg_ral_en_notify ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD beg_ral_di_notify ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD beg_new_mem_notify ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD beg_notify_bonus FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD beg_notify_wait BIGINT(20) UNSIGNED NOT NULL DEFAULT '30'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD beg_ral_notify BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD beg_ral_en_notify BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD beg_ral_di_notify BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Die Mitglieder können nun optional automatisch über eine aktivierte und/oder deaktivierte Bettel-Rallye informiert werden. Beide Benachrichtigungen können Sie unter Einstellungen --> Bettel-Link/-rallye seperat ein- und ausschalten! Zudem ist eine Sperre gegen eingeloggte Mitglieder eingebaut, die das Klicken auf den eigenen Bettel-Link etwas erschweren soll."; @@ -225,7 +225,7 @@ case "update": // Update an extension break; case "0.2.2": // SQL queries for v0.2.2 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD beg_include_own ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD beg_include_own ENUM('Y','N') NOT NULL DEFAULT 'N'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Eigene User-ID von Bettel-Rallye ausschliessbar."; @@ -237,8 +237,8 @@ case "update": // Update an extension break; case "0.2.4": // SQL queries for v0.2.4 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET action='extras', sort='1' WHERE what='beg' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET action='rals', sort='3', title='Bettel-Rallye' WHERE what='beg2' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='extras', sort='1' WHERE what='beg' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='rals', sort='3', title='Bettel-Rallye' WHERE what='beg2' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Mitgliedsmenü komplett umgebaut."; @@ -250,8 +250,8 @@ case "update": // Update an extension break; case "0.2.6": // SQL queries for v0.2.6 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_beg_ips` ADD sid VARCHAR(255) NOT NULL DEFAULT ''"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `beg_pay_mode` ENUM('IMG','JS','BOTH','NONE') DEFAULT 'NONE' NOT NULL ;"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_beg_ips` ADD sid VARCHAR(255) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `beg_pay_mode` ENUM('IMG','JS','BOTH','NONE') DEFAULT 'NONE' NOT NULL ;"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "IP-Lock mit Session-ID erweitert. Tracker-Script eingefügt, dass das Einbinden des Bettel-Links als Bild/Script/CSS verhindern soll."; @@ -266,7 +266,7 @@ default: // Do stuff when extension is loaded // Remove old entries $OLD = getConfig('beg_timeout'); if (getConfig('beg_uid_timeout') > $OLD) $OLD = getConfig('beg_uid_timeout'); - $result_ext = SQL_QUERY("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_beg_ips` WHERE timeout < (UNIX_TIMESTAMP() -".($OLD + 60*60).")", __FILE__, __LINE__); + $result_ext = SQL_QUERY("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_beg_ips` WHERE timeout < (UNIX_TIMESTAMP() -".($OLD + 60*60).")", __FILE__, __LINE__); // Check for beg rallye is active and send mails out if ((getConfig('beg_rallye') == "Y") && (getConfig('beg_new_mem_notify') == "Y")) { diff --git a/inc/extensions/ext-birthday.php b/inc/extensions/ext-birthday.php index fd74abf307..15664c8d13 100644 --- a/inc/extensions/ext-birthday.php +++ b/inc/extensions/ext-birthday.php @@ -50,14 +50,14 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD birthday_sent VARCHAR(10) NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD birthday_sent VARCHAR(10) NOT NULL DEFAULT 0"; break; case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` DROP birthday_sent"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_user_birthday`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE what='config_birthday' LIMIT 1"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP birthday_sent"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_birthday`"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_birthday' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension @@ -79,9 +79,9 @@ case "update": // Update an extension break; case "0.2": // SQL queries for v0.2 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD birthday_points BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_user_birthday`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_user_birthday` ( + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD birthday_points BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_birthday`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_user_birthday` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, points BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -89,7 +89,7 @@ chk_value VARCHAR(255) NOT NULL DEFAULT '', KEY(userid), PRIMARY KEY(id) ) Type=MyISAM"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_birthday','Geburtstagsmails','Stellen Sie hier ein, ob die Mitglieder {!POINTS!} (nicht automatisch) gutgeschrieben kommen sollen oder nicht.', 9)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_birthday','Geburtstagsmails','Stellen Sie hier ein, ob die Mitglieder {!POINTS!} (nicht automatisch) gutgeschrieben kommen sollen oder nicht.', 9)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Es kann nun eine Gutschrift an die Geburtstagmail angehängt werden. Diese wird erst beim Klick auf einen Bestätigungslink gutgeschrieben."; @@ -161,8 +161,8 @@ PRIMARY KEY(id) break; case "0.3.6": // SQL queries for v0.3.6 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD birthday_mode ENUM('DIRECT','REF') NOT NULL DEFAULT 'DIRECT'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD birthday_active ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD birthday_mode ENUM('DIRECT','REF') NOT NULL DEFAULT 'DIRECT'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD birthday_active ENUM('Y','N') NOT NULL DEFAULT 'N'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Vergütungsmodus des Geburtstagsbonus einstellbar."; @@ -179,7 +179,7 @@ PRIMARY KEY(id) break; case "0.3.9": // SQL queries for v0.3.9 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` CHANGE `birth_day` `birth_day` SMALLINT(2) UNSIGNED ZEROFILL NOT NULL DEFAULT '01', + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` CHANGE `birth_day` `birth_day` SMALLINT(2) UNSIGNED ZEROFILL NOT NULL DEFAULT '01', CHANGE `birth_month` `birth_month` SMALLINT(2) UNSIGNED ZEROFILL NOT NULL DEFAULT '01', CHANGE `birth_year` `birth_year` SMALLINT(4) UNSIGNED ZEROFILL NOT NULL DEFAULT 1970"; diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php index 44133ab88a..70e8151cd8 100644 --- a/inc/extensions/ext-bonus.php +++ b/inc/extensions/ext-bonus.php @@ -50,10 +50,10 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES ('email','send_bonus','Bonusmail senden',5,'Versenden Sie hier Bonus-Mails an alle Mitglieder oder nur an alle aus einer Kategorie. Es spielt keine Rolle, wie viele Mails bereits versendet worden, Sie können hier immer senden.')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`, `what`, `title`, `sort`, `visible`, `locked`, `counter`) VALUES ('main','bonus','Bonuspunkte',7,'Y','Y', 0)"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_bonus`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_bonus` ( + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES ('email','send_bonus','Bonusmail senden',5,'Versenden Sie hier Bonus-Mails an alle Mitglieder oder nur an alle aus einer Kategorie. Es spielt keine Rolle, wie viele Mails bereits versendet worden, Sie können hier immer senden.')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`, `what`, `title`, `sort`, `visible`, `locked`, `counter`) VALUES ('main','bonus','Bonuspunkte',7,'Y','Y', 0)"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bonus`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_bonus` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, cat_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, subject VARCHAR(255) NOT NULL DEFAULT '', @@ -70,39 +70,39 @@ mails_sent BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, KEY(cat_id), PRIMARY KEY (id) )TYPE=MyISAM"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_links` MODIFY link_type ENUM('NORMAL','BONUS') NOT NULL DEFAULT 'NORMAL'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_links` ADD bonus_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_links` ADD INDEX (bonus_id)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_links` MODIFY link_type ENUM('NORMAL','BONUS') NOT NULL DEFAULT 'NORMAL'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_links` ADD bonus_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_links` ADD INDEX (bonus_id)"; // Run this SQL when html or html_mail extension is installed - if (EXT_IS_ACTIVE("html_mail")) $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_bonus` add html_msg ENUM('Y','N') NOT NULL DEFAULT 'N'"; + if (EXT_IS_ACTIVE("html_mail")) $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_bonus` add html_msg ENUM('Y','N') NOT NULL DEFAULT 'N'"; break; case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE what IN ('bonus','config_bonus','send_bonus','list_bonus','list_notifications') LIMIT 5"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_member_menu` WHERE what='bonus' LIMIT 1"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE action='bonus' LIMIT 1"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_links` MODIFY link_type ENUM('NORMAL') NOT NULL DEFAULT 'NORMAL'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_links` DROP bonus_id"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_bonus`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_bonus_urls`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_bonus_customer`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_bonus_turbo`"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN ('bonus','config_bonus','send_bonus','list_bonus','list_notifications') LIMIT 5"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='bonus' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE action='bonus' LIMIT 1"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_links` MODIFY link_type ENUM('NORMAL') NOT NULL DEFAULT 'NORMAL'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_links` DROP bonus_id"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bonus`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bonus_urls`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bonus_customer`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bonus_turbo`"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='Y', locked='N' WHERE what='bonus' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET visible='Y', locked='N' WHERE action='bonus' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_mod_reg` SET locked='N', hidden='N', admin_only='N', mem_only='N' WHERE module='show_bonus' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='bonus' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y', `locked`='N' WHERE action='bonus' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='N', hidden='N', admin_only='N', mem_only='N' WHERE module='show_bonus' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='N', locked='Y' WHERE what='bonus' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET visible='N', locked='Y' WHERE action='bonus' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_mod_reg` SET locked='Y' WHERE module='show_bonus' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='bonus' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE action='bonus' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='Y' WHERE module='show_bonus' LIMIT 1"; break; case "update": // Update an extension @@ -114,32 +114,32 @@ case "update": // Update an extension break; case "0.2.0": // SQL queries for v0.2.0 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_bonus` SET target_send=mails_sent WHERE target_send='0' AND mails_sent>0 AND receivers != ''"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_bonus` SET target_send=mails_sent WHERE target_send='0' AND mails_sent>0 AND receivers != ''"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Behebt ein Versand-Problem mit den Bonus-Mails. Es wurde die Spalte target_send nicht beim Einfügen der Buchung gessetzt. Bitte laden Sie sich dazu - wenn nicht bereits geschehen - alle Patches bis mindestens Patch 240 unter Updates prüfen herunter."; break; case "0.2.1": // SQL queries for v0.2.1 - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE what='config_bonus' LIMIT 1"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES ('setup','config_bonus','Bonus-{!POINTS!}',8,'Richten Sie Bonus-{!POINTS!} ein, die beim x'ten Klick auf die Mail verbucht werden sollen. Beispiele: Der 1. Klick sollte mehr {!POINTS!} zusätzlich bekommen, als der 10. Klick.')"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD login_bonus FLOAT(20,3) NOT NULL DEFAULT 10.000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD turbo_bonus FLOAT(20,3) NOT NULL DEFAULT 100.000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD login_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT ".getConfig('one_day').""; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD turbo_rates VARCHAR(255) NOT NULL DEFAULT '50;20;10'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD bonus_ranks TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_bonus' LIMIT 1"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES ('setup','config_bonus','Bonus-{!POINTS!}',8,'Richten Sie Bonus-{!POINTS!} ein, die beim x'ten Klick auf die Mail verbucht werden sollen. Beispiele: Der 1. Klick sollte mehr {!POINTS!} zusätzlich bekommen, als der 10. Klick.')"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD login_bonus FLOAT(20,3) NOT NULL DEFAULT 10.000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD turbo_bonus FLOAT(20,3) NOT NULL DEFAULT 100.000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD login_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT ".getConfig('one_day').""; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD turbo_rates VARCHAR(255) NOT NULL DEFAULT '50;20;10'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD bonus_ranks TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"; // Use actual month for this update - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD login_bonus FLOAT(20,3) NOT NULL DEFAULT 0.000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD turbo_bonus FLOAT(20,3) NOT NULL DEFAULT 0.000"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_extensions` SET ext_has_css='Y' WHERE ext_name='bonus' AND ext_has_css='N' LIMIT 1"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD login_bonus FLOAT(20,3) NOT NULL DEFAULT 0.000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD turbo_bonus FLOAT(20,3) NOT NULL DEFAULT 0.000"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_has_css='Y' WHERE ext_name='bonus' AND ext_has_css='N' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Login-Bonus und Turbo-Klick-Bonus intergriert."; break; case "0.2.2": // SQL queries for v0.2.2 - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_bonus_turbo`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_bonus_turbo` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bonus_turbo`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_bonus_turbo` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, mail_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -158,8 +158,8 @@ KEY userid (userid) break; case "0.2.3": // SQL queries for v0.2.3 - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_member_menu` WHERE what='bonus' LIMIT 1"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`, `what`, `title`, `sort`, `visible`, `locked`, `counter`) VALUES ('main','bonus','Aktiv-Rallye',7,'Y','Y', 0)"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='bonus' LIMIT 1"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`, `what`, `title`, `sort`, `visible`, `locked`, `counter`) VALUES ('main','bonus','Aktiv-Rallye',7,'Y','Y', 0)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Aktiv-Rallye mit Klick-Vergütung hinzugefügt."; @@ -171,8 +171,8 @@ KEY userid (userid) break; case "0.2.5": // SQL queries for v0.2.5 - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_bonus_urls`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_bonus_customer`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bonus_urls`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bonus_customer`"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Tabellen {!MYSQL_PREFIX!}_bonus_urls und {!MYSQL_PREFIX!}_bonus_customer entfernt, da dies bald von der Erweiterung paidlinks erledigt wird."; @@ -189,12 +189,12 @@ KEY userid (userid) break; case "0.2.8": // SQL queries for v0.2.8 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_bonus` SET timestamp='0' WHERE timestamp='0000000000'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_bonus_turbo` CHANGE points points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` CHANGE turbo_bonus turbo_bonus FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` CHANGE login_bonus login_bonus FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` CHANGE turbo_bonus turbo_bonus FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` CHANGE login_bonus login_bonus FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_bonus` SET timestamp='0' WHERE timestamp='0000000000'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_bonus_turbo` CHANGE points points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` CHANGE turbo_bonus turbo_bonus FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` CHANGE login_bonus login_bonus FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` CHANGE turbo_bonus turbo_bonus FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` CHANGE login_bonus login_bonus FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "5 Nachkommastellen implementiert"; @@ -226,15 +226,15 @@ KEY userid (userid) break; case "0.3.4": // SQL queries for v0.3.4 - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_bonus','Aktiv-Rallye-Teilnehmer','Listet alle Mitglieder auf, die einen Aktiv-Bonus haben und zeigt die derzeit möglichen Gewinner an.', 10)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_bonus','Aktiv-Rallye-Teilnehmer','Listet alle Mitglieder auf, die einen Aktiv-Bonus haben und zeigt die derzeit möglichen Gewinner an.', 10)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Link Aktiv-Rallye-Teilnehmer hinzugefügt, inklusive manuelle Vorbereitung der Vergütung."; break; case "0.3.5": // SQL queries for v0.3.5 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD bonus_mode ENUM('UID','JACKPOT','ADD') NOT NULL DEFAULT 'ADD'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD bonus_uid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD bonus_mode ENUM('UID','JACKPOT','ADD') NOT NULL DEFAULT 'ADD'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD bonus_uid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Der Login-Bonus Aktiv-Bonus (= Klick-Bonus) können nun zuerst von einem Mitgliederaccount (das sollte Ihres sein!), vom Jackpot abgezogen oder einfach dazuadiert werden."; @@ -261,8 +261,8 @@ KEY userid (userid) break; case "0.4.0": // SQL queries for v0.4.0 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD bonus_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*7).""; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD bonus_lines BIGINT(20) UNSIGNED NOT NULL DEFAULT 10"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD bonus_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*7).""; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD bonus_lines BIGINT(20) UNSIGNED NOT NULL DEFAULT 10"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Automatisches Löschen von Turbo-Bonus-Zeilen ({!MYSQL_PREFIX!}_bonus_turbo) und begrenzte Anzahl von Einträgen hinzugefügt."; @@ -284,14 +284,14 @@ KEY userid (userid) break; case "0.4.4": // SQL queries for v0.4.4 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD bonus_order FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 15.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD bonus_ref FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 100.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD bonus_stats FLOAT(20,5) UNSIGNED NOT NULL DEFAULT '5.00000'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD bonus_active ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD bonus_order FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD bonus_ref FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD bonus_stats FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_stats` ADD is_stats ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD bonus_order FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 15.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD bonus_ref FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 100.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD bonus_stats FLOAT(20,5) UNSIGNED NOT NULL DEFAULT '5.00000'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD bonus_active ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD bonus_order FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD bonus_ref FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD bonus_stats FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_stats` ADD is_stats ENUM('Y','N') NOT NULL DEFAULT 'N'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Bonus-{!POINTS!} für: Mailbestellung, Referal-Werbung (bei Best. der EMail-Adresse) und wenn 100% Klickrate jeder Mailbuchung erreicht wurde.
Template admin_config_bonus_pro.tpl ist überflüssig geworden. Bitte löschen Sie dies!
Eingestellte Bonus-{!POINTS!} für Rank 2 war um eins verschoben."; @@ -308,7 +308,7 @@ KEY userid (userid) break; case "0.4.7": // SQL queries for v0.4.7 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_user_data` SET login_bonus=0, turbo_bonus=0,bonus_ref=0,bonus_order=0,bonus_stats=0"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_user_data` SET login_bonus=0, turbo_bonus=0,bonus_ref=0,bonus_order=0,bonus_stats=0"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Die Aktiv-Rallye wurde nicht auf 0 {!POINTS!} gesetzt. Dieser Fehler ist nun behoben. Allerdings ist mit diesem Update auch die Aktiv-Rallye zurückgesetzt worden."; @@ -364,7 +364,7 @@ KEY userid (userid) $mark = mktime(0, 0, 0, $curr, 1, date('Y', time())); // Update accounts which are not active last months - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_user_data` + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_user_data` SET turbo_bonus=0, login_bonus=0, bonus_order=0, bonus_stats=0, bonus_ref=0 WHERE last_online < ".$mark." ORDER BY userid"; @@ -401,14 +401,14 @@ WHERE last_online < ".$mark." ORDER BY userid"; break; case "0.6.4": // SQL queries for v0.6.4 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET title='Aktiv-Rallye' WHERE what='config_bonus' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET title='Aktiv-Rallye' WHERE what='config_bonus' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Der Menüpunkt "Bonus-{!POINTS!}" unter Einstellungen wird nach "Aktiv-Rallye umbenannt. Und die Aktiv-Rallye konnte aufgrund eines Template-Fehlers nicht gespeichert werden."; break; case "0.6.5": // SQL queries for v0.6.5 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_stats` ADD bonus_stats ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_stats` ADD bonus_stats ENUM('Y','N') NOT NULL DEFAULT 'N'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Fehler mit bonus_stats beseitigt."; @@ -423,18 +423,18 @@ WHERE last_online < ".$mark." ORDER BY userid"; break; case "0.6.8": // SQL queries for v0.6.8 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_bonus` SET data_type='SEND' WHERE data_type != 'SEND' AND data_type != 'DELETED' AND receivers='' AND target_send='0'"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_bonus` SET data_type='SEND' WHERE data_type != 'SEND' AND data_type != 'DELETED' AND receivers='' AND target_send='0'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Eingegebene Anzahl auszusendener Bonus-Mails wurde bei der Empfänderauswahl nicht berücksichtigt. Zudem wird jetzt das eingestellte Auswahlverfahren mitberücksichtigt."; break; case "0.6.9": // SQL queries for v0.6.9 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD bonus_order_yn ENUM('Y','N') NOT NULL DEFAULT 'N'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD bonus_ref_yn ENUM('Y','N') NOT NULL DEFAULT 'N'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD bonus_stats_yn ENUM('Y','N') NOT NULL DEFAULT 'N'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD bonus_login_yn ENUM('Y','N') NOT NULL DEFAULT 'N'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD bonus_click_yn ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD bonus_order_yn ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD bonus_ref_yn ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD bonus_stats_yn ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD bonus_login_yn ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD bonus_click_yn ENUM('Y','N') NOT NULL DEFAULT 'Y'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Es können nun auch die folgenden Vergütungen bei der Auswertung der monatlichen Aktiv-Rallye mit berücksichtigt werden: Mailbestätigung (war vorher schon), Login-, Mailbuchung, Referal und Statistik-Bonus (100% Klickrate erreicht)."; @@ -469,14 +469,14 @@ WHERE last_online < ".$mark." ORDER BY userid"; break; case "0.7.7": // SQL queries for v0.7.7 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD bonus_en_notify ENUM('Y','N') NOT NULL DEFAULT 'N'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD bonus_di_notify ENUM('Y','N') NOT NULL DEFAULT 'N'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD bonus_new_mem_notify ENUM('Y','N') NOT NULL DEFAULT 'N'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD bonus_notify_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD bonus_notify_wait BIGINT(20) UNSIGNED NOT NULL DEFAULT '30'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD bonus_ral_notify BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD bonus_ral_en_notify BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD bonus_ral_di_notify BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD bonus_en_notify ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD bonus_di_notify ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD bonus_new_mem_notify ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD bonus_notify_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD bonus_notify_wait BIGINT(20) UNSIGNED NOT NULL DEFAULT '30'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD bonus_ral_notify BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD bonus_ral_en_notify BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD bonus_ral_di_notify BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Optionale automatische Benachrichtigung über aktivierte und/oder deaktivierte Aktiv-Rallye einstellbar."; @@ -500,15 +500,15 @@ WHERE last_online < ".$mark." ORDER BY userid"; break; case "0.8.2": // SQL queries for v0.8.2 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD bonus_include_own ENUM('Y','N') NOT NULL DEFAULT 'N'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_bonus` ADD is_notify ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD bonus_include_own ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_bonus` ADD is_notify ENUM('Y','N') NOT NULL DEFAULT 'N'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Eigene User-ID von Aktiv-Rallye ausschliessbar. Benachrichtigungsmails sind von Aktiv-Rallye ausgeschlossen."; break; case "0.8.3": // SQL queries for v0.8.3 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET action='rals', sort='2', title='Aktiv-Rallye' WHERE what='bonus' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='rals', sort='2', title='Aktiv-Rallye' WHERE what='bonus' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Mitgliedsmenü komplett umgebaut."; @@ -527,14 +527,14 @@ WHERE last_online < ".$mark." ORDER BY userid"; break; case "0.8.7": // SQL queries for v0.8.7 - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','list_notifications','Benachrichtigungen','Listet alle an die Mitglieder ausgesandten Benachrichtigungen auf.', 10)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','list_notifications','Benachrichtigungen','Listet alle an die Mitglieder ausgesandten Benachrichtigungen auf.', 10)"; // Update notes $UPDATE_NOTES = "Benachrichtigungsmails für z.B. Bettel- oder Aktiv-Rallye werden nun angezeigt."; break; case "0.8.8": // SQL queries for v0.8.8 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_stats` ADD bonus_stats_active ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_stats` ADD bonus_stats_active ENUM('Y','N') NOT NULL DEFAULT 'N'"; // Update notes $UPDATE_NOTES = "Benachrichtigungsmails für z.B. Bettel- oder Aktiv-Rallye werden nun angezeigt."; diff --git a/inc/extensions/ext-booking.php b/inc/extensions/ext-booking.php index 821f70b150..54a3eb205c 100644 --- a/inc/extensions/ext-booking.php +++ b/inc/extensions/ext-booking.php @@ -50,12 +50,12 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // Configuration entries - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `booking_per_page` TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `booking_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day') * 3).""; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `booking_per_page` TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `booking_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day') * 3).""; // Drop/create table for user bookings - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_user_book`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_user_book`( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_book`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_user_book`( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `subject` VARCHAR(255) NOT NULL DEFAULT 'missing', @@ -66,27 +66,27 @@ PRIMARY KEY(`id`) ) TYPE=MyISAM COMMENT='Member points booking table'"; // Admin menu - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_booking','Kontoauszug','Einstellungen am Kontoauszug für Mitglieder vornehmen.', 14)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_booking','Kontoauszug','Kontoauszüge aller Ihrer Mitglieder oder eines einzelnen Mitgliedes anzeigen.',10)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_booking','Kontoauszug','Einstellungen am Kontoauszug für Mitglieder vornehmen.', 14)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_booking','Kontoauszug','Kontoauszüge aller Ihrer Mitglieder oder eines einzelnen Mitgliedes anzeigen.',10)"; // Member menu - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','booking','{!POINTS!}-Kontoauszug',5,'Y','Y')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','booking','{!POINTS!}-Kontoauszug',5,'Y','Y')"; break; case "remove": // Do stuff when removing extension - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_user_book`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE `what` IN ('config_booking','list_booking') LIMIT 2"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_member_menu` WHERE `what`='booking' LIMIT 1"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_book`"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what` IN ('config_booking','list_booking') LIMIT 2"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='booking' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='Y', locked='N' WHERE what='booking' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='booking' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='N', locked='Y' WHERE what='booking' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='booking' LIMIT 1"; break; case "update": // Update an extension diff --git a/inc/extensions/ext-cache.php b/inc/extensions/ext-cache.php index edf26ee900..5a0dc15e6d 100644 --- a/inc/extensions/ext-cache.php +++ b/inc/extensions/ext-cache.php @@ -51,15 +51,15 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD cache_update BIGINT(20) UNSIGNED NOT NULL DEFAULT 3600"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD cache_path VARCHAR(255) NOT NULL DEFAULT 'cache/'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD cache_tested TINYINT(1) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_cache','Cache-Einstellungen','Update-Interval des Caches usw. können Sie hier ändern.', 9)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD cache_update BIGINT(20) UNSIGNED NOT NULL DEFAULT 3600"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD cache_path VARCHAR(255) NOT NULL DEFAULT 'cache/'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD cache_tested TINYINT(1) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_cache','Cache-Einstellungen','Update-Interval des Caches usw. können Sie hier ändern.', 9)"; break; case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE what='config_cache' OR what='cache_stats' LIMIT 2"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_cache' OR what='cache_stats' LIMIT 2"; // Unregister all filters UNREGISTER_FILTER('extension_update', 'CACHE_DESTROY_ON_EXT_CHANGE', true, $dry_run); @@ -124,9 +124,9 @@ case "update": // Update an extension break; case "0.0.7": // SQL queries for v0.0.7 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD db_hits BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD cache_hits BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('stats','cache_stats','DB-Cache','Auf Cache und gesamte Datenbank registrierte Anfragen anzeigen.', 4)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD db_hits BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD cache_hits BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('stats','cache_stats','DB-Cache','Auf Cache und gesamte Datenbank registrierte Anfragen anzeigen.', 4)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Hits auf den Cache werden gezählt."; @@ -158,13 +158,13 @@ case "update": // Update an extension break; case "0.1.3": // SQL queries for v0.1.3 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD cache_admins ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD cache_acls ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD cache_exts ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD cache_config ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD cache_modreg ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD cache_refdepth ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD cache_refsys ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD cache_admins ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD cache_acls ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD cache_exts ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD cache_config ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD cache_modreg ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD cache_refdepth ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD cache_refsys ENUM('Y','N') NOT NULL DEFAULT 'Y'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Alle cache-baren Tabellen sind nun einzelnt ein- bzw. ausschaltbar. Falls die eine oder andere ausgelagerte Tabelle also Fehler verursachen sollte, so können Sie diese hier abschalten. Beachten Sie aber bitte, dass dann mehr Abfragen an die Datenbank gestellt wird und dies bedeutend mehr Zeit braucht, als nur die Daten aus einem Datenfeld zu laden, das sich im Speicher aufhält."; @@ -191,14 +191,14 @@ case "update": // Update an extension break; case "0.1.8": // SQL queries for v0.1.8 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD cache_themes ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD cache_themes ENUM('Y','N') NOT NULL DEFAULT 'Y'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Daten von installierten Themes werden nun gecacht."; break; case "0.1.9": // SQL queries for v0.1.9 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD cache_admin_menu ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD cache_admin_menu ENUM('Y','N') NOT NULL DEFAULT 'N'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Administratormenü experimentell gecacht."; diff --git a/inc/extensions/ext-country.php b/inc/extensions/ext-country.php index 5bed3a3d1e..cb40121173 100644 --- a/inc/extensions/ext-country.php +++ b/inc/extensions/ext-country.php @@ -50,8 +50,8 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_countries`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_countries` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_countries`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_countries` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, code CHAR(2) NOT NULL DEFAULT 'DE', descr VARCHAR(255) NOT NULL DEFAULT 'Deutschland', @@ -59,20 +59,20 @@ is_active ENUM('Y','N') NOT NULL DEFAULT 'N', KEY(code), PRIMARY KEY(id) ) TYPE=MyISAM"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_countries` (code, descr, is_active) VALUES ('DE','Deutschland','Y')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_countries` (code, descr, is_active) VALUES ('DE','Deutschland','Y')"; // Admin menu - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('country', NULL, 'Ländercodes verwalten','Stellen Sie hier Ländercodes ein, damit auch internationale Mitglieder sich zu Ihrem {!MT_WORD!} anmelden können.', 8)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('country','list_country','Verwalten','Hinzufügen, Ändern und Löschen von Ländercodes.', 1)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('country', NULL, 'Ländercodes verwalten','Stellen Sie hier Ländercodes ein, damit auch internationale Mitglieder sich zu Ihrem {!MT_WORD!} anmelden können.', 8)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('country','list_country','Verwalten','Hinzufügen, Ändern und Löschen von Ländercodes.', 1)"; // Add entry to user table - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD country_code BIGINT(20) UNSIGNED NOT NULL DEFAULT 1"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD country_code BIGINT(20) UNSIGNED NOT NULL DEFAULT 1"; break; case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_countries`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE action='country' LIMIT 2"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_countries`"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='country' LIMIT 2"; break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-debug.php b/inc/extensions/ext-debug.php index f8e51a88ef..17ca9c85c6 100644 --- a/inc/extensions/ext-debug.php +++ b/inc/extensions/ext-debug.php @@ -50,8 +50,8 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // Table for debug log entries - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_debug_log`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_debug_log` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_debug_log`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_debug_log` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `sender_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00', @@ -66,8 +66,8 @@ PRIMARY KEY (`id`) ) TYPE=MyISAM COMMENT='Debug log data'"; // Table against debug log abuse - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_debug_log_abuse`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_debug_log_abuse` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_debug_log_abuse`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_debug_log_abuse` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `client_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00', @@ -78,8 +78,8 @@ PRIMARY KEY (`id`) ) TYPE=MyISAM COMMENT='Debug log abuse'"; // Table on relay/server for client exchanges - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_debug_client`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_debug_client` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_debug_client`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_debug_client` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `key` VARCHAR(255) NOT NULL DEFAULT 'SELF', `url` VARCHAR(255) NOT NULL DEFAULT '', @@ -95,11 +95,11 @@ PRIMARY KEY (`id`) ) TYPE=MyISAM COMMENT='Debug clients'"; // Add this exchange as first client - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_debug_client` (`url`,`title`,`webmaster`,`status`) VALUES ('{!URL!}','{!MAIN_TITLE!}','{!WEBMASTER!}','ACTIVE')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_debug_client` (`url`,`title`,`webmaster`,`status`) VALUES ('{!URL!}','{!MAIN_TITLE!}','{!WEBMASTER!}','ACTIVE')"; // Table for debug log <-> client connection - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_debug_client_log`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_debug_client_log` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_debug_client_log`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_debug_client_log` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `client_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 1, `log_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -109,48 +109,48 @@ PRIMARY KEY (`id`) ) TYPE=MyISAM COMMENT='Debug client <-> log connection'"; // Guest menus - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('debug',NULL,'Debug-System','Y','Y',2)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('debug','debug_info','Informationen','Y','Y',1)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('debug','debug_reg','Anmeldung','Y','Y',2)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('debug','debug_unreg','Abmeldung','Y','Y',3)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('debug','debug_pilory','Spam-Pranger','Y','Y',4)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('debug',NULL,'Debug-System','Y','Y',2)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('debug','debug_info','Informationen','Y','Y',1)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('debug','debug_reg','Anmeldung','Y','Y',2)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('debug','debug_unreg','Abmeldung','Y','Y',3)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('debug','debug_pilory','Spam-Pranger','Y','Y',4)"; // Admin menu - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('debug',NULL,'Debug-System','Verwalten Sie hier komfortabel das debug.log, welches sich im Verzeichnis inc/cache/ befindet.',10)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('debug','import_debug','debug.log importieren','Importieren Sie hier manuell die debug.log, damit neue Einträge mit bestehenden abgeglichen werden können und dann evtl. hinzugefügt werden. Die debug.log wird nach dem Import automatisch vom Server entfernt. Dieser Vorgang wird für Sie nachts automatisch erledigt!',1)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('debug','list_debug','Einträge anzeigen','Listet alle bereits importierten Einträge auf. Von hier aus versenden Sie noch nicht gemeldete Fehler an das Relay-Netzwerk, damt diese vom MXChange-Team geprüft werden können.',2)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('debug','reg_debug','Am Server anmelden','Sie müssen zuerst Ihren Debug-Client (Ihr {!MT_WORD!} ist dies) oder Relay am Server von MXChange.org anmelden. Dies geschieht für Sie nicht automatisch, da Sie Ihre Daten zuvor überprüfen müssen, wie z.B. URL, eMail-Adresse und {!MT_WORD!}-Titel.',3)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('debug','unreg_debug','Vom Server abmelden','Melden Sie bitte Ihren {!MT_WORD!} wieder vom MXChange-Server ab, damit das Team von MXChange.org weiss, welche Keys nicht mehr genutzt werden.',4)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('debug','config_debug','Einstellungen','Ändern Sie hier alle Einstellungen, wie auch den Debug-Modus - ob Client, Hub oder selber Server sein. Lesen Sie dazu die Anleitung unter DOCs/de/debug/README.txt durch! Oder kommen Sie in's Forum. Das Team von MXChange.org hilft Ihnen gerne weiter.',5)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('debug',NULL,'Debug-System','Verwalten Sie hier komfortabel das debug.log, welches sich im Verzeichnis inc/cache/ befindet.',10)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('debug','import_debug','debug.log importieren','Importieren Sie hier manuell die debug.log, damit neue Einträge mit bestehenden abgeglichen werden können und dann evtl. hinzugefügt werden. Die debug.log wird nach dem Import automatisch vom Server entfernt. Dieser Vorgang wird für Sie nachts automatisch erledigt!',1)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('debug','list_debug','Einträge anzeigen','Listet alle bereits importierten Einträge auf. Von hier aus versenden Sie noch nicht gemeldete Fehler an das Relay-Netzwerk, damt diese vom MXChange-Team geprüft werden können.',2)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('debug','reg_debug','Am Server anmelden','Sie müssen zuerst Ihren Debug-Client (Ihr {!MT_WORD!} ist dies) oder Relay am Server von MXChange.org anmelden. Dies geschieht für Sie nicht automatisch, da Sie Ihre Daten zuvor überprüfen müssen, wie z.B. URL, eMail-Adresse und {!MT_WORD!}-Titel.',3)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('debug','unreg_debug','Vom Server abmelden','Melden Sie bitte Ihren {!MT_WORD!} wieder vom MXChange-Server ab, damit das Team von MXChange.org weiss, welche Keys nicht mehr genutzt werden.',4)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('debug','config_debug','Einstellungen','Ändern Sie hier alle Einstellungen, wie auch den Debug-Modus - ob Client, Hub oder selber Server sein. Lesen Sie dazu die Anleitung unter DOCs/de/debug/README.txt durch! Oder kommen Sie in's Forum. Das Team von MXChange.org hilft Ihnen gerne weiter.',5)"; // Config entries - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `debug_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `debug_key` VARCHAR(255) NOT NULL DEFAULT ''"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `debug_mode` ENUM('CLIENT','RELAY','SERVER') NOT NULL DEFAULT 'CLIENT'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `debug_new_log` ENUM('ACCEPT','FIRST','REG') NOT NULL DEFAULT 'FIRST'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `debug_new_client` ENUM('ACTIVE','NEW','REG') NOT NULL DEFAULT 'NEW'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `debug_reject_log` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day') * 30).""; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `debug_master_url` VARCHAR(255) NOT NULL DEFAULT '{!SERVER_URL!}'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `debug_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `debug_key` VARCHAR(255) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `debug_mode` ENUM('CLIENT','RELAY','SERVER') NOT NULL DEFAULT 'CLIENT'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `debug_new_log` ENUM('ACCEPT','FIRST','REG') NOT NULL DEFAULT 'FIRST'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `debug_new_client` ENUM('ACTIVE','NEW','REG') NOT NULL DEFAULT 'NEW'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `debug_reject_log` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day') * 30).""; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `debug_master_url` VARCHAR(255) NOT NULL DEFAULT '{!SERVER_URL!}'"; break; case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_debug_client_log`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_debug_client`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_debug_log`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_debug_log_abuse`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE `action`='debug' LIMIT 5"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE `action`='debug' LIMIT 6"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_debug_client_log`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_debug_client`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_debug_log`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_debug_log_abuse`"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='debug' LIMIT 5"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='debug' LIMIT 6"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET `visible`='Y',`locked`='N' WHERE `action`='debug' LIMIT 5"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y',`locked`='N' WHERE `action`='debug' LIMIT 5"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET `locked`='Y' WHERE `action`='debug' LIMIT 5"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `locked`='Y' WHERE `action`='debug' LIMIT 5"; break; case "update": // Update an extension diff --git a/inc/extensions/ext-doubler.php b/inc/extensions/ext-doubler.php index 08e7087249..2a9dac417f 100644 --- a/inc/extensions/ext-doubler.php +++ b/inc/extensions/ext-doubler.php @@ -50,8 +50,8 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // Doubler table - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_doubler`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_doubler` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_doubler`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_doubler` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, refid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -69,72 +69,72 @@ PRIMARY KEY(id) // --- SETTINGS --- // // Minimum points to double - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD doubler_min FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 100.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD doubler_min FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 100.00000"; // Maximum points to double - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD doubler_max FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 10000.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD doubler_max FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 10000.00000"; // Points left on users account after doubling - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD doubler_left BIGINT(20) UNSIGNED NOT NULL DEFAULT 1000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD doubler_left BIGINT(20) UNSIGNED NOT NULL DEFAULT 1000"; // Charge for doubling points which goes to the webmaster (shreddered in fact!) - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD doubler_charge FLOAT(7,5) UNSIGNED NOT NULL DEFAULT 0.03000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD doubler_charge FLOAT(7,5) UNSIGNED NOT NULL DEFAULT 0.03000"; // Referal percents - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD doubler_ref FLOAT(7,5) UNSIGNED NOT NULL DEFAULT 0.02000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD doubler_ref FLOAT(7,5) UNSIGNED NOT NULL DEFAULT 0.02000"; // Shall I use the jackpot to take points from? (Y/N, default=Y) - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD doubler_jackpot ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD doubler_jackpot ENUM('Y','N') NOT NULL DEFAULT 'Y'"; // A user account to take points from (default: 0->none) - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD doubler_uid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD doubler_uid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; // Total payed out points from your doublers - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD doubler_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD doubler_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; // Sending mode of mails (immediately/daily reset) // --> This also means who fast the doubled points will be payed out! - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD doubler_send_mode ENUM('DIRECT','RESET') NOT NULL DEFAULT 'DIRECT'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD doubler_send_mode ENUM('DIRECT','RESET') NOT NULL DEFAULT 'DIRECT'"; // Timeout for entries to be purged (default: one week) - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD doubler_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*7).""; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD doubler_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*7).""; // Number of newest entries to display - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD doubler_display_new TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD doubler_display_new TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"; // Number of entries which will be payed out soon - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD doubler_display_pay TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD doubler_display_pay TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"; // Number of entries which are already payed out - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD doubler_display_old TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD doubler_display_old TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"; // Points used by every member - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD doubler_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD doubler_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; // Counter for usage of the doubler - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD doubler_counter BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD doubler_counter BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; // // --- MENU SYSTEMS --- // // Admin menu - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('doubler', NULL, '{!POINTS!}-Verdoppler','Einstellungen und Einträge auflisten.', 4)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('doubler','list_doubler','Auflisten','Einträge aus der Verdiensttabelle auflisten', 1)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('doubler','config_doubler','Einstellungen','Prozentuale Gebühr usw. einstellen.', 2)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('doubler', NULL, '{!POINTS!}-Verdoppler','Einstellungen und Einträge auflisten.', 4)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('doubler','list_doubler','Auflisten','Einträge aus der Verdiensttabelle auflisten', 1)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('doubler','config_doubler','Einstellungen','Prozentuale Gebühr usw. einstellen.', 2)"; // Guest menu (informations / default doubler link) - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','doubler','Verdoppeln!',3,'Y','Y')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','doubler','Verdoppeln!',3,'Y','Y')"; // Member menu - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','doubler','Verdoppeln!','Y','Y',7)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','doubler','Verdoppeln!','Y','Y',7)"; break; case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_doubler`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE action='doubler' LIMIT 3"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE what='doubler' LIMIT 1"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_member_menu` WHERE what='doubler' LIMIT 1"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_doubler`"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='doubler' LIMIT 3"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE what='doubler' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='doubler' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='Y', locked='N' WHERE what='doubler' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET visible='Y', locked='N' WHERE what='doubler' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_mod_reg` SET locked='N', hidden='N', admin_only='N', mem_only='N' WHERE module='doubler' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='doubler' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y', `locked`='N' WHERE what='doubler' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='N', hidden='N', admin_only='N', mem_only='N' WHERE module='doubler' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='N', locked='Y' WHERE what='doubler' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET visible='N', locked='Y' WHERE what='doubler' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_mod_reg` SET locked='Y' WHERE module='doubler' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='doubler' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE what='doubler' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='Y' WHERE module='doubler' LIMIT 1"; break; case "update": // Update an extension @@ -147,7 +147,7 @@ case "update": // Update an extension case "0.0.2": // SQL queries for v0.0.2 // Total used points - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD doubler_used FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD doubler_used FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Gebühr wird vom Verdoppler-Pott abgezogen."; @@ -160,7 +160,7 @@ case "update": // Update an extension case "0.0.4": // SQL queries for v0.0.4 // Shall I use the doubler's account to take points from? (Y/N, default=Y) - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD doubler_own ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD doubler_own ENUM('Y','N') NOT NULL DEFAULT 'Y'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = POINTS."-Guthaben des Verdopplers kann optional nicht mit einbezogen werden."; @@ -172,9 +172,9 @@ case "update": // Update an extension break; case "0.0.6": // SQL queries for v0.0.6 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD doubler_max_sent TINYINT(3) UNSIGNED NOT NULL DEFAULT 1"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD doubler_group_sent TINYINT(3) UNSIGNED NOT NULL DEFAULT 1"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD doubler_sent_all ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD doubler_max_sent TINYINT(3) UNSIGNED NOT NULL DEFAULT 1"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD doubler_group_sent TINYINT(3) UNSIGNED NOT NULL DEFAULT 1"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD doubler_sent_all ENUM('Y','N') NOT NULL DEFAULT 'Y'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Gebührenabzug wird beim Einzahlen abgezogen (wurde von Auszahlung abgezogen) und maximal bei Auszahlung zu kontrollierende Accounts einstellbar.
Template admin_config_doubler_pro.tpl ist überflüssig geworden. Bitte löschen Sie dies!"; @@ -216,7 +216,7 @@ case "update": // Update an extension break; case "0.1.4": // SQL queries for v0.1.4 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET action='extras', sort='4' WHERE what='doubler' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='extras', sort='4' WHERE what='doubler' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Mitgliedsmenü komplett umgebaut."; diff --git a/inc/extensions/ext-holiday.php b/inc/extensions/ext-holiday.php index 62e9b2c3e0..bdcaca1767 100644 --- a/inc/extensions/ext-holiday.php +++ b/inc/extensions/ext-holiday.php @@ -50,8 +50,8 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // Create database - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_user_holidays`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_user_holidays` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_holidays`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_user_holidays` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, holiday_start VARCHAR(10) NOT NULL DEFAULT 0, @@ -62,38 +62,38 @@ PRIMARY KEY(id) ) TYPE=MyISAM"; // Add default values to config - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD holiday_max BIGINT(20) UNSIGNED NOT NULL DEFAULT '30'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD holiday_max BIGINT(20) UNSIGNED NOT NULL DEFAULT '30'"; // Add member menu - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','holiday','Urlaubsschaltung','4','Y','Y')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','holiday','Urlaubsschaltung','4','Y','Y')"; // Add admin menus - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('holiday', NULL, 'Urlaubsmanagement','4','Hier können Sie Urlaubsschaltungen Ihrer Mitglieder auflisten oder auch wieder aufheben.')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('holiday','list_holiday','Auflisten','1','Alle Urlaubsschaltungen auflisten.')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('holiday','del_holiday','Urlaub beenden','2','Urlaubsschaltungen aufheben. Geben Sie bitte mehr als nur "Verstoss gegen unsere AGBs" ein!')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('holiday','config_holiday','Einstellungen','3','Maximale Tage für Urlaub usw. einstellen.')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('holiday', NULL, 'Urlaubsmanagement','4','Hier können Sie Urlaubsschaltungen Ihrer Mitglieder auflisten oder auch wieder aufheben.')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('holiday','list_holiday','Auflisten','1','Alle Urlaubsschaltungen auflisten.')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('holiday','del_holiday','Urlaub beenden','2','Urlaubsschaltungen aufheben. Geben Sie bitte mehr als nur "Verstoss gegen unsere AGBs" ein!')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('holiday','config_holiday','Einstellungen','3','Maximale Tage für Urlaub usw. einstellen.')"; // Remove 0 max mails per day - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_max_receive` WHERE value='0' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_max_receive` WHERE value='0' LIMIT 1"; break; case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_user_holidays`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_member_menu` WHERE what='holiday' LIMIT 1"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE action='holiday' LIMIT 4"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_max_receive` WHERE value='0' LIMIT 1"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_max_receive` (value, comment) VALUES ('0','Urlaub')"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_holidays`"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='holiday' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='holiday' LIMIT 4"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_max_receive` WHERE value='0' LIMIT 1"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_max_receive` (value, comment) VALUES ('0','Urlaub')"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='Y', locked='N' WHERE what='holiday' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='holiday' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='N', locked='Y' WHERE what='holiday' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='holiday' LIMIT 1"; break; case "update": // Update an extension @@ -155,30 +155,30 @@ case "update": // Update an extension break; case "0.1.3": // SQL queries for v0.1.3 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD holiday_active ENUM('Y','N') NOT NULL DEFAULT 'N'"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_max_receive` WHERE value='0' LIMIT 1"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD holiday_lock BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getConfig('one_day')*2)."'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD holiday_active ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_max_receive` WHERE value='0' LIMIT 1"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD holiday_lock BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getConfig('one_day')*2)."'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Die Mitglieder-Accounts werden nicht mehr gesperrt, sondern nur auf Urlaub geschaltet. Lassen Sie sich nicht davon verwirren, dass sie "freigegeben" sind!"; break; case "0.1.4": // SQL queries for v0.1.4 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD holiday_mode ENUM('DIRECT','RESET') NOT NULL DEFAULT 'RESET'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD holiday_mode ENUM('DIRECT','RESET') NOT NULL DEFAULT 'RESET'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Urlaubsschaltung wird erst Abends um 00:00 Uhr aktiv und nicht durch die Beantragung. Dies kann nun auch auf direkte Umstellung eingestellt werden."; break; case "0.1.5": // SQL queries for v0.1.5 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD holiday_mode ENUM('DIRECT','RESET') NOT NULL DEFAULT 'RESET'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD holiday_mode ENUM('DIRECT','RESET') NOT NULL DEFAULT 'RESET'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Sicherheitsupdate für die Include-Befehle."; break; case "0.1.6": // SQL queries for v0.1.6 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD holiday_activated BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD holiday_activated BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Fehlende Tabellenspalte hinzugefügt."; @@ -190,9 +190,9 @@ case "update": // Update an extension break; case "0.1.8": // SQL queries for v0.1.8 - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu_las` (la_id, la_action, la_what) VALUES ('member', '', 'list_holiday')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu_las` (la_id, la_action, la_what) VALUES ('member', '', 'del_holiday')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu_las` (la_id, la_action, la_what) VALUES ('config', '', 'config_holiday')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu_las` (la_id, la_action, la_what) VALUES ('member', '', 'list_holiday')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu_las` (la_id, la_action, la_what) VALUES ('member', '', 'del_holiday')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu_las` (la_id, la_action, la_what) VALUES ('config', '', 'config_holiday')"; // Depends on sql_patches (or you have to execute these both SQL statements by phpMyAdmin $EXT_UPDATE_DEPENDS = "sql_patches"; @@ -202,14 +202,14 @@ case "update": // Update an extension break; case "0.1.9": // SQL queries for v0.1.9 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET action='account', sort='2', title='In Urlaub' WHERE what='holiday' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='account', sort='2', title='In Urlaub' WHERE what='holiday' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Mitgliedsmenü komplett umgebaut."; break; case "0.2.0": // SQL queries for v0.2.0 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET title = 'Urlaubsmanagement' WHERE action = 'holiday' AND (what='' OR what IS NULL) LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET title = 'Urlaubsmanagement' WHERE action = 'holiday' AND (what='' OR `what` IS NULL) LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Mitgliedsmenü komplett umgebaut."; diff --git a/inc/extensions/ext-html_mail.php b/inc/extensions/ext-html_mail.php index 7b9d75e805..e2e80cdf57 100644 --- a/inc/extensions/ext-html_mail.php +++ b/inc/extensions/ext-html_mail.php @@ -50,28 +50,28 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD html ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_bonus` ADD html_msg ENUM('Y','N') NOT NULL DEFAULT 'N'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_pool` ADD html_msg ENUM('Y','N') NOT NULL DEFAULT 'N'"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','html_mail','HTML-Empfang','3','Y','Y')"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD html ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_bonus` ADD html_msg ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_pool` ADD html_msg ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','html_mail','HTML-Empfang','3','Y','Y')"; break; case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` DROP html"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_bonus` DROP html_msg"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_pool` DROP html_msg"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_member_menu` WHERE what='html_mail' LIMIT 1"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP html"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_bonus` DROP html_msg"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_pool` DROP html_msg"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='html_mail' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='Y', locked='N' WHERE what='html_mail' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='html_mail' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='N', locked='Y' WHERE what='html_mail' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='html_mail' LIMIT 1"; break; case "update": // Update an extension diff --git a/inc/extensions/ext-iso3166.php b/inc/extensions/ext-iso3166.php index c323d11509..b905f277c8 100644 --- a/inc/extensions/ext-iso3166.php +++ b/inc/extensions/ext-iso3166.php @@ -53,26 +53,26 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE FROM `{!MYSQL_PREFIX!}_countries` WHERE provider = 'ext-iso3166';"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_countries` DROP `provider`;"; + $SQLs[] = "DELETE FROM `{!_MYSQL_PREFIX!}_countries` WHERE provider = 'ext-iso3166';"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_countries` DROP `provider`;"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_countries` SET is_active = 'Y' WHERE provider = 'ext-iso3166';"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_countries` SET is_active = 'Y' WHERE provider = 'ext-iso3166';"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_countries` SET is_active='N' WHERE provider = 'ext-iso3166';"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_countries` SET is_active='N' WHERE provider = 'ext-iso3166';"; break; case "update": // Update an extension switch ($EXT_VER) { case "0.0.1": // SQL queries for v0.0.2 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_countries` ADD `provider` ENUM( 'user', 'ext-iso3166' ) NOT NULL DEFAULT 'user';"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_countries` (`code` , `descr`, `provider`) + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_countries` ADD `provider` ENUM( 'user', 'ext-iso3166' ) NOT NULL DEFAULT 'user';"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_countries` (`code` , `descr`, `provider`) VALUES ('AD', 'Andorra', 'ext-iso3166'), ('AE', 'Vereinigte Arabische Emirate', 'ext-iso3166'), ('AF', 'Afghanistan', 'ext-iso3166'), diff --git a/inc/extensions/ext-logs.php b/inc/extensions/ext-logs.php index d2a985499c..51702da9e9 100644 --- a/inc/extensions/ext-logs.php +++ b/inc/extensions/ext-logs.php @@ -50,13 +50,13 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('stats','logs','Aufruflogbücher','Verwalten Sie Ihre Aufruflogbücher mit diesem Admin-Bereich! (Derzeit nur Download!)',8)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `logs_base` VARCHAR(255) NOT NULL DEFAULT 'logs'"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('stats','logs','Aufruflogbücher','Verwalten Sie Ihre Aufruflogbücher mit diesem Admin-Bereich! (Derzeit nur Download!)',8)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `logs_base` VARCHAR(255) NOT NULL DEFAULT 'logs'"; break; case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE what='logs' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='logs' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-mailid.php b/inc/extensions/ext-mailid.php index 5bd1ebe1ba..a8a387f083 100644 --- a/inc/extensions/ext-mailid.php +++ b/inc/extensions/ext-mailid.php @@ -60,12 +60,12 @@ case "remove": // Do stuff when removing extension case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_mod_reg` SET locked='N', hidden='N', admin_only='N', mem_only='N' WHERE module='mailid' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='N', hidden='N', admin_only='N', mem_only='N' WHERE module='mailid' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_mod_reg` SET locked='Y' WHERE module='mailid' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='Y' WHERE module='mailid' LIMIT 1"; break; case "update": // Update an extension diff --git a/inc/extensions/ext-maintenance.php b/inc/extensions/ext-maintenance.php index aceafbfcb4..e8990bd303 100644 --- a/inc/extensions/ext-maintenance.php +++ b/inc/extensions/ext-maintenance.php @@ -50,13 +50,13 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD maintenance ENUM('Y','N') NOT NULL DEFAULT 'N';"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','maintenance','Wartungsmodus','Schalten Sie den Wartungsmodus ein, nur wenn sehr schwerwiegende Fehler vorliegen, die Sie oder mxchange.org nicht schenll genug beheben können.','10')"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD maintenance ENUM('Y','N') NOT NULL DEFAULT 'N';"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','maintenance','Wartungsmodus','Schalten Sie den Wartungsmodus ein, nur wenn sehr schwerwiegende Fehler vorliegen, die Sie oder mxchange.org nicht schenll genug beheben können.','10')"; break; case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE what='maintenance' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='maintenance' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-mediadata.php b/inc/extensions/ext-mediadata.php index 7eb9b594c0..bc23dc9c41 100644 --- a/inc/extensions/ext-mediadata.php +++ b/inc/extensions/ext-mediadata.php @@ -55,9 +55,9 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_mediadata`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE what='config_mediadata' LIMIT 1"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE what='mediadata' LIMIT 1"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_mediadata`"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_mediadata' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE what='mediadata' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension @@ -90,8 +90,8 @@ case "update": // Update an extension case "0.0.4": // SQL queries for v0.0.4 // SQL commands to run - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_mediadata`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_mediadata` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_mediadata`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_mediadata` ( media_key VARCHAR(255) NOT NULL DEFAULT '', media_value VARCHAR(255) NOT NULL DEFAULT '', PRIMARY KEY(media_key) @@ -112,9 +112,9 @@ PRIMARY KEY(media_key) break; case "0.0.7": // SQL queries for v0.0.7 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD mt_start BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD mt_stage BIGINT(20) UNSIGNED NOT NULL DEFAULT '500'"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_mediadata','Mediendaten','Stellen Sie allgemeine Einstellungen zu den Mediendaten ein.', 10)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD mt_start BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD mt_stage BIGINT(20) UNSIGNED NOT NULL DEFAULT '500'"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_mediadata','Mediendaten','Stellen Sie allgemeine Einstellungen zu den Mediendaten ein.', 10)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Start des {!MT_WORD2!} und Anzahl Anmeldungen aufgenommen. (Task #13)
@@ -127,7 +127,7 @@ Bitte stellen Sie diesen derzeit manuell unter = "0.1.1")) { // Reset mail order values - $result_ext = SQL_QUERY("UPDATE `{!MYSQL_PREFIX!}_user_data` SET mail_orders=0 WHERE mail_orders > 0", __FILE__, __LINE__); + $result_ext = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET mail_orders=0 WHERE mail_orders > 0", __FILE__, __LINE__); } // END - if break; } diff --git a/inc/extensions/ext-other.php b/inc/extensions/ext-other.php index ff80bba0f5..dc2a09b865 100644 --- a/inc/extensions/ext-other.php +++ b/inc/extensions/ext-other.php @@ -50,12 +50,12 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_other','Sonstige Einstellungen','Sonstige Einstellungen an Ihrem Mailtausch.',13)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_other','Sonstige Einstellungen','Sonstige Einstellungen an Ihrem Mailtausch.',13)"; break; case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE what='config_other' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_other' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension @@ -87,7 +87,7 @@ case "update": // Update an extension break; case "0.0.4": // SQL queries for v0.0.4 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD max_comma TINYINT(3) UNSIGNED NOT NULL DEFAULT '3'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD max_comma TINYINT(3) UNSIGNED NOT NULL DEFAULT '3'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Angezeigte Kommastellen können zwischen 0 und 5 eingestellt werden."; @@ -156,14 +156,14 @@ case "update": // Update an extension break; case "0.1.6": // SQL queries for v0.1.6 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD reject_url VARCHAR(255) NOT NULL DEFAULT '{!URL!}'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD reject_url VARCHAR(255) NOT NULL DEFAULT '{!URL!}'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Bei Ablehnung der URL wird jetzt endlich eine Standart-URL eingesetzt, die konfigurierbar ist. Fehler beim Laden der Konfiguration gefunden."; break; case "0.1.7": // SQL queries for v0.1.7 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD currency VARCHAR(255) NOT NULL DEFAULT '€'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD currency VARCHAR(255) NOT NULL DEFAULT '€'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Standart-Währung der Gebühren für alle Erweiterungen geltend hinzugefügt."; @@ -175,21 +175,21 @@ case "update": // Update an extension break; case "0.1.9": // SQL queries for v0.1.9 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD mailid_error_redirect ENUM('index','reject') NOT NULL DEFAULT 'index'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD mailid_error_redirect ENUM('index','reject') NOT NULL DEFAULT 'index'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Bei fehlerhafter Mail während der Bestätigung kann wahlweise zur Hauptseite weitergeleitet oder auf die eingestellte Ablehnungsseite umgeleitet werden."; break; case "0.2.0": // SQL queries for v0.2.0 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` CHANGE `mailid_error_redirect` `mailid_error_redirect` ENUM('INDEX','REJECT') NOT NULL DEFAULT 'INDEX'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` CHANGE `mailid_error_redirect` `mailid_error_redirect` ENUM('INDEX','REJECT') NOT NULL DEFAULT 'INDEX'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Bei fehlerhafter Mail während der Bestätigung kann wahlweise zur Hauptseite weitergeleitet oder auf die eingestellte Ablehnungsseite umgeleitet werden."; break; case "0.2.1": // SQL queries for v0.2.1 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `min_age` TINYINT(3) UNSIGNED NOT NULL DEFAULT 16"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `min_age` TINYINT(3) UNSIGNED NOT NULL DEFAULT 16"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Minimumalter ist nun konfigurierbar."; diff --git a/inc/extensions/ext-payout.php b/inc/extensions/ext-payout.php index d84d34ea74..fc3e066964 100644 --- a/inc/extensions/ext-payout.php +++ b/inc/extensions/ext-payout.php @@ -50,8 +50,8 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_user_payouts`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_user_payouts` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_payouts`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_user_payouts` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, payout_total FLOAT(22,3) UNSIGNED NOT NULL DEFAULT '0.000', @@ -64,67 +64,67 @@ KEY(userid), KEY(payout_id), PRIMARY KEY(id) ) TYPE=MyISAM"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_payout_types`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_payout_types` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_payout_types`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_payout_types` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, type VARCHAR(255) NOT NULL DEFAULT '', rate FLOAT(22,3) UNSIGNED NOT NULL DEFAULT '0.000', min_points BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY(id) ) TYPE=MyISAM"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_payouts','Auszahlungen','Auszahlungsarten einstellen, neu anlegen oder löschen.','15')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('payouts','list_payouts','Anfragen auflisten','Listet alle Auszahlungsanfragen Ihrer Mitglieder auf.','16')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','payout','Auszahlungen','N','N','11')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_payouts','Auszahlungen','Auszahlungsarten einstellen, neu anlegen oder löschen.','15')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('payouts','list_payouts','Anfragen auflisten','Listet alle Auszahlungsanfragen Ihrer Mitglieder auf.','16')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','payout','Auszahlungen','N','N','11')"; break; case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_user_payouts`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_payout_types`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE action='payouts'"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_member_menu` WHERE what='payout' LIMIT 1"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_payouts`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_payout_types`"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='payouts'"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='payout' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='Y', locked='N' WHERE what='payout' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='payout' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='N', locked='Y' WHERE what='payout' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='payout' LIMIT 1"; break; case "update": // Update an extension switch ($EXT_VER) { case "0.1.2": // SQL queries for v0.1.2 - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('payouts', NULL, 'Auszahlungsmanagement','Management der Auszahlungsarten.','8')"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET action='payouts', title='Einstellungen' WHERE action='setup' AND what='config_payouts' LIMIT 1"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('payouts', NULL, 'Auszahlungsmanagement','Management der Auszahlungsarten.','8')"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET action='payouts', title='Einstellungen' WHERE action='setup' AND what='config_payouts' LIMIT 1"; break; case "0.1.3": // SQL queries for v0.1.3 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_payout_types` ADD from_account VARCHAR(255) NOT NULL DEFAULT ''"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_payout_types` ADD from_pass VARCHAR(255) NOT NULL DEFAULT ''"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_payout_types` ADD engine_url VARCHAR(255) NOT NULL DEFAULT ''"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_payout_types` ADD engine_ret_ok VARCHAR(255) NOT NULL DEFAULT ''"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_payout_types` ADD engine_ret_failed VARCHAR(255) NOT NULL DEFAULT ''"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_payout_types` ADD pass_enc ENUM('md5','base64','none') NOT NULL DEFAULT 'md5'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_payout_types` ADD from_account VARCHAR(255) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_payout_types` ADD from_pass VARCHAR(255) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_payout_types` ADD engine_url VARCHAR(255) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_payout_types` ADD engine_ret_ok VARCHAR(255) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_payout_types` ADD engine_ret_failed VARCHAR(255) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_payout_types` ADD pass_enc ENUM('md5','base64','none') NOT NULL DEFAULT 'md5'"; break; case "0.1.4": // SQL queries for v0.1.4 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_payouts` ADD password VARCHAR(255) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_payouts` ADD password VARCHAR(255) NOT NULL DEFAULT ''"; break; case "0.1.5": // SQL queries for v0.1.5 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_payouts` ADD target_url LONGBLOB NOT NULL"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_payouts` ADD banner_url LONGBLOB NOT NULL"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_payouts` ADD link_text VARCHAR(30) NOT NULL DEFAULT ''"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_payout_types` ADD allow_url ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_payouts` ADD target_url LONGBLOB NOT NULL"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_payouts` ADD banner_url LONGBLOB NOT NULL"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_payouts` ADD link_text VARCHAR(30) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_payout_types` ADD allow_url ENUM('Y','N') NOT NULL DEFAULT 'N'"; break; case "0.1.6": // SQL queries for v0.1.6 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_payout_types` CHANGE pass_enc pass_enc ENUM('md5','base64','xxx') NOT NULL DEFAULT 'xxx'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_payout_types` CHANGE pass_enc pass_enc ENUM('md5','base64','xxx') NOT NULL DEFAULT 'xxx'"; break; case "0.1.8": // SQL queries for v0.1.8 @@ -143,8 +143,8 @@ case "update": // Update an extension break; case "0.2.1": // SQL queries for v0.2.1 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_payouts` CHANGE payout_total payout_total FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_payout_types` CHANGE rate rate FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_payouts` CHANGE payout_total payout_total FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_payout_types` CHANGE rate rate FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Problem mit Speicherung der Einstellungen beseitigt."; @@ -225,7 +225,7 @@ case "update": // Update an extension break; case "0.3.7": // SQL queries for v0.3.7 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET title = 'Auszahlungsmanagement' WHERE action = 'payouts' AND (what='' OR what IS NULL) LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET title = 'Auszahlungsmanagement' WHERE action = 'payouts' AND (what='' OR `what` IS NULL) LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Verwaltung nach Management umgestellt."; diff --git a/inc/extensions/ext-primera.php b/inc/extensions/ext-primera.php index 04be3e0973..430e2e4a44 100644 --- a/inc/extensions/ext-primera.php +++ b/inc/extensions/ext-primera.php @@ -50,8 +50,8 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_user_primera`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_user_primera` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_primera`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_user_primera` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, primera_account VARCHAR(255) NOT NULL DEFAULT '', @@ -65,39 +65,39 @@ PRIMARY KEY(id) ) TYPE=MyISAM"; // Confiuration - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD primera_min_payout BIGINT(20) UNSIGNED NOT NULL DEFAULT 40000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD primera_min_withdraw BIGINT(20) UNSIGNED NOT NULL DEFAULT 5000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD primera_api_name VARCHAR(255) NOT NULL DEFAULT ''"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD primera_api_md5 VARCHAR(32) NOT NULL DEFAULT ''"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD primera_refid VARCHAR(255) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD primera_min_payout BIGINT(20) UNSIGNED NOT NULL DEFAULT 40000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD primera_min_withdraw BIGINT(20) UNSIGNED NOT NULL DEFAULT 5000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD primera_api_name VARCHAR(255) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD primera_api_md5 VARCHAR(32) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD primera_refid VARCHAR(255) NOT NULL DEFAULT ''"; // User data - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD primera_userid VARCHAR(255) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD primera_userid VARCHAR(255) NOT NULL DEFAULT ''"; // Admin menu - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('primera', NULL, 'Primera-Management','Konfiguration zur Primera-API einstellen, Auszahlungen auflisten usw..', 15)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('primera','config_primera','Primera-API-Einstellungen','Konfiguration zur Primera-API einstellen.', 1)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('primera','list_primera','Primera-Anfragen auflisten','Listet alle Primera-Auszahlungsanfragen Ihrer Mitglieder auf.', 2)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('primera', NULL, 'Primera-Management','Konfiguration zur Primera-API einstellen, Auszahlungen auflisten usw..', 15)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('primera','config_primera','Primera-API-Einstellungen','Konfiguration zur Primera-API einstellen.', 1)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('primera','list_primera','Primera-Anfragen auflisten','Listet alle Primera-Auszahlungsanfragen Ihrer Mitglieder auf.', 2)"; // Member menu - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','primera','Primera-Ein-/Auszahlungen','N','N','11')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','primera','Primera-Ein-/Auszahlungen','N','N','11')"; break; case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_user_primera`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE action='primera'"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_member_menu` WHERE what='primera' LIMIT 1"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_primera`"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='primera'"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='primera' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='Y', locked='N' WHERE what='primera' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='primera' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='N', locked='Y' WHERE what='primera' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='primera' LIMIT 1"; break; case "update": // Update an extension diff --git a/inc/extensions/ext-rallye.php b/inc/extensions/ext-rallye.php index c310d3ae25..f563aa4936 100644 --- a/inc/extensions/ext-rallye.php +++ b/inc/extensions/ext-rallye.php @@ -50,10 +50,10 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_rallye_data`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_rallye_prices`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_rallye_users`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_rallye_data` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_rallye_data`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_rallye_prices`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_rallye_users`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_rallye_data` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, admin_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, title VARCHAR(255) NOT NULL DEFAULT '', @@ -68,7 +68,7 @@ notified ENUM('Y','N') NOT NULL DEFAULT 'N', KEY (admin_id), PRIMARY KEY (id) ) TYPE=MyISAM"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_rallye_prices` ( + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_rallye_prices` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, rallye_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, price_level BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -77,7 +77,7 @@ info LONGBLOB NOT NULL, KEY (rallye_id), PRIMARY KEY(id) ) TYPE=MyISAM"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_rallye_users` ( + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_rallye_users` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, rallye_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -88,28 +88,28 @@ PRIMARY KEY(id) ) TYPE=MyISAM"; // Admin menu - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('rallye', NULL, 'Rallye-Management','Richten Sie neue Ref-Rallyes ein, die zeitgesteuert anfangen und aufhöhren. Dabei wird alles weitere automatisch geregelt.','9')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('rallye','add_rallye','Neue Rallye hinzufügen','Neue Ref-Rallye hinzufügen.','1')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('rallye','config_rallye_prices','Preise einrichten','Richten Sie Preise zu den Rallyes ein.','2')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('rallye','list_rallyes','Rallyes verwalten','Alle bestehenden Ref-Rallyes auflisten, bearbeiten, stoppen, löschen usw.','3')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('rallye', NULL, 'Rallye-Management','Richten Sie neue Ref-Rallyes ein, die zeitgesteuert anfangen und aufhöhren. Dabei wird alles weitere automatisch geregelt.','9')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('rallye','add_rallye','Neue Rallye hinzufügen','Neue Ref-Rallye hinzufügen.','1')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('rallye','config_rallye_prices','Preise einrichten','Richten Sie Preise zu den Rallyes ein.','2')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('rallye','list_rallyes','Rallyes verwalten','Alle bestehenden Ref-Rallyes auflisten, bearbeiten, stoppen, löschen usw.','3')"; // Guest menu - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','rallyes','Ref-Rallyes','Y','Y','9')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','rallyes','Ref-Rallyes','Y','Y','9')"; // Member menu - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','rallyes','Ref-Rallyes','Y','Y','9')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','rallyes','Ref-Rallyes','Y','Y','9')"; break; case "remove": // Do stuff when removing extension // Drop tables - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_rallye_data`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_rallye_prices`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_rallye_users`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_rallye_data`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_rallye_prices`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_rallye_users`"; // Remove menus - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE action='rallye' LIMIT 4"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE what='rallyes' LIMIT 1"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_member_menu` WHERE what='rallyes' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='rallye' LIMIT 4"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE what='rallyes' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='rallyes' LIMIT 1"; // Unregister filter UNREGISTER_FILTER('extra_autopurge', 'RALLYE_EXTRA_AUTOPURGE', true, $dry_run); @@ -117,28 +117,28 @@ case "remove": // Do stuff when removing extension case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET visible='Y', locked='N' WHERE what='rallyes' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='Y', locked='N' WHERE what='rallyes' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y', `locked`='N' WHERE what='rallyes' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='rallyes' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET visible='N', locked='Y' WHERE what='rallyes' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='N', locked='Y' WHERE what='rallyes' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE what='rallyes' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='rallyes' LIMIT 1"; break; case "update": // Update an extension switch ($EXT_VER) { case "0.0.1": // SQL queries for v0.0.1 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_rallye_data` ADD expired ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_rallye_data` ADD expired ENUM('Y','N') NOT NULL DEFAULT 'N'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Ablaufen der Rallyes intergriert."; break; case "0.0.2": // SQL queries for v0.0.2 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_rallye_users` ADD curr_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_rallye_users` ADD curr_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Aktueller {!POINTS!}-Stand wird beachtet."; @@ -165,7 +165,7 @@ case "update": // Update an extension break; case "0.1.0": // SQL queries for v0.2.1 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_rallye_users` CHANGE curr_points curr_points FLOAT(23,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_rallye_users` CHANGE curr_points curr_points FLOAT(23,5) UNSIGNED NOT NULL DEFAULT 0.00000"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "5 Nachkommastellen implementiert."; @@ -217,8 +217,8 @@ case "update": // Update an extension break; case "0.2.0": // SQL queries for v0.2.0 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_rallye_data` ADD min_users BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_rallye_data` ADD min_prices BIGINT(20) UNSIGNED NOT NULL DEFAULT '3'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_rallye_data` ADD min_users BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_rallye_data` ADD min_prices BIGINT(20) UNSIGNED NOT NULL DEFAULT '3'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Ablaufen der Rallyes intergriert. Bauen Sie in Ihr Template templates/de/emails/member/member_rallye_notify.tpl folgende zwei Zeilen ein:
@@ -290,7 +290,7 @@ Zudem sollten Sie mindestens folgende Templates (in templates/".GET_LANG break; case "0.3.2": // SQL queries for v0.3.2 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET action='rals', sort='1', title='Referal-Rallye' WHERE what='rallyes' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='rals', sort='1', title='Referal-Rallye' WHERE what='rallyes' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Mitgliedsmenü komplett umgebaut."; @@ -338,7 +338,7 @@ default: // Do stuff when extension is loaded // Check for new started but not notified rallyes $result = SQL_QUERY("SELECT SQL_SMALL_RESULT id, title, start_time, end_time, send_notify".$ADD1." -FROM `{!MYSQL_PREFIX!}_rallye_data` +FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE is_active='Y' AND notified='N' AND expired='N' AND start_time <= UNIX_TIMESTAMP() AND end_time > UNIX_TIMESTAMP() LIMIT 1", __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { @@ -351,7 +351,7 @@ LIMIT 1", __FILE__, __LINE__); // Check for expired rallyes $result = SQL_QUERY("SELECT SQL_SMALL_RESULT d.id, d.title, d.start_time, d.end_time, d.send_notify".$ADD2." -FROM `{!MYSQL_PREFIX!}_rallye_data` AS d +FROM `{!_MYSQL_PREFIX!}_rallye_data` AS d WHERE d.is_active='Y' AND d.notified='Y' AND d.expired='N' AND (d.end_time <= UNIX_TIMESTAMP()".$OR.") LIMIT 1", __FILE__, __LINE__); if ((SQL_NUMROWS($result) == 1) && (EXT_IS_ACTIVE("autopurge"))) { diff --git a/inc/extensions/ext-refback.php b/inc/extensions/ext-refback.php index 855e1f52f4..e1e165ce7d 100644 --- a/inc/extensions/ext-refback.php +++ b/inc/extensions/ext-refback.php @@ -50,8 +50,8 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_user_refs`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_user_refs` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_refs`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_user_refs` ( `id` BIGINT(20) UNSIGNED NOT NULL auto_increment, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `level` smallINT(6) UNSIGNED NOT NULL DEFAULT 0, @@ -63,36 +63,36 @@ UNIQUE `user_refid` (`userid`,`level`,`refid`), KEY (`level`), KEY (`refid`) ) ENGINE=MyISAM COMMENT='User Referals With Refback'"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','refback','Ref-Back einstellen',4,'N','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','refback','Ref-Back einstellen',4,'N','N')"; break; case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_user_refs`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_member_menu` WHERE what='refback' LIMIT 1"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE what IN('config_refback','list_refback') LIMIT 2"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_refsystem` SET level=level-1"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_refs`"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='refback' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN('config_refback','list_refback') LIMIT 2"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_refsystem` SET level=level-1"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='Y', locked='N' WHERE what='refback' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='refback' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='N', locked='Y' WHERE what='refback' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='refback' LIMIT 1"; break; case "update": // Update an extension switch ($EXT_VER) { case "0.0.1": // SQL queries for v0.0.1 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD refback_enabled ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD refback_min_perc TINYINT(3) NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD refback_max_perc TINYINT(3) NOT NULL DEFAULT 100"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_refback','Refback','Ändern Sie Einstellungen zum Refback, wie z.B. Minium- und Maximum-Prozente, was die Mitglieder einstellen dürfen.',15)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_refback','Refback auflisten','Refback aller Mitglieder auflisten.',15)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD refback_enabled ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD refback_min_perc TINYINT(3) NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD refback_max_perc TINYINT(3) NOT NULL DEFAULT 100"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_refback','Refback','Ändern Sie Einstellungen zum Refback, wie z.B. Minium- und Maximum-Prozente, was die Mitglieder einstellen dürfen.',15)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_refback','Refback auflisten','Refback aller Mitglieder auflisten.',15)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Refback-System ist nun ein-/ausschaltbar und minimale/maximale Refback-Prozente sind festlegbar."; diff --git a/inc/extensions/ext-register.php b/inc/extensions/ext-register.php index bf9310eee8..622557095a 100644 --- a/inc/extensions/ext-register.php +++ b/inc/extensions/ext-register.php @@ -58,7 +58,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE what='config_register' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_register' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension @@ -75,8 +75,8 @@ case "update": // Update an extension switch ($EXT_VER) { case "0.1": // SQL queries for v0.1 - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_must_register`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_must_register` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_must_register`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_must_register` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, field_name VARCHAR(255) NOT NULL DEFAULT '', field_required ENUM('Y','N') NOT NULL DEFAULT 'Y', @@ -84,22 +84,22 @@ PRIMARY KEY(id) ) TYPE=MyISAM"; // Add all entries as required (DO NOT DELETE THEM FROM DATABASE!) - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_must_register` (field_name, field_required) VALUES ('surname','Y')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_must_register` (field_name, field_required) VALUES ('family_name','Y')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_must_register` (field_name, field_required) VALUES ('street_nr','Y')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_must_register` (field_name, field_required) VALUES ('cntry','Y')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_must_register` (field_name, field_required) VALUES ('zip','Y')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_must_register` (field_name, field_required) VALUES ('city','Y')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_must_register` (field_name, field_required) VALUES ('surname','Y')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_must_register` (field_name, field_required) VALUES ('family_name','Y')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_must_register` (field_name, field_required) VALUES ('street_nr','Y')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_must_register` (field_name, field_required) VALUES ('cntry','Y')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_must_register` (field_name, field_required) VALUES ('zip','Y')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_must_register` (field_name, field_required) VALUES ('city','Y')"; // Add admin menu - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_register','Pflichtfelder','Stellen Sie hier die Pflichtfelder sowohl im Anmeldeformular, als auch im Mitgliedsbereich unter Profildaten ändern ein.', 12)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_register','Pflichtfelder','Stellen Sie hier die Pflichtfelder sowohl im Anmeldeformular, als auch im Mitgliedsbereich unter Profildaten ändern ein.', 12)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Einstellbare Pflichtfelder hinzugefügt."; break; case "0.1.1": // SQL queries for v0.1.1 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_extensions` SET ext_has_css='Y' WHERE ext_name='register' AND ext_has_css='N' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_has_css='Y' WHERE ext_name='register' AND ext_has_css='N' LIMIT 1"; // This update depends on sql_patches update! $EXT_UPDATE_DEPENDS = "sql_patches"; @@ -262,8 +262,8 @@ PRIMARY KEY(id) break; case "0.4.2": // SQL queries for v0.4.2 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD register_default ENUM('Y','N') NOT NULL DEFAULT 'N'"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET what='config_register2' WHERE what='config_reg' LIMIT 1"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD register_default ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET what='config_register2' WHERE what='config_reg' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Bei der Anmeldung kann die Standart-Auswahl zwischen Ja/Nein umgeschaltet werden. Das Ändern des Templates templates/".GET_LANGUAGE()."/html/guest/guest_register.tpl ist nicht mehr nötig."; diff --git a/inc/extensions/ext-removeip.php b/inc/extensions/ext-removeip.php index f1c5523fbd..bb6004716e 100644 --- a/inc/extensions/ext-removeip.php +++ b/inc/extensions/ext-removeip.php @@ -50,21 +50,21 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `removeip_anon_ip` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `removeip_anon_host` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `removeip_anon_ua` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `removeip_anon_ref` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `removeip_admin_show` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `removeip_guest_show` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `removeip_member_show` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `removeip_sponsor_show` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `anonymous_ip` ENUM('127.0.0.1','0.0.0.0','RANDOM') NOT NULL DEFAULT '127.0.0.1'"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_removeip','Anonymität/Privatsphähre','Stellen Sie hier ein, ob die IP-Nummer, User-Agent und/oder Referer-Adresse anonymisiert im gesamten Script verwendet werden soll.',15)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `removeip_anon_ip` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `removeip_anon_host` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `removeip_anon_ua` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `removeip_anon_ref` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `removeip_admin_show` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `removeip_guest_show` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `removeip_member_show` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `removeip_sponsor_show` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `anonymous_ip` ENUM('127.0.0.1','0.0.0.0','RANDOM') NOT NULL DEFAULT '127.0.0.1'"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_removeip','Anonymität/Privatsphähre','Stellen Sie hier ein, ob die IP-Nummer, User-Agent und/oder Referer-Adresse anonymisiert im gesamten Script verwendet werden soll.',15)"; break; case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE what='config_removeip' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_removeip' LIMIT 1"; // Remove filters UNREGISTER_FILTER('post_youhere_line', 'ADD_ANONYMITY_NOTICE', true, $dry_run); diff --git a/inc/extensions/ext-repair.php b/inc/extensions/ext-repair.php index b2172e4c53..d3afb2ba9a 100644 --- a/inc/extensions/ext-repair.php +++ b/inc/extensions/ext-repair.php @@ -50,13 +50,13 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('repair', NULL, 'Reperaturen','7','Repariert u.a. die Kategorie-Auswahlen der Mitglieder usw.')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('repair','repair_cats','Kategorieauswahlen','1','Repariert die Kategorieauswahlen Ihrer Mitglieder.')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('repair', NULL, 'Reperaturen','7','Repariert u.a. die Kategorie-Auswahlen der Mitglieder usw.')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('repair','repair_cats','Kategorieauswahlen','1','Repariert die Kategorieauswahlen Ihrer Mitglieder.')"; break; case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE action='repair' LIMIT 5"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='repair' LIMIT 5"; break; case "activate": // Do stuff when admin activates this extension @@ -73,9 +73,9 @@ case "update": // Update an extension switch ($EXT_VER) { case "0.1": // SQL queries for v0.1 - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('repair','repair_amenu','Admin-Menü', 2, 'Repariert die Gewichtung des Admin-Menü-Systems')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('repair','repair_gmenu','Gast-Menü', 3, 'Repariert die Gewichtung des Gäste-Menü-Systems')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('repair','repair_mmenu','Mitglied-Menü', 4, 'Repariert die Gewichtung des Mitglieder-Menü-Systems')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('repair','repair_amenu','Admin-Menü', 2, 'Repariert die Gewichtung des Admin-Menü-Systems')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('repair','repair_gmenu','Gast-Menü', 3, 'Repariert die Gewichtung des Gäste-Menü-Systems')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('repair','repair_mmenu','Mitglied-Menü', 4, 'Repariert die Gewichtung des Mitglieder-Menü-Systems')"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Fügt ein Menüpunkt zur Reperatur der Gewichtung des Admin-Menüs hinzu."; diff --git a/inc/extensions/ext-rewrite.php b/inc/extensions/ext-rewrite.php index 09b7c485e6..0ef248cc22 100644 --- a/inc/extensions/ext-rewrite.php +++ b/inc/extensions/ext-rewrite.php @@ -61,13 +61,13 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE what='config_rewrite' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_rewrite' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension // Check if mod_rewrite is loadeded if (!IF_APACHE_MODULE_LOADED('mod_rewrite')) { - SQL_QUERY("UPDATE `{!MYSQL_PREFIX!}_extensions` SET ext_active='N' WHERE ext_name='rewrite' LIMIT 1", __FILE__, __LINE__); + SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_active='N' WHERE ext_name='rewrite' LIMIT 1", __FILE__, __LINE__); $EXT_REPORTS_FAILURE = true; addFatalMessage(MOD_REWRITE_ERROR); } // END - if @@ -123,8 +123,8 @@ case "update": // Update an extension break; case "0.0.9": // SQL queries for v0.0.9 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD rewrite_skip VARCHAR(255) NOT NULL DEFAULT 'login:admin:frametester:mailid'"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_rewrite','Rewrite-Engine','Stellen Sie hier ein, welche Module übersprungen werden sollen, in denen also kein Umschreiben des HTML-Codes stattfinden soll.', 8)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD rewrite_skip VARCHAR(255) NOT NULL DEFAULT 'login:admin:frametester:mailid'"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_rewrite','Rewrite-Engine','Stellen Sie hier ein, welche Module übersprungen werden sollen, in denen also kein Umschreiben des HTML-Codes stattfinden soll.', 8)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Zu überspringende Module können per Admin-Bereich eingestellt werden."; @@ -162,7 +162,7 @@ default: // Do stuff when extension is loaded // Check if mod_rewrite is loadeded if (!IF_APACHE_MODULE_LOADED('mod_rewrite')){ $EXT_REPORTS_FAILURE = true; - SQL_QUERY("UPDATE `{!MYSQL_PREFIX!}_extensions` SET ext_active='N' WHERE ext_name='rewrite' LIMIT 1", __FILE__, __LINE__); + SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_active='N' WHERE ext_name='rewrite' LIMIT 1", __FILE__, __LINE__); if (!IS_ADMIN())addFatalMessage(MOD_REWRITE_ERROR); } // END - if break; diff --git a/inc/extensions/ext-sponsor.php b/inc/extensions/ext-sponsor.php index 43bd0e1677..e4c155e872 100644 --- a/inc/extensions/ext-sponsor.php +++ b/inc/extensions/ext-sponsor.php @@ -57,8 +57,8 @@ case "register": // Do stuff when installation is running (modules.php?module=ad // // Sponsor data // - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_sponsor_data`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_sponsor_data` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_data`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_sponsor_data` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, company VARCHAR(255) NOT NULL DEFAULT '', position VARCHAR(255) NOT NULL DEFAULT '', @@ -98,8 +98,8 @@ PRIMARY KEY(id) // // Sponsor orders // - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_sponsor_orders`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_sponsor_orders` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_orders`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_sponsor_orders` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, sponsorid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, aid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -118,8 +118,8 @@ PRIMARY KEY(id) // // Pay-types // - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_sponsor_paytypes`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_sponsor_paytypes` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_paytypes`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_sponsor_paytypes` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, pay_name VARCHAR(255) NOT NULL DEFAULT '', pay_rate FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000, @@ -130,8 +130,8 @@ PRIMARY KEY(id) // // Points-to-action converting // - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_sponsor_action_convert`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_sponsor_action_convert` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_action_convert`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_sponsor_action_convert` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, ext_name VARCHAR(255) NOT NULL DEFAULT 'sponsor', conv_rate BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -142,8 +142,8 @@ PRIMARY KEY(id) // // Sponsor menu system (default) // - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_sponsor_menu`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_sponsor_menu` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_menu`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_sponsor_menu` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, action VARCHAR(255) NOT NULL DEFAULT '', what VARCHAR(255) NULL DEFAULT NULL, @@ -157,8 +157,8 @@ PRIMARY KEY(id) // // Registry for performable actions by your sponsors // - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_sponsor_registry`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_sponsor_registry` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_registry`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_sponsor_registry` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, aid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, ext_name VARCHAR(255) NOT NULL DEFAULT 'sponsor', @@ -171,8 +171,8 @@ PRIMARY KEY(id) // // URLs from the sponsors // - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_sponsor_urls`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_sponsor_urls` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_urls`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_sponsor_urls` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, sponsorid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, url VARCHAR(255) NOT NULL DEFAULT 'http://', @@ -185,8 +185,8 @@ PRIMARY KEY(id) // // Banners of any size from the sponsors // - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_sponsor_banner`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_sponsor_banner` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_banner`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_sponsor_banner` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, sponsorid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, url VARCHAR(255) NOT NULL DEFAULT 'http://', @@ -201,8 +201,8 @@ PRIMARY KEY(id) // // Campaigns // - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_sponsor_campaigns`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_sponsor_campaigns` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_campaigns`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_sponsor_campaigns` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, sponsorid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, aid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -223,8 +223,8 @@ PRIMARY KEY(id) // // Campaigns + URLs + Banner // - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_sponsor_campaign_assigns`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_sponsor_campaign_assigns` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_campaign_assigns`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_sponsor_campaign_assigns` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, campaignid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, urlid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -239,8 +239,8 @@ PRIMARY KEY(id) // // Allowed data to display (administrative) // - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_sponsor_admin_data`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_sponsor_admin_data` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_admin_data`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_sponsor_admin_data` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, data_row VARCHAR(255) NOT NULL DEFAULT '', display ENUM('Y','N') NOT NULL DEFAULT 'N', @@ -249,8 +249,8 @@ PRIMARY KEY(id) // // Allowed data to display (sponsor-side) // - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_sponsor_display_data`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_sponsor_display_data` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_display_data`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_sponsor_display_data` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, sponsorid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, data_row VARCHAR(255) NOT NULL DEFAULT '', @@ -261,110 +261,110 @@ PRIMARY KEY(id) // // Default allowed data to display // - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('id','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('company','Y')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('position','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('tax_ident','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('gender','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('surname','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('family','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('street_nr1','Y')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('street_nr2','Y')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('zip','Y')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('city','Y')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('country','Y')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('phone','Y')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('fax','Y')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('email','Y')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('url','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('password','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('remote_addr','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('sponsor_created','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('last_online','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('last_change','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('status','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('receive_warnings','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('warning_interval','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('points_amount','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('points_used','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('refid','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('ref_count','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('hash','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('last_pay','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('last_curr','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('id','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('company','Y')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('position','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('tax_ident','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('gender','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('surname','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('family','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('street_nr1','Y')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('street_nr2','Y')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('zip','Y')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('city','Y')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('country','Y')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('phone','Y')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('fax','Y')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('email','Y')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('url','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('password','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('remote_addr','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('sponsor_created','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('last_online','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('last_change','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('status','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('receive_warnings','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('warning_interval','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('points_amount','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('points_used','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('refid','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('ref_count','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('hash','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('last_pay','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_admin_data` (data_row, display) VALUES ('last_curr','N')"; // // Add default entries // - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_registry` (ext_name, is_active, aid, stamp_added) VALUES ('sponsor','N',".GET_CURRENT_ADMIN_ID().",UNIX_TIMESTAMP())"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_action_convert` (ext_name, conv_rate, conv_name) VALUES ('sponsor','10','Mails')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_paytypes` (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Standart-Paket', 5, 1000.00000, '€')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_paytypes` (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Spar-Paket', 1, 200.00000, '€')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_paytypes` (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Power-Paket', 10, 2000.00000, '€')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_paytypes` (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Sponsor-Paket', 20, 4000.00000, '€')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_registry` (ext_name, is_active, aid, stamp_added) VALUES ('sponsor','N',".GET_CURRENT_ADMIN_ID().",UNIX_TIMESTAMP())"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_action_convert` (ext_name, conv_rate, conv_name) VALUES ('sponsor','10','Mails')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_paytypes` (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Standart-Paket', 5, 1000.00000, '€')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_paytypes` (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Spar-Paket', 1, 200.00000, '€')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_paytypes` (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Power-Paket', 10, 2000.00000, '€')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_paytypes` (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Sponsor-Paket', 20, 4000.00000, '€')"; // // Admin menu // - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor', NULL, 'Sponsorenbereich','Den Sponsorenbereich verwalten. Hier können Sie auch Sonderaktionen seperat deakvieren oder wieder aktivieren, Sponsorenaccounts verwalten usw.', 7)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','add_sponsor','Neuer Sponsor','Neues Sponsorenaccount hinzufügen.', 1)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','unlock_sponsor','Sponsor freischalten','Sponsorenaccounts freigeben / sperren.', 2)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor','Sponsoren auflisten','Listet alle verfügbaren Sponsorenaccounts auf.', 3)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','edit_sponsor','Sponsor ändern','Sponsorenaccount ändern (Grundaten, nicht Freigabe!).', 4)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','lock_sponsor','Sponsor ent-/sperren','Sponsorenaccount sperren und entsperren.', 5)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','del_sponsor','Sponsor löschen','Sponsorenaccount löschen.', 6)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','allow_sponsor_data','Datenverwaltung','Stellen Sie hier ein, welche Daten der Sponsor im Mitgliedsbereich über sicht anzeigen darf und welche nicht.', 7)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_pays','Bestellungen...','Bestellungen der Sponsoren auflisten / bearbeiten.', 8)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_menu','Sponsorenmenü','Das Sponsorenmenü kann hier geändert werden.', 9)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_campaigns','Kampagnen...','Verwaltung aller von Ihren Sponsoren eingerichteten Kampagnen.', 10)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_urls','URL-Verwaltung','Verwaltung (freischalten, sperren, löschen, testen, bearbeiten usw.) von gebuchten URLs.', 11)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_banner','Banner-Verwaltung','Verwaltung (freischalten, sperren, löschen, testen, bearbeiten usw.) von gebuchten Bannern.', 12)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_reg','Sponsor-Aktionen','Alle Sponsor-Aktionen auflisten und verwalten.', 13)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_pay','Buchungspakete','Die Sponsoren können sich {!POINTS!}-Pakete kaufen. Hier können Sie diese verwalten.', 14)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_conv','{!POINTS!} umwandeln...','Mit den vom Sponsor gekauften {!POINTS!} kann er Aktionen buchen. Hier stellen Sie die Umrechnungsrate von {!POINTS!} nach Sponsoraktionen um. Beispiel: 1 {!POINTS!} = 10 Mails.', 15)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','config_sponsor','Einstellungen','Allgemeine Einstellungen am Sponsoring-System.', 16)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('repair','repr_sponsor','Sponsormenü','Gewichtung des Sponsormenüs reparieren.', 5)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor', NULL, 'Sponsorenbereich','Den Sponsorenbereich verwalten. Hier können Sie auch Sonderaktionen seperat deakvieren oder wieder aktivieren, Sponsorenaccounts verwalten usw.', 7)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','add_sponsor','Neuer Sponsor','Neues Sponsorenaccount hinzufügen.', 1)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','unlock_sponsor','Sponsor freischalten','Sponsorenaccounts freigeben / sperren.', 2)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor','Sponsoren auflisten','Listet alle verfügbaren Sponsorenaccounts auf.', 3)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','edit_sponsor','Sponsor ändern','Sponsorenaccount ändern (Grundaten, nicht Freigabe!).', 4)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','lock_sponsor','Sponsor ent-/sperren','Sponsorenaccount sperren und entsperren.', 5)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','del_sponsor','Sponsor löschen','Sponsorenaccount löschen.', 6)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','allow_sponsor_data','Datenverwaltung','Stellen Sie hier ein, welche Daten der Sponsor im Mitgliedsbereich über sicht anzeigen darf und welche nicht.', 7)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_pays','Bestellungen...','Bestellungen der Sponsoren auflisten / bearbeiten.', 8)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_menu','Sponsorenmenü','Das Sponsorenmenü kann hier geändert werden.', 9)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_campaigns','Kampagnen...','Verwaltung aller von Ihren Sponsoren eingerichteten Kampagnen.', 10)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_urls','URL-Verwaltung','Verwaltung (freischalten, sperren, löschen, testen, bearbeiten usw.) von gebuchten URLs.', 11)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_banner','Banner-Verwaltung','Verwaltung (freischalten, sperren, löschen, testen, bearbeiten usw.) von gebuchten Bannern.', 12)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_reg','Sponsor-Aktionen','Alle Sponsor-Aktionen auflisten und verwalten.', 13)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_pay','Buchungspakete','Die Sponsoren können sich {!POINTS!}-Pakete kaufen. Hier können Sie diese verwalten.', 14)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','list_sponsor_conv','{!POINTS!} umwandeln...','Mit den vom Sponsor gekauften {!POINTS!} kann er Aktionen buchen. Hier stellen Sie die Umrechnungsrate von {!POINTS!} nach Sponsoraktionen um. Beispiel: 1 {!POINTS!} = 10 Mails.', 15)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('sponsor','config_sponsor','Einstellungen','Allgemeine Einstellungen am Sponsoring-System.', 16)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('repair','repr_sponsor','Sponsormenü','Gewichtung des Sponsormenüs reparieren.', 5)"; // // Menu system (still admin menu) // - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('menu','sponsor_medit','Sponsor-Menü editieren','Hier können Sie das Sponsorenmenü verändern: Positionen verändern, Menütitel ändern usw.', 7)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('menu','sponsor_madd','Sponsor-Menü hinzufügen','Hier können Sie einen neuen Menüpunkt hinzufügen (falls Sie z.B. eigene Sponsoraktionen entwickelt haben oder welche versehendlich gelöscht haben.', 8)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('menu','sponsor_medit','Sponsor-Menü editieren','Hier können Sie das Sponsorenmenü verändern: Positionen verändern, Menütitel ändern usw.', 7)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('menu','sponsor_madd','Sponsor-Menü hinzufügen','Hier können Sie einen neuen Menüpunkt hinzufügen (falls Sie z.B. eigene Sponsoraktionen entwickelt haben oder welche versehendlich gelöscht haben.', 8)"; // // Guest menu // - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_guest_menu` (`action`, `what`, `title`, `sort`) VALUES ('sponsor', NULL, 'Sponsoren', 2)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_guest_menu` (`action`, `what`, `title`, `sort`) VALUES ('sponsor','sponsor_reg','Anmeldung', 1)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_guest_menu` (`action`, `what`, `title`, `sort`) VALUES ('sponsor','sponsor_login','Einloggen', 2)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_guest_menu` (`action`, `what`, `title`, `sort`) VALUES ('sponsor','sponsor_infos','Infos/Preise', 3)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_guest_menu` (`action`, `what`, `title`, `sort`) VALUES ('sponsor','sponsor_agb','AGBs', 4)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`, `what`, `title`, `sort`) VALUES ('sponsor', NULL, 'Sponsoren', 2)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`, `what`, `title`, `sort`) VALUES ('sponsor','sponsor_reg','Anmeldung', 1)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`, `what`, `title`, `sort`) VALUES ('sponsor','sponsor_login','Einloggen', 2)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`, `what`, `title`, `sort`) VALUES ('sponsor','sponsor_infos','Infos/Preise', 3)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`, `what`, `title`, `sort`) VALUES ('sponsor','sponsor_agb','AGBs', 4)"; // // Member menu // - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`, `what`, `title`, `sort`) VALUES ('main','sponsor','Unsere Sponsoren', 8)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`, `what`, `title`, `sort`) VALUES ('main','sponsor','Unsere Sponsoren', 8)"; // // Add default menus to sponsor menu // - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main', NULL, 'Hauptauswahl','N', 1)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','welcome','Willkommen','N', 1)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','account','Ihr Account','N', 2)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','campaigns','Kampagnen','N', 3)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','list_urls','URL-Verwaltung','N', 4)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','list_banner','Banner-Verwaltung','N', 5)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','settings','Einstellungen','N', 6)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','fillup','Konto auffüllen','N', 7)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','stats','Statistiken','N', 8)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','inquiry','Kontaktanfrage','N', 9)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','refid','Referal-Link','N', 10)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('actions', NULL, 'Sponsorenaktionen','N', 2)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('actions','mail','Sponsor-Mail','N', 1)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('actions','banner','Banner buchen','N', 2)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('actions','text','Textlink buchen','N', 3)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('logout', NULL, 'Ausloggen','N', 3)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('logout','logout','Ausloggen','N', 1)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('logout','guest','Zum Gastbereich','N', 2)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main', NULL, 'Hauptauswahl','N', 1)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','welcome','Willkommen','N', 1)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','account','Ihr Account','N', 2)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','campaigns','Kampagnen','N', 3)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','list_urls','URL-Verwaltung','N', 4)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','list_banner','Banner-Verwaltung','N', 5)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','settings','Einstellungen','N', 6)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','fillup','Konto auffüllen','N', 7)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','stats','Statistiken','N', 8)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','inquiry','Kontaktanfrage','N', 9)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','refid','Referal-Link','N', 10)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('actions', NULL, 'Sponsorenaktionen','N', 2)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('actions','mail','Sponsor-Mail','N', 1)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('actions','banner','Banner buchen','N', 2)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('actions','text','Textlink buchen','N', 3)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('logout', NULL, 'Ausloggen','N', 3)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('logout','logout','Ausloggen','N', 1)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('logout','guest','Zum Gastbereich','N', 2)"; // // General configuration stuff // - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD sponsor_ref_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 100.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD sponsor_min_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1000.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD sponsor_ref_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 100.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD sponsor_min_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1000.00000"; // Load CSS file $EXT_CSS = "Y"; @@ -372,37 +372,37 @@ PRIMARY KEY(id) case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_sponsor_data`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_sponsor_orders`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_sponsor_action_convert`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_sponsor_paytypes`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_sponsor_menu`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_sponsor_registry`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_sponsor_urls`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_sponsor_banner`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_sponsor_campaigns`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_sponsor_campaign_assigns`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_sponsor_admin_data`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_sponsor_display_data`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE action='sponsor' OR what IN('repr_sponsor','sponsor_medit','sponsor_madd') LIMIT 20"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE action='sponsor' LIMIT 5"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_member_menu` WHERE what='sponsor' LIMIT 1"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_data`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_orders`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_action_convert`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_paytypes`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_menu`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_registry`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_urls`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_banner`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_campaigns`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_campaign_assigns`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_admin_data`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_display_data`"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='sponsor' OR what IN('repr_sponsor','sponsor_medit','sponsor_madd') LIMIT 20"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE action='sponsor' LIMIT 5"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='sponsor' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET visible='Y', locked='N' WHERE action='sponsor' LIMIT 4"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='Y', locked='N' WHERE what='sponsor' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_sponsor_menu` SET active='Y' WHERE active='N'"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_sponsor_registry` SET is_active='Y' WHERE is_active='N'"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y', `locked`='N' WHERE action='sponsor' LIMIT 4"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='sponsor' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_sponsor_menu` SET active='Y' WHERE active='N'"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_sponsor_registry` SET is_active='Y' WHERE is_active='N'"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET visible='N', locked='Y' WHERE action='sponsor' LIMIT 4"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='N', locked='Y' WHERE what='sponsor' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_sponsor_menu` SET active='N' WHERE active='Y'"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_sponsor_registry` SET is_active='N' WHERE is_active='Y'"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE action='sponsor' LIMIT 4"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='sponsor' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_sponsor_menu` SET active='N' WHERE active='Y'"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_sponsor_registry` SET is_active='N' WHERE is_active='Y'"; break; case "update": // Update an extension diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php index f0d2b0c90d..8da3cde53a 100644 --- a/inc/extensions/ext-sql_patches.php +++ b/inc/extensions/ext-sql_patches.php @@ -55,15 +55,15 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // Drop tables - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_admin_menu_las`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_admin_menu_las`_data"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_admin_menu_stats`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_user_stats_data`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_user_book`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_filters`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_admin_menu_las`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_admin_menu_las`_data"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_admin_menu_stats`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_stats_data`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_book`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_filters`"; // Delete admin menu entries - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_extensions' OR `what`='config_home' OR `what`='list_unconfirmed' OR @@ -77,51 +77,51 @@ case "remove": // Do stuff when removing extension LIMIT 10"; // Delete/update member menu entries - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_member_menu` WHERE + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='stats2' OR `what`='reflist' OR -(action='stats' AND (`what`='' OR what IS NULL)) OR -(action='extras' AND (`what`='' OR what IS NULL)) OR -(action='rals' AND (`what`='' OR what IS NULL)) OR -(action='account' AND (`what`='' OR what IS NULL))"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET action='main' WHERE +(action='stats' AND (`what`='' OR `what` IS NULL)) OR +(action='extras' AND (`what`='' OR `what` IS NULL)) OR +(action='rals' AND (`what`='' OR `what` IS NULL)) OR +(action='account' AND (`what`='' OR `what` IS NULL))"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='main' WHERE action='stats' OR action='extras' OR action='rals' OR action='account'"; // Drop indexes - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_extensions` DROP UNIQUE KEY `ext_name`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_admins` DROP UNIQUE KEY `login`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` DROP INDEX `status`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_refbanner` DROP INDEX `visible`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_refdepths` DROP UNIQUE KEY `level`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_refsystem` DROP INDEX `level`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_pool` DROP INDEX `data_type`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_mod_reg` DROP UNIQUE KEY `module`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_admin_menu` DROP INDEX `action`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_admin_menu` DROP INDEX `what`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_task_system` DROP INDEX `task_type`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_task_system` DROP INDEX `status`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_task_system` DROP INDEX `task_created`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_task_system` DROP FULLTEXT `subject`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_task_system` DROP INDEX `subject`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_extensions` DROP INDEX `ext_active`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` DROP INDEX `status`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` DROP FULLTEXT `family`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` DROP INDEX `max_mails`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` DROP INDEX `password`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_guest_menu` DROP INDEX `action`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_guest_menu` DROP INDEX `what`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_guest_menu` DROP INDEX `sort`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_guest_menu` DROP INDEX `visible`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_guest_menu` DROP INDEX `locked`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_member_menu` DROP INDEX `what`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_member_menu` DROP INDEX `sort`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_member_menu` DROP INDEX `visible`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_member_menu` DROP INDEX `locked`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_cats` DROP INDEX `visible`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_cats` DROP INDEX `sort`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_extensions` DROP UNIQUE KEY `ext_name`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_admins` DROP UNIQUE KEY `login`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP INDEX `status`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_refbanner` DROP INDEX `visible`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_refdepths` DROP UNIQUE KEY `level`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_refsystem` DROP INDEX `level`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_pool` DROP INDEX `data_type`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_mod_reg` DROP UNIQUE KEY `module`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_admin_menu` DROP INDEX `action`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_admin_menu` DROP INDEX `what`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_task_system` DROP INDEX `task_type`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_task_system` DROP INDEX `status`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_task_system` DROP INDEX `task_created`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_task_system` DROP FULLTEXT `subject`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_task_system` DROP INDEX `subject`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_extensions` DROP INDEX `ext_active`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP INDEX `status`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP FULLTEXT `family`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP INDEX `max_mails`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP INDEX `password`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_guest_menu` DROP INDEX `action`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_guest_menu` DROP INDEX `what`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_guest_menu` DROP INDEX `sort`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_guest_menu` DROP INDEX `visible`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_guest_menu` DROP INDEX `locked`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_member_menu` DROP INDEX `what`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_member_menu` DROP INDEX `sort`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_member_menu` DROP INDEX `visible`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_member_menu` DROP INDEX `locked`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_cats` DROP INDEX `visible`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_cats` DROP INDEX `sort`"; break; case "activate": // Do stuff when admin activates this extension @@ -138,96 +138,96 @@ case "update": // Update an extension switch ($EXT_VER) { case "0.0.1": // SQL queries for v0.0.1 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD ext_autopurge ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_extensions','Erweitungsmanagement','Alle Einstellungen am Erweiterungsmanagement.', 10)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD ext_autopurge ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_extensions','Erweitungsmanagement','Alle Einstellungen am Erweiterungsmanagement.', 10)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Es kann nun bestimmt werden, ob vom Server gelöschte ext-xxx.php erkannt werden sollen und die verknüpften Daten auch aus der Datenbank entfernt werden sollen."; break; case "0.0.2": // SQL queries for v0.0.2 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` CHANGE auto_purge auto_purge BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*14).""; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` CHANGE auto_purge auto_purge BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*14).""; // Update notes (these will be set as task text!) $UPDATE_NOTES = "In der Tabelle {!MYSQL_PREFIX!}_config musste die Spalte auto_purge (autom. Löschen von Bestätigungsmails angepasst werden (war auf dem Testsystem auf TINYINT(4) gesetzt.)"; break; case "0.0.3": // SQL queries for v0.0.3 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD points_word VARCHAR(255) NOT NULL DEFAULT 'Punkte'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD points_word VARCHAR(255) NOT NULL DEFAULT 'Punkte'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Das Wort "Punkte" kann nun per Datenbank geändert werden. Damit können Sie anstelle des Wortes Punkte auch Klammlose oder € schreiben."; break; case "0.0.4": // SQL queries for v0.0.4 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD mails_page BIGINT(20) UNSIGNED NOT NULL DEFAULT 10"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD mails_page BIGINT(20) UNSIGNED NOT NULL DEFAULT 10"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Anzahl Mails pro Seite in EMail-Details ansehen und EMail-Archiv hinzugefügt."; break; case "0.0.5": // SQL queries for v0.0.5 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD index_home VARCHAR(255) NOT NULL DEFAULT 'welcome'"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_home','Home-Seite festlegen','Stellen Sie hier ein, welcher Menüpunkt (what-welcome ist Standart) als Einstiegspunkt in das Menüsystem genutzt werden soll.', 5)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD index_home VARCHAR(255) NOT NULL DEFAULT 'welcome'"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_home','Home-Seite festlegen','Stellen Sie hier ein, welcher Menüpunkt (what-welcome ist Standart) als Einstiegspunkt in das Menüsystem genutzt werden soll.', 5)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Die what-welcome.php ist derzeit die "Home"-Seite (Eingangsseite). Dies kann nun per Datenbank geändert werden."; break; case "0.0.6": // SQL queries for v0.0.6 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_extensions` ADD ext_has_css ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_extensions` ADD ext_has_css ENUM('Y','N') NOT NULL DEFAULT 'N'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Es können nun SQL-Updates von einander abhängig gemacht werden und die CSS-Datei kann per Admin-Bereich (wegen Debuggings) ein- bzw. ausgeschaltet werden."; break; case "0.0.7": // SQL queries for v0.0.7 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD verbose_sql ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD verbose_sql ENUM('Y','N') NOT NULL DEFAULT 'Y'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Die SQL-Anweisungen werden bei eingeschalteter Verbose-Funktion detailiert angezeigt."; break; case "0.0.8": // SQL queries for v0.0.8 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD menu_blur_spacer VARCHAR(255) NOT NULL DEFAULT ' · '"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD menu_blur_spacer VARCHAR(255) NOT NULL DEFAULT ' · '"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Nette Mouse-Hover-Effekte eingebaut (Anleitung MENUE_HOVER.txt zum Patchen der general.css bitte lesen!)"; break; case "0.0.9": // SQL queries for v0.0.9 - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','list_unconfirmed','Unbest. Mails auflisten','Schauen Sie sich hier unbestätigte Maillinks an. Bitte diesen Link nur über dem EMail-Archiv oder EMail-Details aufrufen, direkt aufgerufen bekommen Sie eine Fehlermeldung.', 8)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','list_unconfirmed','Unbest. Mails auflisten','Schauen Sie sich hier unbestätigte Maillinks an. Bitte diesen Link nur über dem EMail-Archiv oder EMail-Details aufrufen, direkt aufgerufen bekommen Sie eine Fehlermeldung.', 8)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Unbestätigte Maillinks können unter Email-Management -> Unbest. Mails auflisten aufgelistet werden."; break; case "0.1.0": // SQL queries for v0.2.1 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD reg_points_mode ENUM('ref','direct') NOT NULL DEFAULT 'ref'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD reg_points_mode ENUM('ref','direct') NOT NULL DEFAULT 'ref'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Soll der einmalige Ref-Bonus über das Referal-System (also alle oberen Refs bekommen auch etwas davon ab) oder direkt dem Werber aufgebucht werden?"; break; case "0.1.1": // SQL queries for v0.1.1 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET title='Home-/Eingangsseite', descr='Stellen Sie hier ein, welcher Menüpunkt (what-welcome ist Standart) als Einstiegspunkt in das Menüsystem genutzt werden soll und wie die automatische Weiterleitung in der Eingangsseite funktionieren soll.' WHERE `what`='config_home' LIMIT 1"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD index_delay TINYINT(3) UNSIGNED NOT NULL DEFAULT '-1'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD index_cookie BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*365).""; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET title='Home-/Eingangsseite', descr='Stellen Sie hier ein, welcher Menüpunkt (what-welcome ist Standart) als Einstiegspunkt in das Menüsystem genutzt werden soll und wie die automatische Weiterleitung in der Eingangsseite funktionieren soll.' WHERE `what`='config_home' LIMIT 1"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD index_delay TINYINT(3) UNSIGNED NOT NULL DEFAULT '-1'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD index_cookie BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*365).""; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Sie können nun
hier die Verzögerungszeit in der Eingangsseite einstellen."; break; case "0.1.2": // SQL queries for v0.1.2 - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_refid','Standart-Ref-ID','Stellen Sie hier die User-ID ein, die genommen werden soll, wenn der Gast n icht per Referal-Link Ihren Mailtausch aufgerufen hat.', 7)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD def_refid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_refid','Standart-Ref-ID','Stellen Sie hier die User-ID ein, die genommen werden soll, wenn der Gast n icht per Referal-Link Ihren Mailtausch aufgerufen hat.', 7)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD def_refid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Standart Referal-ID kann per Admin-Bereich eingestellt werden (war vorher nur in modules.php und index.php direkt eingebbar.)"; break; case "0.1.3": // SQL queries for v0.1.3 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD refid_target ENUM('register','index') NOT NULL DEFAULT 'register'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD refid_target ENUM('register','index') NOT NULL DEFAULT 'register'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Auf welche Seite soll der Ref-Link zeigen? Eingangsseite oder Anmeldeformular?"; @@ -239,20 +239,20 @@ case "update": // Update an extension break; case "0.1.5": // SQL queries for v0.1.5 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_extensions` DROP ext_has_admin"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_extensions` DROP ext_has_admin"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Spalte ext_has_admin aus der Tabelle {!MYSQL_PREFIX!}_extensions entfernt, da sie keinen Sinn mehr macht."; break; case "0.1.6": // SQL queries for v0.1.6 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD enable_title_deco ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD title_left VARCHAR(10) NOT NULL DEFAULT '[--'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD title_middle VARCHAR(10) NOT NULL DEFAULT '-'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD title_right VARCHAR(10) NOT NULL DEFAULT '--]'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD enable_mod_title ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD enable_what_title ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_title','Seitentitel ändern','De-/aktivieren Sie hier die Dekorationen, sowie Modul-Titel und what-Titel im Seitentitel.', 8)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD enable_title_deco ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD title_left VARCHAR(10) NOT NULL DEFAULT '[--'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD title_middle VARCHAR(10) NOT NULL DEFAULT '-'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD title_right VARCHAR(10) NOT NULL DEFAULT '--]'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD enable_mod_title ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD enable_what_title ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_title','Seitentitel ändern','De-/aktivieren Sie hier die Dekorationen, sowie Modul-Titel und what-Titel im Seitentitel.', 8)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Dekorationen des Seitentiteles lassen sich ein- und ausschalten und selber definieren; Modul-Titel und Titel der what-Dateien kann hinzugefügt werden."; @@ -274,21 +274,21 @@ case "update": // Update an extension break; case "0.2.0": // SQL queries for v0.2.0 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_jackpot` CHANGE points points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_jackpot` CHANGE points points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_payments` CHANGE payment payment FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_payments` CHANGE price price FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_payments` CHANGE payment payment FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_payments` CHANGE price price FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` CHANGE used_points used_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_points` CHANGE points points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_points` CHANGE locked_points locked_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` CHANGE used_points used_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_points` CHANGE points points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_points` CHANGE locked_points locked_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "5 Nachkommastellen implementiert"; break; case "0.2.1": // SQL queries for v0.2.1 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD css_php ENUM('DIRECT','FILE') NOT NULL DEFAULT 'FILE'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD css_php ENUM('DIRECT','FILE') NOT NULL DEFAULT 'FILE'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Ausgabe der CSS-Dateien entweder per css.php oder sie sind direkt eingebunden."; @@ -300,9 +300,9 @@ case "update": // Update an extension break; case "0.2.3": // SQL queries for v0.2.3 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD guest_menu ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD member_menu ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD youre_here ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD guest_menu ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD member_menu ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD youre_here ENUM('Y','N') NOT NULL DEFAULT 'Y'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Gast- und Mitgliedsmenüs lassen sich getrennt voneinander abschalten."; @@ -314,30 +314,30 @@ case "update": // Update an extension // Switch to JPEG format $auto_type = "jpg"; } - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD img_type ENUM('jpg','png') NOT NULL DEFAULT '".$auto_type."'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD img_type ENUM('jpg','png') NOT NULL DEFAULT '".$auto_type."'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Generierung des Mailbestätigungscodes hängt davon ab, ob die PHP-Funktion imagecreatefromjpeg() und das JPEG-Bild vorhanden sind oder nicht."; break; case "0.2.5": // SQL queries for v0.2.5 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` CHANGE receive_mails receive_mails BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` CHANGE max_mails max_mails BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` CHANGE receive_mails receive_mails BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` CHANGE max_mails max_mails BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Spalten max_mails und receive_mails auf BIGINT(20) gesetzt."; break; case "0.2.6": // SQL queries for v0.2.6 - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','sub_points','{!POINTS!} abziehen','Allen oder einem Mitglied {!POINTS!} abziehen.', 8)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','sub_points','{!POINTS!} abziehen','Allen oder einem Mitglied {!POINTS!} abziehen.', 8)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Abzug von {!POINTS!} nun möglich."; break; case "0.2.7": // SQL queries for v0.2.7 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD stats_limit BIGINT(20) UNSIGNED NOT NULL DEFAULT 10"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET `what`='config_stats' WHERE `what`='stats' LIMIT 1"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD stats_limit BIGINT(20) UNSIGNED NOT NULL DEFAULT 10"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `what`='config_stats' WHERE `what`='stats' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "
    @@ -347,61 +347,61 @@ case "update": // Update an extension break; case "0.2.8": // SQL queries for v0.2.8 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD last_login VARCHAR(10) NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD last_login VARCHAR(10) NOT NULL DEFAULT 0"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Letzter Login wird gespeichert, Cache wird bei installierter Cache-Erweiterung bei Sprachenänderung aufgefrischt."; break; case "0.2.9": // SQL queries for v0.2.9 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD mt_word VARCHAR(255) NOT NULL DEFAULT 'Mailtausch'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD mt_word2 VARCHAR(255) NOT NULL DEFAULT 'Mailtausches'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD mt_word3 VARCHAR(255) NOT NULL DEFAULT 'Mailtauscher'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD mt_word VARCHAR(255) NOT NULL DEFAULT 'Mailtausch'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD mt_word2 VARCHAR(255) NOT NULL DEFAULT 'Mailtausches'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD mt_word3 VARCHAR(255) NOT NULL DEFAULT 'Mailtauscher'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Wörter Mailtausch, Mailtausches und Mailtauscher sind austauschbar."; break; case "0.3.0": // SQL queries for v0.3.0 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET title='{!POINTS!}/Referal-Ebenen' WHERE `what`='config_points' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET title='Mailvergütungen...' WHERE `what`='payments' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET title='{!POINTS!}/Referal-Ebenen' WHERE `what`='config_points' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET title='Mailvergütungen...' WHERE `what`='payments' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Zwei Menüpunkte umbenannt."; break; case "0.3.1": // SQL queries for v0.3.1 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_extensions` ADD UNIQUE KEY (ext_name)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_admins` ADD UNIQUE KEY (login)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD INDEX (status)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_refbanner` ADD INDEX (visible)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_refdepths` ADD UNIQUE KEY (level)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_refsystem` ADD INDEX (level)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_pool` ADD INDEX (data_type)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_mod_reg` ADD UNIQUE KEY (module)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_admin_menu` ADD INDEX (action)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_admin_menu` ADD INDEX (what)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_task_system` ADD INDEX (task_type)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_task_system` ADD INDEX (status)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_task_system` ADD INDEX (task_created)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_task_system` ADD FULLTEXT (subject)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_task_system` ADD INDEX (subject)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_extensions` ADD INDEX (ext_active)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD INDEX (status)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD FULLTEXT (family)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD INDEX (max_mails)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD INDEX (password)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_guest_menu` ADD INDEX (action)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_guest_menu` ADD INDEX (what)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_guest_menu` ADD INDEX (sort)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_guest_menu` ADD INDEX (visible)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_guest_menu` ADD INDEX (locked)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_member_menu` ADD INDEX (what)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_member_menu` ADD INDEX (sort)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_member_menu` ADD INDEX (visible)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_member_menu` ADD INDEX (locked)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_cats` ADD INDEX (visible)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_cats` ADD INDEX (sort)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_extensions` ADD UNIQUE KEY (ext_name)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_admins` ADD UNIQUE KEY (login)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD INDEX (status)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_refbanner` ADD INDEX (visible)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_refdepths` ADD UNIQUE KEY (level)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_refsystem` ADD INDEX (level)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_pool` ADD INDEX (data_type)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_mod_reg` ADD UNIQUE KEY (module)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_admin_menu` ADD INDEX (action)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_admin_menu` ADD INDEX (what)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_task_system` ADD INDEX (task_type)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_task_system` ADD INDEX (status)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_task_system` ADD INDEX (task_created)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_task_system` ADD FULLTEXT (subject)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_task_system` ADD INDEX (subject)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_extensions` ADD INDEX (ext_active)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD INDEX (status)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD FULLTEXT (family)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD INDEX (max_mails)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD INDEX (password)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_guest_menu` ADD INDEX (action)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_guest_menu` ADD INDEX (what)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_guest_menu` ADD INDEX (sort)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_guest_menu` ADD INDEX (visible)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_guest_menu` ADD INDEX (locked)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_member_menu` ADD INDEX (what)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_member_menu` ADD INDEX (sort)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_member_menu` ADD INDEX (visible)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_member_menu` ADD INDEX (locked)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_cats` ADD INDEX (visible)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_cats` ADD INDEX (sort)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Eindeutige Schlüssel (UNIQUE KEY) und normale Schlüssel (INDEX) gesetzt."; @@ -409,8 +409,8 @@ case "update": // Update an extension case "0.3.2": // SQL queries for v0.3.2 // Connection table between the menu system and the "logical area" system - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_admin_menu_las`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_admin_menu_las` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_admin_menu_las`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_admin_menu_las` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, la_id VARCHAR(255) NOT NULL DEFAULT '', la_action VARCHAR(255) NOT NULL DEFAULT '', @@ -421,8 +421,8 @@ INDEX (la_what), PRIMARY KEY(id) ) TYPE=MyISAM"; // All "logical areas" together - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_admin_menu_las`_data"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_admin_menu_las`_data ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_admin_menu_las`_data"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_admin_menu_las`_data ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, la_id VARCHAR(255) NOT NULL DEFAULT '', la_title VARCHAR(255) NOT NULL DEFAULT '', @@ -434,10 +434,10 @@ INDEX (la_posy), PRIMARY KEY(id) ) TYPE=MyISAM"; // Which menu do you like? - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD admin_menu ENUM('NEW','OLD') NOT NULL DEFAULT 'OLD'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD admin_menu ENUM('NEW','OLD') NOT NULL DEFAULT 'OLD'"; // Insert menus - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_admin','Adminmenü','Diverse Einstellungen am Adminmenü vornehmen.', 9)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_admin','Adminmenü','Diverse Einstellungen am Adminmenü vornehmen.', 9)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Logische Bereiche (Logical Areas = LAs) eingeführt. Dadurch wird das immer stärker anwachsende Admin-Menü in grosse Hauptgruppen unterteilt, wodurch ein Auffinden von Menüpunkten verbessert wird."; @@ -445,11 +445,11 @@ PRIMARY KEY(id) case "0.3.3": // SQL queries for v0.3.3 // Switch of the "intelligent menu sorter" when you want to have a fixed menu structure... - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD admin_menu_sorter ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD admin_menu_sorter ENUM('Y','N') NOT NULL DEFAULT 'Y'"; // The statistics table - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_admin_menu_stats`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_admin_menu_stats` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_admin_menu_stats`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_admin_menu_stats` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, aid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, type ENUM('la','action','what') NOT NULL DEFAULT 'what', @@ -469,30 +469,30 @@ PRIMARY KEY (id) case "0.3.5": // SQL queries for v0.3.5 // List accounts with no referal - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('stats',NULL,'Statistiken',4,'Y','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('stats','stats2','Framekiller-Mails',2,'Y','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('extras',NULL,'Extras',5,'Y','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('rals',NULL,'Rallyes',6,'Y','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('account',NULL,'Ihr Account',7,'Y','N')"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET action='stats', sort='1', title='Klick-Mails' WHERE `what`='stats' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET action='extras', sort='3' WHERE `what`='reflinks' LIMIT 1"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('stats',NULL,'Statistiken',4,'Y','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('stats','stats2','Framekiller-Mails',2,'Y','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('extras',NULL,'Extras',5,'Y','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('rals',NULL,'Rallyes',6,'Y','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('account',NULL,'Ihr Account',7,'Y','N')"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='stats', sort='1', title='Klick-Mails' WHERE `what`='stats' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='extras', sort='3' WHERE `what`='reflinks' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Mitgliedsmenü komplett umgebaut."; break; case "0.3.6": // SQL queries for v0.3.6 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD salt_length TINYINT(3) UNSIGNED NOT NULL DEFAULT '9'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD pass_scramble VARCHAR(255) NOT NULL DEFAULT ''"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` MODIFY password VARCHAR(255) NOT NULL DEFAULT ''"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` MODIFY user_hash VARCHAR(255) NOT NULL DEFAULT ''"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_admins` MODIFY password VARCHAR(255) NOT NULL DEFAULT ''"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD rand_no BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD file_hash VARCHAR(255) NOT NULL DEFAULT ''"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD master_salt VARCHAR(255) NOT NULL DEFAULT ''"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_config` SET rand_no=(ROUND(RAND() * 99999) + 100000) WHERE config=0 LIMIT 1"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_mod_reg` ADD has_menu ENUM('Y','N') NOT NULL DEFAULT 'N'"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_mod_reg` SET has_menu='Y' WHERE module='admin' OR module='index' OR module='login' LIMIT 3"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD salt_length TINYINT(3) UNSIGNED NOT NULL DEFAULT '9'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD pass_scramble VARCHAR(255) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` MODIFY password VARCHAR(255) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` MODIFY user_hash VARCHAR(255) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_admins` MODIFY password VARCHAR(255) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD rand_no BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD file_hash VARCHAR(255) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD master_salt VARCHAR(255) NOT NULL DEFAULT ''"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_config` SET rand_no=(ROUND(RAND() * 99999) + 100000) WHERE config=0 LIMIT 1"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_mod_reg` ADD has_menu ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET has_menu='Y' WHERE module='admin' OR module='index' OR module='login' LIMIT 3"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Passwort-System mit Zufallshash erweitert (Schutzt gegen Dictionary-Attacks!)"; @@ -503,84 +503,84 @@ PRIMARY KEY (id) break; case "0.3.8": // SQL queries for v0.3.8 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_admin_menu` CHANGE descr descr MEDIUMTEXT NULL"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_pool` CHANGE `text` `text` LONGTEXT NOT NULL"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_admin_menu` CHANGE descr descr MEDIUMTEXT NULL"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_pool` CHANGE `text` `text` LONGTEXT NOT NULL"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Beschreibungstexte für Admin-Menüs können länger sein. Diverse Fixes."; break; case "0.3.9": // SQL queries for v0.3.9 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET title = REPLACE(title, '--POINTS--','!POINTS!') WHERE title LIKE '%--POINTS--%'"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET descr = REPLACE(descr, '--POINTS--','!POINTS!') WHERE descr LIKE '%--POINTS--%'"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET title = REPLACE(title, '--POINTS--','!POINTS!') WHERE title LIKE '%--POINTS--%'"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET title = REPLACE(title, '--POINTS--','!POINTS!') WHERE title LIKE '%--POINTS--%'"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET title = REPLACE(title, '--POINTS--','!POINTS!') WHERE title LIKE '%--POINTS--%'"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET descr = REPLACE(descr, '--POINTS--','!POINTS!') WHERE descr LIKE '%--POINTS--%'"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET title = REPLACE(title, '--POINTS--','!POINTS!') WHERE title LIKE '%--POINTS--%'"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET title = REPLACE(title, '--POINTS--','!POINTS!') WHERE title LIKE '%--POINTS--%'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Beschreibungstexte für Admin-Menüs können länger sein. Diverse Fixes."; break; case "0.4.0": // SQL queries for v0.4.0 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET title = 'Email-Management' WHERE action = 'email' AND (`what`='' OR what IS NULL) LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET title = 'Email-Management' WHERE action = 'email' AND (`what`='' OR `what` IS NULL) LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Email-Verwaltung nach Email-Management umbenannt."; break; case "0.4.1": // SQL queries for v0.4.1 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` DROP INDEX `status` , ADD INDEX `status` ( `status` , `max_mails` )"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `show_timings` ENUM ('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP INDEX `status` , ADD INDEX `status` ( `status` , `max_mails` )"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `show_timings` ENUM ('Y','N') NOT NULL DEFAULT 'Y'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Tabellen-Schlüssel neu gesetzt und Parsing-Zeit im Footer eingeblendet."; break; case "0.4.2": // SQL queries for v0.4.2 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_online` ADD INDEX `admin_member` (`is_admin`,`is_member`)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_online` ADD INDEX `admin_member` (`is_admin`,`is_member`)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Neuen Schlüssel zur Online-Tabelle hinzugefügt."; break; case "0.4.3": // SQL queries for v0.4.3 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `proxy_host` VARCHAR(255) NOT NULL DEFAULT ''"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `proxy_port` INT(5) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `proxy_username` VARCHAR(255) NOT NULL DEFAULT ''"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `proxy_password` VARCHAR(255) NOT NULL DEFAULT ''"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_proxy','Proxy-Einstellungen','Sollte Ihr Webserver sich hinter einem Proxy befinden, so können Sie hier MXChange so konfigurieren, dass es Updates durch diesen hindurch sucht!', 15)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `proxy_host` VARCHAR(255) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `proxy_port` INT(5) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `proxy_username` VARCHAR(255) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `proxy_password` VARCHAR(255) NOT NULL DEFAULT ''"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_proxy','Proxy-Einstellungen','Sollte Ihr Webserver sich hinter einem Proxy befinden, so können Sie hier MXChange so konfigurieren, dass es Updates durch diesen hindurch sucht!', 15)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Proxy-Einstellungen hinzugefügt."; break; case "0.4.4": // SQL queries for v0.4.4 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_admin_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_guest_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_member_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET `what`=NULL WHERE `what`=''"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET `what`=NULL WHERE `what`=''"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET `what`=NULL WHERE `what`=''"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_admin_menu` DROP INDEX `what`, ADD UNIQUE (`what`)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_guest_menu` DROP INDEX `what`, ADD UNIQUE (`what`)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_member_menu` ADD INDEX `action` (`action`)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_member_menu` DROP INDEX `what`, ADD UNIQUE (`what`)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_admin_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_guest_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_member_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `what`=NULL WHERE `what`=''"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `what`=NULL WHERE `what`=''"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `what`=NULL WHERE `what`=''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_admin_menu` DROP INDEX `what`, ADD UNIQUE (`what`)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_guest_menu` DROP INDEX `what`, ADD UNIQUE (`what`)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_member_menu` ADD INDEX `action` (`action`)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_member_menu` DROP INDEX `what`, ADD UNIQUE (`what`)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Schlüssel in Admin-, Gast- und Mitgliedsmenü verbessert."; break; case "0.4.5": // SQL queries for v0.4.5 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD last_month CHAR(2) NOT NULL DEFAULT '00'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD last_week CHAR(2) NOT NULL DEFAULT '00'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD last_month CHAR(2) NOT NULL DEFAULT '00'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD last_week CHAR(2) NOT NULL DEFAULT '00'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Täglichen/wöchentlichen/monatlichen Reset verbessert."; break; case "0.4.6": // SQL queries for v0.4.6 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD gender ENUM ('M','F') NOT NULL DEFAULT 'M'"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_user_data` SET gender=sex WHERE sex != 'M'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` DROP sex"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD gender ENUM ('M','F') NOT NULL DEFAULT 'M'"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_user_data` SET gender=sex WHERE sex != 'M'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP sex"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Offensives Wort "Sex" gegen "Gender" ausgetauscht."; @@ -592,53 +592,53 @@ PRIMARY KEY (id) break; case "0.4.8": // SQL queries for v0.4.8 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_task_system` ADD INDEX (subject)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_task_system` ADD INDEX (subject)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Index für Betreff eingefügt."; break; case "0.4.9": // SQL queries for v0.4.9 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` CHANGE `user_hash` `user_hash` VARCHAR(255) NULL DEFAULT NULL"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_user_data` SET user_hash=NULL WHERE user_hash IS NOT NULL AND status='CONFIRMED'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD UNIQUE (`user_hash`)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` CHANGE `user_hash` `user_hash` VARCHAR(255) NULL DEFAULT NULL"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_user_data` SET user_hash=NULL WHERE user_hash IS NOT NULL AND status='CONFIRMED'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD UNIQUE (`user_hash`)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "User-Hash zum Bestätigen wird auf NULL gesetzt, wenn Account bestätigt wird."; break; case "0.5.0": // SQL queries for v0.5.0 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_refsystem` DROP INDEX `level`"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_refsystem` DROP INDEX `userid`, ADD UNIQUE `userid_level` (`userid`,`level`)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_refsystem` DROP INDEX `level`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_refsystem` DROP INDEX `userid`, ADD UNIQUE `userid_level` (`userid`,`level`)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Referal-System unterstützt nun detailierte Referal-Übersicht und vieles mehr."; break; case "0.5.1": // SQL queries for v0.5.1 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_member_menu` DROP `descr`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_member_menu` DROP `descr`"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Beschreibungsspalte von Mitgliedsmenü entfernt, welche ohnehin nicht genutzt wird."; break; case "0.5.2": // SQL queries for v0.5.2 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_refdepths` CHANGE `percents` `percents` FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_refdepths` CHANGE `percents` `percents` FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Prozents&aum;tze können nun fünf Stelle hinter dem Komma sein."; break; case "0.5.3": // SQL queries for v0.5.3 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD session_save_path VARCHAR(255) NOT NULL DEFAULT ''"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_session','Session-Einstellungen','Ändern Sie hier den Speicherpfad für Sessiondateien (Sitzungsdateien) ab, falls die Standart-Einstellung bei Ihrem Hoster zu Problem führen sollte.', 16)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD session_save_path VARCHAR(255) NOT NULL DEFAULT ''"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_session','Session-Einstellungen','Ändern Sie hier den Speicherpfad für Sessiondateien (Sitzungsdateien) ab, falls die Standart-Einstellung bei Ihrem Hoster zu Problem führen sollte.', 16)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Session-Speicherpfad konfigurierbar. Beispielsweise ist dies bei all-inkl.com nötig."; break; case "0.5.4": // SQL queries for v0.5.4 - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','reflist','Ref-Übersicht',5,'Y','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','reflist','Ref-Übersicht',5,'Y','N')"; // Depends on refback extension $EXT_UPDATE_DEPENDS = "refback"; @@ -648,15 +648,15 @@ PRIMARY KEY (id) break; case "0.5.5": // SQL queries for v0.5.5 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD show_points_unconfirmed ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD show_points_unconfirmed ENUM('Y','N') NOT NULL DEFAULT 'Y'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Anzeige der {!POINTS!} unter den unbestätigten Mails kann nun optional abgeschaltet werden."; break; case "0.5.6": // SQL queries for v0.5.6 - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_user_stats_data`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_user_stats_data` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_stats_data`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_user_stats_data` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `stats_type` VARCHAR(255) NOT NULL DEFAULT 'unknown', @@ -672,47 +672,47 @@ INDEX (`stats_type`) break; case "0.5.7": // SQL queries for v0.5.7 - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE what='list_norefs' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='list_norefs' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Auflistung der Mitglieder ohne Werber nach what=list_user&mode=norefs verschoben."; break; case "0.5.8": // SQL queries for v0.5.8 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_extensions` DROP `ext_lang_file`"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_extensions` DROP `ext_lang_file`"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Sprachdateinamen werden nicht mehr in der Datenbank behalten."; break; case "0.5.9": // SQL queries for v0.5.9 - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_filters`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_filters` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_filters`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_filters` ( `filter_id` BIGINT(20) UNSIGNED AUTO_INCREMENT, `filter_name` VARCHAR(255) NOT NULL DEFAULT '', `filter_function` VARCHAR(255) NOT NULL DEFAULT '', `filter_active` ENUM('N','Y') NOT NULL DEFAULT 'Y', PRIMARY KEY (`filter_id`) ) TYPE=MyISAM COMMENT='Filter system'"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','list_filter','Filter-Management', 'Zeigt alle im System registrierten Filter an und lässt diese de- bzw. wieder aktivieren.', 17)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','list_filter','Filter-Management', 'Zeigt alle im System registrierten Filter an und lässt diese de- bzw. wieder aktivieren.', 17)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Tabellen für Filter-System hinzugefügt."; break; case "0.6.0": // SQL queries for v0.6.0 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_filters` ADD `filter_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `update_filter_usage` ENUM('N','Y') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_filters` ADD `filter_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `update_filter_usage` ENUM('N','Y') NOT NULL DEFAULT 'N'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Benutzungsstatistik eingebaut. Das Zählen der Filterverwendungen sollte ausschliesslich zu Debugging-Zwecken eingesetzt werden."; break; case "0.6.1": // SQL queries for v0.6.1 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` DROP login_failtures"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` DROP last_failture"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD login_failures BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD last_failure TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP login_failtures"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP last_failture"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD login_failures BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD last_failure TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Falsche Schreibweise korregiert."; diff --git a/inc/extensions/ext-surfbar.php b/inc/extensions/ext-surfbar.php index 6b596810ee..f8a31f8729 100644 --- a/inc/extensions/ext-surfbar.php +++ b/inc/extensions/ext-surfbar.php @@ -50,8 +50,8 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run (surfbar URLs) - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_surfbar_urls`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_surfbar_urls` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_urls`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_surfbar_urls` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `url` VARCHAR(255) NOT NULL DEFAULT '', @@ -71,8 +71,8 @@ INDEX `status_userid` (`status`,`userid`) ) TYPE=MyISAM COMMENT='Surfbar URLs'"; // Reload locks - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_surfbar_locks`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_surfbar_locks` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_locks`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_surfbar_locks` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -83,8 +83,8 @@ INDEX (`url_id`) ) TYPE=MyISAM COMMENT='Surfbar reload locks'"; // Surfbar salts - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_surfbar_salts`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_surfbar_salts` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_salts`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_surfbar_salts` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -95,8 +95,8 @@ INDEX (`url_id`) ) TYPE=MyISAM COMMENT='Surfbar last used salts'"; // Statistics - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_surfbar_stats`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_surfbar_stats` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_stats`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_surfbar_stats` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -108,8 +108,8 @@ INDEX (`url_id`) ) TYPE=MyISAM COMMENT='Surfbar Statistics'"; // Member actions pending on status - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_surfbar_actions`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_surfbar_actions` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_actions`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_surfbar_actions` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED','DEPLETED') NULL DEFAULT NULL, `action` ENUM('EDIT','DELETE','PAUSE','UNPAUSE','FRAMETEST','RETREAT','RESUBMIT','BOOKNOW') NULL DEFAULT NULL, @@ -119,76 +119,76 @@ UNIQUE KEY `status_action` (`status`,`action`) ) TYPE=MyISAM COMMENT='Surfbar Member Actions'"; // Member actions - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('PENDING','RETREAT','DELETED')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('PENDING','FRAMETEST',NULL)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('PENDING','EDIT',NULL)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('ACTIVE','EDIT','PENDING')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('ACTIVE','DELETE','DELETED')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('ACTIVE','PAUSE','STOPPED')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('ACTIVE','FRAMETEST',NULL)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('LOCKED','DELETE','DELETED')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('LOCKED','FRAMETEST',NULL)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('LOCKED','RESUBMIT','PENDING')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('STOPPED','EDIT','PENDING')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('STOPPED','DELETE','DELETED')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('STOPPED','UNPAUSE','PENDING')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('DEPLETED','EDIT','PENDING')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('DEPLETED','DELETE','DELETED')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('REJECTED','EDIT','PENDING')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('REJECTED','DELETE','DELETED')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('REJECTED','FRAMETEST',NULL)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('REJECTED','RESUBMIT','PENDING')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('MIGRATED','EDIT','MIGRATED')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('MIGRATED','DELETE','DELETED')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('MIGRATED','FRAMETEST',NULL)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('MIGRATED','BOOKNOW','PENDING')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('PENDING','RETREAT','DELETED')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('PENDING','FRAMETEST',NULL)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('PENDING','EDIT',NULL)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('ACTIVE','EDIT','PENDING')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('ACTIVE','DELETE','DELETED')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('ACTIVE','PAUSE','STOPPED')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('ACTIVE','FRAMETEST',NULL)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('LOCKED','DELETE','DELETED')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('LOCKED','FRAMETEST',NULL)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('LOCKED','RESUBMIT','PENDING')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('STOPPED','EDIT','PENDING')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('STOPPED','DELETE','DELETED')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('STOPPED','UNPAUSE','PENDING')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('DEPLETED','EDIT','PENDING')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('DEPLETED','DELETE','DELETED')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('REJECTED','EDIT','PENDING')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('REJECTED','DELETE','DELETED')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('REJECTED','FRAMETEST',NULL)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('REJECTED','RESUBMIT','PENDING')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('MIGRATED','EDIT','MIGRATED')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('MIGRATED','DELETE','DELETED')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('MIGRATED','FRAMETEST',NULL)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('MIGRATED','BOOKNOW','PENDING')"; // Config entries - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_pay_model` ENUM('STATIC','DYNAMIC') NOT NULL DEFAULT 'STATIC'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_static_reward` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.25000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_static_costs` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_static_time` SMALLINT(6) UNSIGNED NOT NULL DEFAULT 60"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_static_lock` SMALLINT(6) UNSIGNED NOT NULL DEFAULT ".(60*5).""; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_dynamic_percent` FLOAT(10,5) UNSIGNED NOT NULL DEFAULT 10.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_max_order` INT(7) UNSIGNED NOT NULL DEFAULT 10"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_restart_time` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(60*6).""; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_autostart` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_migrate_urls` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_total_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_daily_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_yester_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_weekly_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_monthly_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_stats_reload` BIGINT(20) UNSIGNED NOT NULL DEFAULT 30"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_purge_deleted` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*7).""; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_purge_migrated` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*3).""; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_pause_mode` ENUM('INTERNAL','EXERNAL') NOT NULL DEFAULT 'INTERNAL'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_pause_url` VARCHAR(255) NOT NULL DEFAULT ''"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_notify_limits` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_notify_admin_unlock` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_warn_low_points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 100"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_low_interval` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".getConfig('one_day').""; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_migrate_order` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `surfbar_notification_mode` ENUM('INSTANT','RESET') NOT NULL DEFAULT 'INSTANT'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_pay_model` ENUM('STATIC','DYNAMIC') NOT NULL DEFAULT 'STATIC'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_static_reward` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.25000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_static_costs` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_static_time` SMALLINT(6) UNSIGNED NOT NULL DEFAULT 60"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_static_lock` SMALLINT(6) UNSIGNED NOT NULL DEFAULT ".(60*5).""; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_dynamic_percent` FLOAT(10,5) UNSIGNED NOT NULL DEFAULT 10.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_max_order` INT(7) UNSIGNED NOT NULL DEFAULT 10"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_restart_time` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(60*6).""; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_autostart` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_migrate_urls` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_total_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_daily_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_yester_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_weekly_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_monthly_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_stats_reload` BIGINT(20) UNSIGNED NOT NULL DEFAULT 30"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_purge_deleted` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*7).""; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_purge_migrated` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*3).""; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_pause_mode` ENUM('INTERNAL','EXERNAL') NOT NULL DEFAULT 'INTERNAL'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_pause_url` VARCHAR(255) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_notify_limits` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_notify_admin_unlock` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_warn_low_points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 100"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_low_interval` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".getConfig('one_day').""; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_migrate_order` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_notification_mode` ENUM('INSTANT','RESET') NOT NULL DEFAULT 'INSTANT'"; // Extend user data - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD `surfbar_low_notified` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD `surfbar_low_notified` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'"; // Member menus - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar',NULL,'Surfbar','Y','Y',4)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_start','Surfbar starten','Y','Y',1)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_book','URL buchen','Y','Y',2)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_list','URL-Verwaltung','Y','Y',3)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_stats','URL-Statistiken','Y','Y',4)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar',NULL,'Surfbar','Y','Y',4)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_start','Surfbar starten','Y','Y',1)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_book','URL buchen','Y','Y',2)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_list','URL-Verwaltung','Y','Y',3)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_stats','URL-Statistiken','Y','Y',4)"; // Admin menus - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar',NULL,'Surfbar','URLs in der Surfbar verwalten, Einstellungen ändern und vieles mehr.',7)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','add_surfbar_url','URL hinzufügen','Fügen Sie URLs z.B. von Werbenetzwerken hinzu, oder Ihre eigenen Projekte. Vorsicht! Ihnen muss es auch gestattet sein, URLs aus dem Werbenetzwerk in die Surfbar einzufügen.',1)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','list_surfbar_urls','URLs verwalten','Verwalten Sie hier alle in der Surfbar befindlichen URLs mit nur wenigen Klicks.',2)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','unlock_surfbar_urls','Wartende URLs freigeben','Geben Sie hier nur direkt in der Surfbar gebuchte URLs frei.',3)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','config_surfbar','Einstellungen','Einstellungen an der Surfbar ändern, wie Festvergütung, prozentuale Ref-Vergütung und vieles mehr.',4)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','surfbar_stats','Statistiken','Detailierte Statistiken zu einer ausgewählten URL anzeigen.',5)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','list_surfbar_actions','Mitgliederaktionen','Listet alle Mitgliederaktionen auf.',6)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar',NULL,'Surfbar','URLs in der Surfbar verwalten, Einstellungen ändern und vieles mehr.',7)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','add_surfbar_url','URL hinzufügen','Fügen Sie URLs z.B. von Werbenetzwerken hinzu, oder Ihre eigenen Projekte. Vorsicht! Ihnen muss es auch gestattet sein, URLs aus dem Werbenetzwerk in die Surfbar einzufügen.',1)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','list_surfbar_urls','URLs verwalten','Verwalten Sie hier alle in der Surfbar befindlichen URLs mit nur wenigen Klicks.',2)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','unlock_surfbar_urls','Wartende URLs freigeben','Geben Sie hier nur direkt in der Surfbar gebuchte URLs frei.',3)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','config_surfbar','Einstellungen','Einstellungen an der Surfbar ändern, wie Festvergütung, prozentuale Ref-Vergütung und vieles mehr.',4)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','surfbar_stats','Statistiken','Detailierte Statistiken zu einer ausgewählten URL anzeigen.',5)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','list_surfbar_actions','Mitgliederaktionen','Listet alle Mitgliederaktionen auf.',6)"; // Load CSS? $EXT_CSS = "Y"; @@ -196,25 +196,25 @@ UNIQUE KEY `status_action` (`status`,`action`) case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_surfbar_actions`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_surfbar_locks`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_surfbar_salts`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_surfbar_stats`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_surfbar_urls`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_member_menu` WHERE `action`='surfbar' LIMIT 5"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE `action`='surfbar' LIMIT 7"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_actions`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_locks`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_salts`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_stats`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_urls`"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='surfbar' LIMIT 5"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='surfbar' LIMIT 7"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `action`='surfbar' LIMIT 5"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_mod_reg` SET locked='N', hidden='N', admin_only='N', mem_only='Y' WHERE module='surfbar' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `action`='surfbar' LIMIT 5"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='N', hidden='N', admin_only='N', mem_only='Y' WHERE module='surfbar' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='N', `locked`='Y' WHERE `action` = 'surfbar' LIMIT 5"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_mod_reg` SET locked='Y' WHERE module='surfbar' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE `action` = 'surfbar' LIMIT 5"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='Y' WHERE module='surfbar' LIMIT 1"; break; case "update": // Update an extension diff --git a/inc/extensions/ext-task.php b/inc/extensions/ext-task.php index 618f496634..0c718ad238 100644 --- a/inc/extensions/ext-task.php +++ b/inc/extensions/ext-task.php @@ -50,9 +50,9 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('task', NULL, 'Aufgaben-Management','1','Erweitertes Aufgaben-Management zur leichten verwaltung der vom System erzeugten Aufgaben.')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('task','list_task','Aufgaben auflisten','1','Alle Ihnen zugewiesenen Aufgaben auflisten (keine Updates).')"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_task_system` SET status='SOLVED' WHERE status='CLOSED'"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('task', NULL, 'Aufgaben-Management','1','Erweitertes Aufgaben-Management zur leichten verwaltung der vom System erzeugten Aufgaben.')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('task','list_task','Aufgaben auflisten','1','Alle Ihnen zugewiesenen Aufgaben auflisten (keine Updates).')"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_task_system` SET status='SOLVED' WHERE status='CLOSED'"; // Enable CSS file? $EXT_CSS = "Y"; @@ -60,7 +60,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE action='task' LIMIT 2"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='task' LIMIT 2"; break; case "activate": // Do stuff when admin activates this extension @@ -77,7 +77,7 @@ case "update": // Update an extension switch ($EXT_VER) { case "0.0.1": // SQL queries for v0.0.1 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_extensions` SET ext_has_css='Y' WHERE ext_name='task' AND ext_has_css='N' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_has_css='Y' WHERE ext_name='task' AND ext_has_css='N' LIMIT 1"; // This update depends on sql_patches update! $EXT_UPDATE_DEPENDS = "sql_patches"; diff --git a/inc/extensions/ext-theme.php b/inc/extensions/ext-theme.php index 08ead8333d..15610a5b73 100644 --- a/inc/extensions/ext-theme.php +++ b/inc/extensions/ext-theme.php @@ -54,16 +54,16 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // Drop theme table - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_themes`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_themes`"; // Delete admin menu - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE `action`='theme' LIMIT 4"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='theme' LIMIT 4"; // Delete guest menu entries - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE action='themes' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE action='themes' LIMIT 1"; // Delete member menu entries - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_member_menu` WHERE action='themes' OR `what`='themes' LIMIT 2"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE action='themes' OR `what`='themes' LIMIT 2"; break; case "activate": // Do stuff when admin activates this extension @@ -116,8 +116,8 @@ case "update": // Update an extension case "0.0.8": // SQL queries for v0.0.8 // Theme table - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_themes`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_themes` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_themes`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_themes` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, theme_path VARCHAR(255) NOT NULL DEFAULT '', theme_name VARCHAR(255) NOT NULL DEFAULT '', @@ -129,22 +129,22 @@ INDEX (`theme_active`) ) TYPE=MyISAM COMMENT='Themes'"; // Admin menu - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme', NULL, 'Themes','Verwalten Sie hier alle Designs (Themes) Ihres Mailtausch-Scriptes.', 8)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme','theme_import','Importieren','Es wird das Verzeichnis "theme" nach neuen Ordnern durchsucht und anschliessend in die Datenbank gesperrt aufgenommen.', 1)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme','theme_edit','Modifizieren','Ändern Sie Titel, Freigaben usw. an den Themes. Sie können bis auf das Standart-Theme "default" auch Themes aus der Datenbank entfernen. Vorher sollten Sie es jedoch vom Server löschen, damit es niht erneut importiert werden kann.', 2)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme','theme_check','Prüfen','Nach neuen Themes suchen bzw. nach Updates zu den Themes suchen.', 3)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme', NULL, 'Themes','Verwalten Sie hier alle Designs (Themes) Ihres Mailtausch-Scriptes.', 8)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme','theme_import','Importieren','Es wird das Verzeichnis "theme" nach neuen Ordnern durchsucht und anschliessend in die Datenbank gesperrt aufgenommen.', 1)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme','theme_edit','Modifizieren','Ändern Sie Titel, Freigaben usw. an den Themes. Sie können bis auf das Standart-Theme "default" auch Themes aus der Datenbank entfernen. Vorher sollten Sie es jedoch vom Server löschen, damit es niht erneut importiert werden kann.', 2)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme','theme_check','Prüfen','Nach neuen Themes suchen bzw. nach Updates zu den Themes suchen.', 3)"; // Guest menu - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('themes',NULL,'Design-Auswahl',4,'Y','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('themes',NULL,'Design-Auswahl',4,'Y','N')"; // Memember menu - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('themes',NULL,'Design-Auswahl',3,'Y','N')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','themes','Designs', 6,'Y','N')"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET sort='8' WHERE action='themes' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET action='account', sort='1', title='Designs' WHERE `what`='themes' LIMIT 1"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('themes',NULL,'Design-Auswahl',3,'Y','N')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','themes','Designs', 6,'Y','N')"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET sort='8' WHERE action='themes' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='account', sort='1', title='Designs' WHERE `what`='themes' LIMIT 1"; // User data - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD curr_theme VARCHAR(255) NOT NULL DEFAULT 'default'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD curr_theme VARCHAR(255) NOT NULL DEFAULT 'default'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Update von sql_patches übertragen. (Kann Fehlermeldungen verursacht haben!)"; diff --git a/inc/extensions/ext-top10.php b/inc/extensions/ext-top10.php index cdb0cf93f1..9acd5d9105 100644 --- a/inc/extensions/ext-top10.php +++ b/inc/extensions/ext-top10.php @@ -50,9 +50,9 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','top10','TOP-10','Y','Y', 7)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_top10','TOP-10 Listen','Stellen Sie hier ein, wie lang die TOP-Listen sein sollen, also wie viele Plätze angezeigt werden sollen.', 8)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD top10_max TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','top10','TOP-10','Y','Y', 7)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_top10','TOP-10 Listen','Stellen Sie hier ein, wie lang die TOP-Listen sein sollen, also wie viele Plätze angezeigt werden sollen.', 8)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD top10_max TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"; // Load CSS file? $EXT_CSS = "Y"; @@ -60,18 +60,18 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE what='top10' LIMIT 1"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE what='config_top10' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE what='top10' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_top10' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET visible='Y', locked='N' WHERE what='top10' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y', `locked`='N' WHERE what='top10' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET visible='N', locked='Y' WHERE what='top10' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE what='top10' LIMIT 1"; break; case "update": // Update an extension diff --git a/inc/extensions/ext-transfer.php b/inc/extensions/ext-transfer.php index 5dc29b8010..6b89ad4da8 100644 --- a/inc/extensions/ext-transfer.php +++ b/inc/extensions/ext-transfer.php @@ -50,11 +50,11 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running // SQL commands to run - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_user_transfers_in`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_user_transfers_out`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_transfers_in`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_transfers_out`"; // Transfer from a member - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_user_transfers_in` ( + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_user_transfers_in` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, from_uid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -68,7 +68,7 @@ PRIMARY KEY(id) ) Type=MyISAM"; // Transfers to a member - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_user_transfers_out` ( + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_user_transfers_out` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, to_uid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -82,42 +82,42 @@ PRIMARY KEY(id) ) Type=MyISAM"; // Admin menu - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('transfer', NULL, '{!POINTS!}-Transfer','Verwalten Sie hier die {!POINTS!}-Transaktionen zwischen Ihren Mitgliedern.', 7)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('transfer','list_transfer','Auflisten','Hier bekommen Sie alle ein- und ausgehende Transaktionen aufgelistet.', 1)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('transfer','config_transfer','Einstellungen','Stellen Sie ein, wie viele Transaktionen aufgelistet werden sollen und wie alt diese werden dürfen. Die evtl. installierte autopurge-Erweiterung kann dann automatisch die veralteten Transktionen löschen.', 2)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('transfer','del_transfer','Manuell löschen','Hier können Sie - abgesehen von der automatischen Löschung - Transaktionen selber löschen. Bitte beachten Sie, dass immer aus- und eingehende Transaktionen gleichzeitig gelöscht werden.', 3)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('transfer', NULL, '{!POINTS!}-Transfer','Verwalten Sie hier die {!POINTS!}-Transaktionen zwischen Ihren Mitgliedern.', 7)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('transfer','list_transfer','Auflisten','Hier bekommen Sie alle ein- und ausgehende Transaktionen aufgelistet.', 1)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('transfer','config_transfer','Einstellungen','Stellen Sie ein, wie viele Transaktionen aufgelistet werden sollen und wie alt diese werden dürfen. Die evtl. installierte autopurge-Erweiterung kann dann automatisch die veralteten Transktionen löschen.', 2)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('transfer','del_transfer','Manuell löschen','Hier können Sie - abgesehen von der automatischen Löschung - Transaktionen selber löschen. Bitte beachten Sie, dass immer aus- und eingehende Transaktionen gleichzeitig gelöscht werden.', 3)"; // Member menu - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','transfer','{!POINTS!}-Transfer','Y','Y', 5)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','transfer','{!POINTS!}-Transfer','Y','Y', 5)"; // Add config values - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD transfer_max BIGINT(20) UNSIGNED NOT NULL DEFAULT '50'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD transfer_age BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getConfig('one_day')*28)."'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD transfer_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '".getConfig('one_day')."'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD transfer_balance BIGINT(20) UNSIGNED NOT NULL DEFAULT 100"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD transfer_code BIGINT(20) UNSIGNED NOT NULL DEFAULT 5"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD transfer_max BIGINT(20) UNSIGNED NOT NULL DEFAULT '50'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD transfer_age BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getConfig('one_day')*28)."'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD transfer_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '".getConfig('one_day')."'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD transfer_balance BIGINT(20) UNSIGNED NOT NULL DEFAULT 100"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD transfer_code BIGINT(20) UNSIGNED NOT NULL DEFAULT 5"; // Add row(s) to user's data - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD opt_in ENUM('Y','N') NOT NULL DEFAULT 'N'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD opt_in ENUM('Y','N') NOT NULL DEFAULT 'N'"; break; case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_user_transfers_in`"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_user_transfers_out`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE action='transfer' LIMIT 4"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_member_menu` WHERE what='transfer' LIMIT 1"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` DROP opt_in"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_transfers_in`"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_transfers_out`"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='transfer' LIMIT 4"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='transfer' LIMIT 1"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP opt_in"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='Y', locked='N' WHERE what='transfer' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='transfer' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='Y', locked='N' WHERE what='transfer' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='transfer' LIMIT 1"; break; case "update": // Update an extension @@ -139,7 +139,7 @@ case "update": // Update an extension break; case "0.0.5": // SQL queries for v0.0.5 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD ap_transfer ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD ap_transfer ENUM('Y','N') NOT NULL DEFAULT 'Y'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Link Auflisten im Admin-Bereich hatte das eingeloggte Mitglied und nicht den eingeloggten Admin abgefragt. Automatisches Löschen von veraltete Einträgen kann unabhängig von der autopurge-Erweiterung de-/aktiviert werden. Bitte aktualisieren Sie auch die beiden Admin-Templates!"; @@ -231,9 +231,9 @@ case "update": // Update an extension break; case "0.2.3": // SQL queries for v0.2.3 - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu_las` (la_id, la_action, la_what) VALUES ('member', '', 'list_transfer')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu_las` (la_id, la_action, la_what) VALUES ('member', '', 'del_transfer')"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu_las` (la_id, la_action, la_what) VALUES ('config', '', 'config_transfer')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu_las` (la_id, la_action, la_what) VALUES ('member', '', 'list_transfer')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu_las` (la_id, la_action, la_what) VALUES ('member', '', 'del_transfer')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu_las` (la_id, la_action, la_what) VALUES ('config', '', 'config_transfer')"; // Depends on sql_patches (or you have to execute these both SQL statements by phpMyAdmin $EXT_UPDATE_DEPENDS = "sql_patches"; @@ -248,7 +248,7 @@ case "update": // Update an extension break; case "0.2.5": // SQL queries for v0.2.5 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET action='extras', sort='5' WHERE what='transfer' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='extras', sort='5' WHERE what='transfer' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Mitgliedsmenü komplett geändert."; diff --git a/inc/extensions/ext-usage.php b/inc/extensions/ext-usage.php index d782e3b99e..301c92abe8 100644 --- a/inc/extensions/ext-usage.php +++ b/inc/extensions/ext-usage.php @@ -50,13 +50,13 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('stats','usage','Aufrufstatistik','Erkennt automatisch Ihre Aufrufstatisiken und bindet diese in das Admin-Interface ein. (Derzeit nur Webalizer!)',9)"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `usage_base` VARCHAR(255) NOT NULL DEFAULT 'usage'"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('stats','usage','Aufrufstatistik','Erkennt automatisch Ihre Aufrufstatisiken und bindet diese in das Admin-Interface ein. (Derzeit nur Webalizer!)',9)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `usage_base` VARCHAR(255) NOT NULL DEFAULT 'usage'"; break; case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE what='usage' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='usage' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-user.php b/inc/extensions/ext-user.php index cc7f2a1e61..479ab03e66 100644 --- a/inc/extensions/ext-user.php +++ b/inc/extensions/ext-user.php @@ -47,16 +47,16 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user',NULL,'Mitglieder-Management','Mitglieder freischalten, sperren, Accounts editieren, Neuanmeldungen verwalten, {!POINTS!} gutschreiben und abziehen und und und...',3)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','del_user','Mitglied löschen','Löschen Sie hier Mitglied, die gegen die AGBs mehrmals verstossen haben. Bitte seien Sie nett zu Ihren Mitgliedern und löschen Sie nicht gleich.',1)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','chk_regs','Anmeldungen prüfen','Prüfen Sie hier neue Anmeldungen zu Ihrem System. Hier können Sie im Falle einer Fehler-Mail den Mitglied gleich wieder löschen!',2)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','lock_user','Mitglied sperren / entsperren','Sperren Sie Mitglied, die zu viele unbestätigte Mails haben oder gegen Ihre AGBs verstossen haben über diesen Menüpunkt.',3)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_user','Mitglied auflisten','Listen Sie alle Mitglied oder eingeschränkt nach Suchkritieren Ihre Userdatenbank auf. Sie könen per Klick auf die Usernummer sich Details zum Mitglied ansehen.',4)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','add_points','{!POINTS!} gutschreiben','Buchen Sie einem Mitglied direkt {!POINTS!} auf. Sie können dazu auch einen Kommentar mitsenden.',5)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','edit_user','Account editieren','Daten eines Mitglieder-Accountes ändern.',6)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_refs','Referals anzeigen','Mit diesem Menüpunkt können Sie die generierten Referals eines Mitgliedes auflisten.',7)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_links','Unbestätigte Mails','Mit diesem Menüpunkt können Sie die vom Mitglied nicht bestätigten Mails anzeigen.',8)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_cats','Kategorien anzeigen','Listet die ausgewählten Kategorien eines Mitgliedes auf.',9)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user',NULL,'Mitglieder-Management','Mitglieder freischalten, sperren, Accounts editieren, Neuanmeldungen verwalten, {!POINTS!} gutschreiben und abziehen und und und...',3)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','del_user','Mitglied löschen','Löschen Sie hier Mitglied, die gegen die AGBs mehrmals verstossen haben. Bitte seien Sie nett zu Ihren Mitgliedern und löschen Sie nicht gleich.',1)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','chk_regs','Anmeldungen prüfen','Prüfen Sie hier neue Anmeldungen zu Ihrem System. Hier können Sie im Falle einer Fehler-Mail den Mitglied gleich wieder löschen!',2)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','lock_user','Mitglied sperren / entsperren','Sperren Sie Mitglied, die zu viele unbestätigte Mails haben oder gegen Ihre AGBs verstossen haben über diesen Menüpunkt.',3)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_user','Mitglied auflisten','Listen Sie alle Mitglied oder eingeschränkt nach Suchkritieren Ihre Userdatenbank auf. Sie könen per Klick auf die Usernummer sich Details zum Mitglied ansehen.',4)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','add_points','{!POINTS!} gutschreiben','Buchen Sie einem Mitglied direkt {!POINTS!} auf. Sie können dazu auch einen Kommentar mitsenden.',5)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','edit_user','Account editieren','Daten eines Mitglieder-Accountes ändern.',6)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_refs','Referals anzeigen','Mit diesem Menüpunkt können Sie die generierten Referals eines Mitgliedes auflisten.',7)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_links','Unbestätigte Mails','Mit diesem Menüpunkt können Sie die vom Mitglied nicht bestätigten Mails anzeigen.',8)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_cats','Kategorien anzeigen','Listet die ausgewählten Kategorien eines Mitgliedes auf.',9)"; // Load CSS-File? $EXT_CSS = "Y"; @@ -64,8 +64,8 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE `what` IN('config_user','user_contct','list_user_del') LIMIT 3"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_user_del`"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what` IN('config_user','user_contct','list_user_del') LIMIT 3"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_del`"; break; case "activate": // Do stuff when admin activates this extension @@ -82,14 +82,14 @@ case "update": // Update an extension switch ($EXT_VER) { case "0.1": // SQL queries for v0.1 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `user_limit` INT(7) UNSIGNED NOT NULL DEFAULT 20"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `user_limit` INT(7) UNSIGNED NOT NULL DEFAULT 20"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Seitenweises Anzeigen der User-Liste ist nun möglich."; break; case "0.1.1": // SQL queries for v0.1.1 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_extensions` SET `ext_has_css`='Y' WHERE `ext_name`='user' AND `ext_has_css`='N' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_extensions` SET `ext_has_css`='Y' WHERE `ext_name`='user' AND `ext_has_css`='N' LIMIT 1"; // This update depends on sql_patches update! $EXT_UPDATE_DEPENDS = "sql_patches"; @@ -98,7 +98,7 @@ case "update": // Update an extension $UPDATE_NOTES = "CSS-Datei kann per Admin-Bereich ein- und ausgeschaltet werden."; case "0.1.2": // SQL queries for v0.1.2 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD `mails_confirmed` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD `mails_confirmed` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Dem Mitglied wird nun angezeigt, wie viele Mails er bestätigt hat. Alle vor dieser Version best. Mails werden leider nicht mehr berücksichtigt! Bitte teilen Sie dies Ihren Mitgliedern mit."; @@ -110,7 +110,7 @@ case "update": // Update an extension break; case "0.1.4": // SQL queries for v0.1.4 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD `emails_received` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD `emails_received` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Anzahl empfangener Mails wird angezeigt. Diese Anzeige kann fehlerhaft sein, wenn Sie bereits Mitglieder in Ihrem {!MT_WORD!} haben sollen!"; @@ -147,15 +147,15 @@ case "update": // Update an extension break; case "0.2.1": // SQL queries for v0.2.1 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `user_alpha` TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_user','Mitgliederliste','Anzahl Mitglieder pro Seite, Anzahl Buchstaben pro Zeile usw.', 8)"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `user_alpha` TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_user','Mitgliederliste','Anzahl Mitglieder pro Seite, Anzahl Buchstaben pro Zeile usw.', 8)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "User-Liste ist konfigurierbar: Anzahl Mitglieder pro Seite und Anzahl Buchstaben pro Zeile; Template-Fehler beseitigt."; break; case "0.2.2": // SQL queries for v0.2.2 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` CHANGE `gender` `gender` ENUM('M','F','C') NOT NULL DEFAULT 'M'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` CHANGE `gender` `gender` ENUM('M','F','C') NOT NULL DEFAULT 'M'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Anrede "Firma" hinzugefügt."; @@ -192,7 +192,7 @@ case "update": // Update an extension break; case "0.2.9": // SQL queries for v0.2.9 - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','user_contct','Mitglied kontaktieren','Kontaktieren Sie hier Ihre Mitglieder ganz direkt über ein Webformular. Sie brauchen somit kein EMail-Programm mehr starten!', 8)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','user_contct','Mitglied kontaktieren','Kontaktieren Sie hier Ihre Mitglieder ganz direkt über ein Webformular. Sie brauchen somit kein EMail-Programm mehr starten!', 8)"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Admin-Kontaktformular hinzugefügt."; @@ -204,7 +204,7 @@ case "update": // Update an extension break; case "0.3.1": // SQL queries for v0.3.1 - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET `title` = 'Mitglieder-Management' WHERE `action`='user' AND (`what`='' OR `what` IS NULL) LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `title` = 'Mitglieder-Management' WHERE `action`='user' AND (`what`='' OR `what` IS NULL) LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Verwaltung auf Management umgestellt"; @@ -221,21 +221,21 @@ case "update": // Update an extension break; case "0.3.4": // SQL queries for v0.3.4 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `select_user_zero_refid` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `user_min_confirmed` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 10"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD `rand_confirmed` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `select_user_zero_refid` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `user_min_confirmed` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 10"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD `rand_confirmed` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Mitglieder werden per Zufall als Referal-ID ausgewählt, die eine Mindestanzahl an bestätigten Mails haben, wenn die Ref-Id 0 ist."; break; case "0.3.5": // SQL queries for v0.3.5 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD `lock_reason` TINYTEXT"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD `lock_timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `user_delete_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day') * 30).""; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_user_del','Löschungen auflisten','Listet die Löschungen von Usern auf.', 9)"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_user_del`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_user_del` ( + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD `lock_reason` TINYTEXT"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD `lock_timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `user_delete_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day') * 30).""; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_user_del','Löschungen auflisten','Listet die Löschungen von Usern auf.', 9)"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_del`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_user_del` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `email` VARCHAR(255) NOT NULL DEFAULT '', diff --git a/inc/extensions/ext-wernis.php b/inc/extensions/ext-wernis.php index 85268bee8b..5d3ac30fbc 100644 --- a/inc/extensions/ext-wernis.php +++ b/inc/extensions/ext-wernis.php @@ -50,8 +50,8 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_user_wernis`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_user_wernis` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_wernis`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_user_wernis` ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, wernis_account VARCHAR(255) NOT NULL DEFAULT '', @@ -65,80 +65,80 @@ PRIMARY KEY(id) ) TYPE=MyISAM"; // Confiuration - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD wernis_min_payout BIGINT(20) UNSIGNED NOT NULL DEFAULT '40000'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD wernis_min_withdraw BIGINT(20) UNSIGNED NOT NULL DEFAULT '5000'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD wernis_api_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD wernis_api_md5 VARCHAR(32) NOT NULL DEFAULT ''"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD wernis_api_url VARCHAR(255) NOT NULL DEFAULT 'http://www.wds66.com/api/'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD wernis_min_payout BIGINT(20) UNSIGNED NOT NULL DEFAULT '40000'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD wernis_min_withdraw BIGINT(20) UNSIGNED NOT NULL DEFAULT '5000'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD wernis_api_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD wernis_api_md5 VARCHAR(32) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD wernis_api_url VARCHAR(255) NOT NULL DEFAULT 'http://www.wds66.com/api/'"; // User data - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD wernis_userid VARCHAR(6) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD wernis_userid VARCHAR(6) NOT NULL DEFAULT ''"; // Admin menu - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('wernis', NULL, 'Wernis-Management','Konfiguration zur WDS66-API einstellen, Auszahlungen auflisten usw..', 15)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('wernis','config_wernis','WDS66-API-Einstellungen','Konfiguration zur WDS66-API einstellen.', 1)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('wernis','list_wernis','Wernis-Anfragen auflisten','Listet alle Wernis-Auszahlungsanfragen Ihrer Mitglieder auf.', 2)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('wernis', NULL, 'Wernis-Management','Konfiguration zur WDS66-API einstellen, Auszahlungen auflisten usw..', 15)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('wernis','config_wernis','WDS66-API-Einstellungen','Konfiguration zur WDS66-API einstellen.', 1)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('wernis','list_wernis','Wernis-Anfragen auflisten','Listet alle Wernis-Auszahlungsanfragen Ihrer Mitglieder auf.', 2)"; // Member menu - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','wernis','Wernis-Ein-/Auszahlungen','N','N', 11)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','wernis','Wernis-Ein-/Auszahlungen','N','N', 11)"; // Guest menu - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','wernis_portal','WDS66-News','N','N', 7)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','wernis_portal','WDS66-News','N','N', 7)"; break; case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_user_wernis`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE action='wernis'"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_member_menu` WHERE what='wernis' LIMIT 1"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE what='wernis_portal' LIMIT 1"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_wernis`"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='wernis'"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='wernis' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE what='wernis_portal' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET visible='Y', locked='N' WHERE what='wernis_portal' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='Y', locked='N' WHERE what='wernis' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y', `locked`='N' WHERE what='wernis_portal' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='wernis' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET visible='N', locked='Y' WHERE what='wernis_portal' LIMIT 1"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='N', locked='Y' WHERE what='wernis' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE what='wernis_portal' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='wernis' LIMIT 1"; break; case "update": // Update an extension switch ($EXT_VER) { case "0.0.1": // SQL queries for v0.0.1 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD wernis_payout_active ENUM ('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD wernis_withdraw_active ENUM ('Y','N') NOT NULL DEFAULT 'Y'"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD wernis_payout_factor FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD wernis_withdraw_factor FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD wernis_payout_fee_percent FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD wernis_withdraw_fee_percent FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD wernis_payout_fee_fix BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD wernis_withdraw_fee_fix BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD wernis_payout_active ENUM ('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD wernis_withdraw_active ENUM ('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD wernis_payout_factor FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD wernis_withdraw_factor FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD wernis_payout_fee_percent FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD wernis_withdraw_fee_percent FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD wernis_payout_fee_fix BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD wernis_withdraw_fee_fix BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Ein-/Auszahlungsfunktion getrennt ein- und ausschaltbar, sowie mit Umrechungsfaktoren {!POINTS!}->Wernis versehen. Prozentualer Abzug als "Betreibergebühr hinzugefügt, was z.B. für Wechselstuben interessant ist."; break; case "0.0.2": // SQL queries for v0.0.2 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD wernis_pass_md5 VARCHAR(32) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD wernis_pass_md5 VARCHAR(32) NOT NULL DEFAULT ''"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Auszahlunsfunktion an die neue API 0.2-BETA angepasst. Demnach muss Ihr Wernis-Passwort beim Auszahlen benutzt werden und in Ihrem {!MT_WORD!} als MD5-Hash gespeichert werden."; break; case "0.0.3": // SQL queries for v0.0.3 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` CHANGE `wernis_refid` `wernis_refid` INT(5) UNSIGNED ZEROFILL NOT NULL DEFAULT '00000'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` CHANGE `wernis_refid` `wernis_refid` INT(5) UNSIGNED ZEROFILL NOT NULL DEFAULT '00000'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Spaltentyp von VARCHAR(6) auf BIGINT(5) geändert."; break; case "0.0.4": // SQL queries for v0.0.4 - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `wernis_refid` INT(5) UNSIGNED ZEROFILL NOT NULL DEFAULT '00000'"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `wernis_refid` INT(5) UNSIGNED ZEROFILL NOT NULL DEFAULT '00000'"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Fehlende Ref-Id hinzugetan."; diff --git a/inc/extensions/ext-yoomedia.php b/inc/extensions/ext-yoomedia.php index 4b31cda013..fd51d9974e 100644 --- a/inc/extensions/ext-yoomedia.php +++ b/inc/extensions/ext-yoomedia.php @@ -54,24 +54,24 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `yoomedia_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `yoomedia_sid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `yoomedia_passwd` VARCHAR(255) NOT NULL DEFAULT ''"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `yoomedia_erotic_allowed` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `yoomedia_tm_max_reload` SMALLINT(6) UNSIGNED NOT NULL DEFAULT ".(24 * 8).""; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `yoomedia_tm_min_wait` SMALLINT(6) UNSIGNED NOT NULL DEFAULT 60"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `yoomedia_tm_clicks_remain` INT(7) UNSIGNED NOT NULL DEFAULT 1000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `yoomedia_tm_min_pay` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `yoomedia_requests_total` SMALLINT(6) UNSIGNED NOT NULL DEFAULT 200"; - $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD `yoomedia_requests_remain` SMALLINT(6) UNSIGNED NOT NULL DEFAULT 200"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `yoomedia_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `yoomedia_sid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `yoomedia_passwd` VARCHAR(255) NOT NULL DEFAULT ''"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `yoomedia_erotic_allowed` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `yoomedia_tm_max_reload` SMALLINT(6) UNSIGNED NOT NULL DEFAULT ".(24 * 8).""; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `yoomedia_tm_min_wait` SMALLINT(6) UNSIGNED NOT NULL DEFAULT 60"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `yoomedia_tm_clicks_remain` INT(7) UNSIGNED NOT NULL DEFAULT 1000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `yoomedia_tm_min_pay` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `yoomedia_requests_total` SMALLINT(6) UNSIGNED NOT NULL DEFAULT 200"; + $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `yoomedia_requests_remain` SMALLINT(6) UNSIGNED NOT NULL DEFAULT 200"; // Admin menu - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_yoomedia','Yoo!Media Interface 2.0','Einstellungen zum Yoo!Media Interface 2.0, wie User-ID, Interface-Passwort und vieles mehr.',17)"; - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','list_yoomedia_tm','Yoo!Media Textmails','Listet Textmail-Buchungen über das Interface 2.0 von Yoo!Media nach Ihren eingestellten Kriterien auf. Vorsicht: Jede Aktualisierung dieser Liste kostet Ihnen eine Abfrage!',10)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_yoomedia','Yoo!Media Interface 2.0','Einstellungen zum Yoo!Media Interface 2.0, wie User-ID, Interface-Passwort und vieles mehr.',17)"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','list_yoomedia_tm','Yoo!Media Textmails','Listet Textmail-Buchungen über das Interface 2.0 von Yoo!Media nach Ihren eingestellten Kriterien auf. Vorsicht: Jede Aktualisierung dieser Liste kostet Ihnen eine Abfrage!',10)"; // Reload lock table - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_yoomedia_reload`"; - $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_yoomedia_reload` ( + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_yoomedia_reload`"; + $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_yoomedia_reload` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `type` VARCHAR(255) NOT NULL DEFAULT 'general', `y_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -84,8 +84,8 @@ UNIQUE `y_type` (`type`,`y_id`) case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE `what` IN('config_yoomedia','list_yoomedia_tm') LIMIT 2"; - $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_yoomedia_reload`"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what` IN('config_yoomedia','list_yoomedia_tm') LIMIT 2"; + $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_yoomedia_reload`"; break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/filters.php b/inc/filters.php index 6da430d5da..3ef321ce32 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -70,7 +70,7 @@ function INIT_FILTER_SYSTEM () { // Load all active filers $result = SQL_QUERY("SELECT `filter_name`, `filter_function`, `filter_active`".$ADD." -FROM `{!MYSQL_PREFIX!}_filters` +FROM `{!_MYSQL_PREFIX!}_filters` ORDER BY `filter_id` ASC", __FILE__, __LINE__); // Are there entries? @@ -264,8 +264,8 @@ function FILTER_FLUSH_FILTERS () { $inserted = 0; $removed = 0; // Prepare SQL queries - $insertSQL = "INSERT INTO `{!MYSQL_PREFIX!}_filters` (`filter_name`,`filter_function`,`filter_active`) VALUES"; - $removeSQL = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_filters` WHERE"; + $insertSQL = "INSERT INTO `{!_MYSQL_PREFIX!}_filters` (`filter_name`,`filter_function`,`filter_active`) VALUES"; + $removeSQL = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_filters` WHERE"; // Write all filters to database foreach ($filters as $filterName => $filterArray) { @@ -309,7 +309,7 @@ function FILTER_FLUSH_FILTERS () { // Walk through all filters foreach ($filterArray as $filterFunction => $cnt) { // Construct and add the query - $SQLs[] = sprintf("UPDATE `{!MYSQL_PREFIX!}_filters` SET `filter_counter`=%s WHERE `filter_name`='%s' AND `filter_function`='%s' LIMIT 1", + $SQLs[] = sprintf("UPDATE `{!_MYSQL_PREFIX!}_filters` SET `filter_counter`=%s WHERE `filter_name`='%s' AND `filter_function`='%s' LIMIT 1", bigintval($cnt), $filterName, $filterFunction @@ -451,7 +451,7 @@ function FILTER_UPDATE_LOGIN_DATA () { $GLOBALS['userid'] = bigintval(get_session('userid')); // Load last module and last online time - $result = SQL_QUERY_ESC("SELECT last_module, last_online FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT last_module, last_online FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); // Entry found? @@ -475,7 +475,7 @@ function FILTER_UPDATE_LOGIN_DATA () { } // END - if // Update last module / online time - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET last_module='%s', last_online=UNIX_TIMESTAMP(), REMOTE_ADDR='%s' WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET last_module='%s', last_online=UNIX_TIMESTAMP(), REMOTE_ADDR='%s' WHERE userid=%s LIMIT 1", array($GLOBALS['what'], GET_REMOTE_ADDR(), $GLOBALS['userid']), __FILE__, __LINE__); } else { // Destroy session, we cannot update! diff --git a/inc/functions.php b/inc/functions.php index d293cc048a..e545aa0d6e 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -238,7 +238,7 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) { // @DEPRECATED Try to rewrite the if() condition if ($template == "member_support_form") { // Support request of a member - $result = SQL_QUERY_ESC("SELECT userid, gender, surname, family, email FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT userid, gender, surname, family, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); // Is content an array? @@ -392,7 +392,7 @@ function SEND_EMAIL($TO, $SUBJECT, $MSG, $HTML = "N", $FROM = "") { return; } else { // Load email address - $result_email = SQL_QUERY_ESC("SELECT email FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($TO)), __FILE__, __LINE__); + $result_email = SQL_QUERY_ESC("SELECT email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($TO)), __FILE__, __LINE__); //* DEBUG: */ print __FUNCTION__."(".__LINE__."):numRows=".SQL_NUMROWS($result_email)."
    \n"; // Does the user exist? @@ -401,7 +401,7 @@ function SEND_EMAIL($TO, $SUBJECT, $MSG, $HTML = "N", $FROM = "") { list($TO) = SQL_FETCHROW($result_email); } else { // Set webmaster - $TO = WEBMASTER; + $TO = constant('WEBMASTER'); } // Free result @@ -409,7 +409,7 @@ function SEND_EMAIL($TO, $SUBJECT, $MSG, $HTML = "N", $FROM = "") { } } elseif ("$TO" == "0") { // Is the webmaster! - $TO = WEBMASTER; + $TO = constant('WEBMASTER'); } //* DEBUG: */ print __FUNCTION__."(".__LINE__."):TO={$TO}
    \n"; @@ -490,7 +490,7 @@ function SEND_RAW_EMAIL ($to, $subject, $msg, $from) { $mail->Username = SMTP_USER; $mail->Password = SMTP_PASSWORD; if (empty($from)) { - $mail->From = WEBMASTER; + $mail->From = constant('WEBMASTER'); } else { $mail->From = $from; } @@ -666,7 +666,7 @@ function SELECTION_COUNT($array) { } // function IMG_CODE ($code, $type, $DATA, $uid) { - return "\"Code\""; + return "\"Code\""; } // function TRANSLATE_STATUS($status) { @@ -752,7 +752,7 @@ function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID="0") { $nick = "---"; // Keept for backward-compatiblity (please replace these variables against our new {!CONST!} syntax!) - // No longer used: $MAIN_TITLE = MAIN_TITLE; $URL = URL; $WEBMASTER = WEBMASTER; + // No longer used: $MAIN_TITLE = MAIN_TITLE; $URL = constant('URL'); $WEBMASTER = constant('WEBMASTER'); // Prepare IP number and User Agent $REMOTE_ADDR = GET_REMOTE_ADDR(); @@ -771,7 +771,7 @@ function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID="0") { } // END - if // Neutral email address is default - $email = WEBMASTER; + $email = constant('WEBMASTER'); // Expiration in a nice output format if (getConfig('auto_purge') == 0) { @@ -795,12 +795,12 @@ function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID="0") { if (EXT_IS_ACTIVE("nickname")) { //* DEBUG: */ print __FUNCTION__."(".__LINE__."):NICKNAME!
    \n"; // Load nickname - $result = SQL_QUERY_ESC("SELECT surname, family, gender, email, nickname FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT surname, family, gender, email, nickname FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($UID)), __FILE__, __LINE__); } else { //* DEBUG: */ print __FUNCTION__."(".__LINE__."):NO-NICK!
    \n"; /// Load normal data - $result = SQL_QUERY_ESC("SELECT surname, family, gender, email FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT surname, family, gender, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($UID)), __FILE__, __LINE__); } @@ -1315,7 +1315,7 @@ function GENERATE_IMAGE($img_code, $header=true) { return; } elseif (!$header) { // Return in an HTML code code - return "\n"; + return "\n"; } // Load image @@ -1592,16 +1592,16 @@ function SEND_ADMIN_EMAILS_PRO($subj, $template, $content, $UID) { } // END - if // Check which admin shall receive this mail - $result = SQL_QUERY_ESC("SELECT DISTINCT admin_id FROM `{!MYSQL_PREFIX!}_admins_mails` WHERE mail_template='%s' ORDER BY admin_id", + $result = SQL_QUERY_ESC("SELECT DISTINCT admin_id FROM `{!_MYSQL_PREFIX!}_admins_mails` WHERE mail_template='%s' ORDER BY admin_id", array($template), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 0) { // Create new entry (to all admins) - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_admins_mails` (admin_id, mail_template) VALUES (0, '%s')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_admins_mails` (admin_id, mail_template) VALUES (0, '%s')", array($template), __FILE__, __LINE__); } else { // Load admin IDs... $aids = array(); - while(list($aid) = SQL_FETCHROW($result)) { + while (list($aid) = SQL_FETCHROW($result)) { $aids[] = $aid; } @@ -1616,10 +1616,10 @@ function SEND_ADMIN_EMAILS_PRO($subj, $template, $content, $UID) { return; } elseif ($aid == "0") { // Select all email adresses - $result = SQL_QUERY("SELECT email FROM `{!MYSQL_PREFIX!}_admins` ORDER BY id", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT email FROM `{!_MYSQL_PREFIX!}_admins` ORDER BY `id`", __FILE__, __LINE__); } else { // If Admin-ID is not "to-all" select - $result = SQL_QUERY_ESC("SELECT email FROM `{!MYSQL_PREFIX!}_admins` WHERE id IN (%s) ORDER BY id", array($aid), __FILE__, __LINE__); + $result = SQL_QUERY_ESC("SELECT email FROM `{!_MYSQL_PREFIX!}_admins` WHERE id IN (%s) ORDER BY `id`", array($aid), __FILE__, __LINE__); } } @@ -1673,7 +1673,7 @@ function ADD_EMAIL_NAV($PAGES, $offset, $show_form, $colspan, $return=false) { $NAV .= "-"; } else { // Open anchor tag and add base URL - $NAV .= " 0)) $NAV .= "&u_id=".bigintval($_GET['u_id']); @@ -2775,10 +2775,10 @@ function ADD_NEW_BONUS_MAIL ($data, $mode="", $output=true) { ); // Mail inserted into bonus pool - if ($output) LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BONUS_SEND); + if ($output) LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_BONUS_SEND')); } elseif ($output) { // More entered than can be reached! - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_MORE_SELECTED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_MORE_SELECTED')); } else { // Debug log DEBUG_LOG(__FUNCTION__, __LINE__, " cat={$data['cat']},receiver={$data['receiver']},data=".base64_encode(serialize($data))." More selected, than available!"); @@ -2872,10 +2872,13 @@ function getMessage ($messageId) { $return = "!".$messageId."!"; // Is the language string found? - if (isset($GLOBALS['msg'][$messageId])) { - // Language array element found + if (isset($GLOBALS['msg'][strtolower($messageId)])) { + // Language array element found in small_letters $return = $GLOBALS['msg'][$messageId]; - } elseif (defined($messageId)) { + } elseif (isset($GLOBALS['msg'][strtoupper($messageId)])) { + // @DEPRECATED Language array element found in BIG_LETTERS + $return = $GLOBALS['msg'][$messageId]; + } elseif (defined(strtoupper($messageId))) { // @DEPRECATED Deprecated constant found $return = constant($messageId); } else { @@ -2962,7 +2965,7 @@ function THEME_GET_ID ($name) { incrementConfigEntry('cache_hits'); } elseif (GET_EXT_VERSION("cache") != "0.1.8") { // Check if current theme is already imported or not - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_themes` WHERE theme_path='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_themes` WHERE theme_path='%s' LIMIT 1", array($name), __FILE__, __LINE__); // Entry found? diff --git a/inc/gen_mediadata.php b/inc/gen_mediadata.php index a7bd796574..bdf11b0320 100644 --- a/inc/gen_mediadata.php +++ b/inc/gen_mediadata.php @@ -42,7 +42,7 @@ $bsent = 0; $bclicks = 0; $bcount = 0; // Check for normal mails $result_media = SQL_QUERY("SELECT SUM(max_rec) AS max_rec, SUM(clicks) AS clicks -FROM `{!MYSQL_PREFIX!}_user_stats`", __FILE__, __LINE__); +FROM `{!_MYSQL_PREFIX!}_user_stats`", __FILE__, __LINE__); list($nsent, $nclicks) = SQL_FETCHROW($result_media); if (empty($nsent)) $nsent = 0; if (empty($nclicks)) $nclicks = 0; @@ -51,20 +51,20 @@ if (empty($nclicks)) $nclicks = 0; SQL_FREERESULT($result_media); // Count mail orders -$result_media = SQL_QUERY("SELECT COUNT(id) FROM `{!MYSQL_PREFIX!}_user_stats`", __FILE__, __LINE__); +$result_media = SQL_QUERY("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_user_stats`", __FILE__, __LINE__); list($ncount) = SQL_FETCHROW($result_media); SQL_FREERESULT($result_media); // Check for bonus extension if (EXT_IS_ACTIVE("bonus")) { // Count bonus mails - $result_media = SQL_QUERY("SELECT COUNT(id) FROM `{!MYSQL_PREFIX!}_bonus`", __FILE__, __LINE__); + $result_media = SQL_QUERY("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_bonus`", __FILE__, __LINE__); list($bcount) = SQL_FETCHROW($result_media); SQL_FREERESULT($result_media); // Check for bonus mails $result_media = SQL_QUERY("SELECT SUM(mails_sent) AS bonus_sent, SUM(clicks) AS bonus_clicks -FROM `{!MYSQL_PREFIX!}_bonus`", __FILE__, __LINE__); +FROM `{!_MYSQL_PREFIX!}_bonus`", __FILE__, __LINE__); list($bsent, $bclicks) = SQL_FETCHROW($result_media); if (empty($bsent)) $bsent = 0; if (empty($bclicks)) $bclicks = 0; @@ -82,12 +82,12 @@ MEDIA_UPDATE_ENTRY(array("total_clicks", "bonus_clicks") , "init", $bclicks); MEDIA_UPDATE_ENTRY(array("total_orders", "bonus_orders") , "init", $bcount); // Aquire total used points -$result = SQL_QUERY("SELECT SUM(used_points) AS used_points FROM `{!MYSQL_PREFIX!}_user_data`", __FILE__, __LINE__); +$result = SQL_QUERY("SELECT SUM(used_points) AS used_points FROM `{!_MYSQL_PREFIX!}_user_data`", __FILE__, __LINE__); list($used) = SQL_FETCHROW($result); SQL_FREERESULT($result); // ... and total points -$result = SQL_QUERY("SELECT SUM(points) AS points FROM `{!MYSQL_PREFIX!}_user_points`", __FILE__, __LINE__); +$result = SQL_QUERY("SELECT SUM(points) AS points FROM `{!_MYSQL_PREFIX!}_user_points`", __FILE__, __LINE__); list($points) = SQL_FETCHROW($result); SQL_FREERESULT($result); diff --git a/inc/gen_refback.php b/inc/gen_refback.php index 766f315d39..6aa3729e89 100644 --- a/inc/gen_refback.php +++ b/inc/gen_refback.php @@ -41,16 +41,16 @@ if (!defined('__SECURITY')) { require_once(PATH."inc/libs/refback_functions.php"); // Sanity-check: Do we have ref level 0? -$result = SQL_QUERY("SELECT id FROM `{!MYSQL_PREFIX!}_refsystem` WHERE level=0", __FILE__, __LINE__); +$result = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_refsystem` WHERE level=0", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Remove index temporaly - SQL_ALTER_TABLE("ALTER TABLE `{!MYSQL_PREFIX!}_refsystem` DROP INDEX `userid_level`", __FILE__, __LINE__); + SQL_ALTER_TABLE("ALTER TABLE `{!_MYSQL_PREFIX!}_refsystem` DROP INDEX `userid_level`", __FILE__, __LINE__); // Upgrade refsystem, ref-level 0 is silly here - SQL_QUERY("UPDATE `{!MYSQL_PREFIX!}_refsystem` SET level=level+1", __FILE__, __LINE__); + SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_refsystem` SET level=level+1", __FILE__, __LINE__); // Add it again - SQL_ALTER_TABLE("ALTER TABLE `{!MYSQL_PREFIX!}_refsystem` ADD UNIQUE `userid_level` ( `userid` , `level` )", __FILE__, __LINE__); + SQL_ALTER_TABLE("ALTER TABLE `{!_MYSQL_PREFIX!}_refsystem` ADD UNIQUE `userid_level` ( `userid` , `level` )", __FILE__, __LINE__); // Rebuild cache REBUILD_CACHE("refsystem", "refsystem"); @@ -60,11 +60,11 @@ if (SQL_NUMROWS($result) > 0) { SQL_FREERESULT($result); // Reset the table -SQL_QUERY("TRUNCATE TABLE `{!MYSQL_PREFIX!}_user_refs`", __FILE__, __LINE__); +SQL_QUERY("TRUNCATE TABLE `{!_MYSQL_PREFIX!}_user_refs`", __FILE__, __LINE__); // Begin with all users in level one $result_direct = SQL_QUERY("SELECT u.userid -FROM `{!MYSQL_PREFIX!}_user_data` AS u +FROM `{!_MYSQL_PREFIX!}_user_data` AS u WHERE u.refid=0 ORDER BY u.userid ASC", __FILE__, __LINE__); diff --git a/inc/gen_sql_patches.php b/inc/gen_sql_patches.php index a12ead7b73..efa7941201 100644 --- a/inc/gen_sql_patches.php +++ b/inc/gen_sql_patches.php @@ -46,7 +46,7 @@ if (getConfig('pass_scramble') == "") { $scrambleString = genScrambleString(40); // ... and store it there for future usage - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_config` SET pass_scramble='%s' WHERE config=0 LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_config` SET pass_scramble='%s' WHERE config=0 LIMIT 1", array($scrambleString), __FILE__, __LINE__); // Also remember it in config @@ -61,7 +61,7 @@ if (getConfig('master_salt') == "") { $masterSalt = scrambleString(substr(sha1(GEN_PASS(mt_rand(128, 256))), 0, -40)); // ... and store it there for future usage - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_config` SET master_salt='%s' WHERE config=0 LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_config` SET master_salt='%s' WHERE config=0 LIMIT 1", array($masterSalt), __FILE__, __LINE__); // Also remember it in config @@ -91,7 +91,7 @@ if (getConfig('file_hash') == "") { //* DEBUG: */ die("Secret-Key: ".$secretKey."
    Cookie: ".get_session('u_hash')."
    Test: ".$test); // Write $file_hash to database - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_config` SET file_hash='%s' WHERE config=0 LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_config` SET file_hash='%s' WHERE config=0 LIMIT 1", array($file_hash), __FILE__, __LINE__); // Generate FQFN for .htaccess file diff --git a/inc/header.php b/inc/header.php index e262bfa16e..6c85f0bfaf 100644 --- a/inc/header.php +++ b/inc/header.php @@ -86,13 +86,13 @@ if (($header != "1") && ($header != "2")) { )); // Installation mode - define('__PAGE_TITLE', INSTALLATION_OF_MXCHANGE); + define('__PAGE_TITLE', getMessage('INSTALLATION_OF_MXCHANGE')); } else { // Configuration not found! - define('__PAGE_TITLE', NO_CONFIG_FOUND_TITLE); + define('__PAGE_TITLE', getMessage('NO_CONFIG_FOUND_TITLE')); // Do not add the fatal message in installation mode - if (basename($_SERVER['PHP_SELF']) != "install.php") addFatalMessage(NO_CONFIG_FOUND); + if (basename($_SERVER['PHP_SELF']) != "install.php") addFatalMessage(getMessage('NO_CONFIG_FOUND')); } } // END - if @@ -118,7 +118,7 @@ if (($header != "1") && ($header != "2")) { LOAD_TEMPLATE("header"); // Include stylesheet - include (PATH."inc/stylesheet.php"); + require_once(PATH."inc/stylesheet.php"); } // END - if // Closing HEAD tag diff --git a/inc/install-inc.php b/inc/install-inc.php index 6229a2b45c..3a7422e0ae 100644 --- a/inc/install-inc.php +++ b/inc/install-inc.php @@ -103,7 +103,7 @@ if (isset($_POST['mysql']) && is_array($_POST['mysql'])) $mysql = $_POST['mysql' if (URL != "http://your-server.com") { // Already installed??? - $burl = URL; + $burl = constant('URL'); } elseif (empty($burl)) { // Auto-detect URL $burl = "http://".$SERVER_NAME.$_SERVER['PHP_SELF']; diff --git a/inc/language/de.php b/inc/language/de.php index 9d03964ad2..c71ee82fe3 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -154,8 +154,6 @@ define('SUBMIT_CHANGES', "Änderungen durchführen"); define('ENTRY_404_1', "Eintrag "); define('ENTRY_404_2', " wurde nicht gefunden!"); define('EDIT_UNKNOWN_OKAY', "Es wurde eine unbekannte Aktion durchgeführt!"); -define('SAVING_DATA', "Speichere Daten ab"); -define('SAVING_DONE', "Speicherung beendet!"); define('DEL_ADMIN_MENU', "Admin-Menüeinträge löschen"); define('DEL_MENU_1', "Es soll/sollen "); define('DEL_MENU_2', " Menüeintrag/-einträge gelöscht werden:"); diff --git a/inc/language/en.php b/inc/language/en.php index 4aa1c90481..6833a5764d 100644 --- a/inc/language/en.php +++ b/inc/language/en.php @@ -159,8 +159,6 @@ define('SUBMIT_CHANGES', "Submit changes"); define('ENTRY_404_1', "Entry "); define('ENTRY_404_2', " was not found!"); define('EDIT_UNKNOWN_OKAY', "An unknown action was performed."); -define('SAVING_DATA', "Saving data"); -define('SAVING_DONE', "finished!"); define('DEL_ADMIN_MENU', "Admin-Menüeinträge löschen"); define('DEL_MENU_1', ""); define('DEL_MENU_2', " menu entr(y/ies) shall be deleted:"); diff --git a/inc/libs/active_functions.php b/inc/libs/active_functions.php index aa893f93d9..eec102ab87 100644 --- a/inc/libs/active_functions.php +++ b/inc/libs/active_functions.php @@ -43,7 +43,7 @@ function FILTER_ADD_LINK_ACTIVE_LIST () { if ((EXT_IS_ACTIVE("active")) && (EXT_IS_ACTIVE("online"))) { // Init content $content = array( - 'menu' => "
    ".getConfig('menu_blur_spacer').GUEST_ACTIVE_LINK."", + 'menu' => "".getConfig('menu_blur_spacer').GUEST_ACTIVE_LINK."", 'what' => "active" ); diff --git a/inc/libs/admins_functions.php b/inc/libs/admins_functions.php index 3b777cab73..47bb4712c1 100644 --- a/inc/libs/admins_functions.php +++ b/inc/libs/admins_functions.php @@ -106,11 +106,11 @@ function ADMINS_CHECK_ACL($act, $wht) { if (!empty($act)) { // Main menu - $result = SQL_QUERY_ESC("SELECT access_mode FROM `{!MYSQL_PREFIX!}_admins_acls` WHERE admin_id=%s AND action_menu='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT access_mode FROM `{!_MYSQL_PREFIX!}_admins_acls` WHERE admin_id=%s AND action_menu='%s' LIMIT 1", array(bigintval($aid), $act), __FILE__, __LINE__); } elseif (!empty($wht)) { // Sub menu - $result = SQL_QUERY_ESC("SELECT access_mode FROM `{!MYSQL_PREFIX!}_admins_acls` WHERE admin_id=%s AND what_menu='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT access_mode FROM `{!_MYSQL_PREFIX!}_admins_acls` WHERE admin_id=%s AND what_menu='%s' LIMIT 1", array(bigintval($aid), $wht), __FILE__, __LINE__); } @@ -136,7 +136,7 @@ function ADMINS_CREATE_EMAIL_LINK($email, $mod="admin") { if (strpos("@", $email) > 0) { // Create email link $result = SQL_QUERY_ESC("SELECT id -FROM `{!MYSQL_PREFIX!}_admins` +FROM `{!_MYSQL_PREFIX!}_admins` WHERE email='%s'".$locked." LIMIT 1", array($email), __FILE__, __LINE__); @@ -146,14 +146,14 @@ WHERE email='%s'".$locked." LIMIT 1", list($uid) = SQL_FETCHROW($result); // Rewrite email address to contact link - $email = URL."/modules.php?module=".$mod."&what=user_contct&u_id=".bigintval($uid); + $email = "{!URL!}/modules.php?module=".$mod."&what=user_contct&u_id=".bigintval($uid); } // Free memory SQL_FREERESULT($result); } elseif (bigintval($email) > 0) { // Direct ID given - $email = URL."/modules.php?module=".$mod."&what=admins_contct&admin=".bigintval($email); + $email = "{!URL!}/modules.php?module=".$mod."&what=admins_contct&admin=".bigintval($email); } // Return rewritten (?) email address @@ -208,7 +208,7 @@ function ADMINS_CHANGE_ADMIN_ACCOUNT($POST) { // Update admin account if ($default == "allow") { // Allow changing default ACL - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_admins` SET + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins` SET login='%s'".$ADD.", email='%s', default_acl='%s', @@ -223,7 +223,7 @@ WHERE id=%s LIMIT 1", ), __FILE__, __LINE__); } else { // Do not allow it here - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_admins` SET + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins` SET login='%s'".$ADD.", email='%s', la_mode='%s' @@ -268,7 +268,7 @@ function ADMINS_EDIT_ADMIN_ACCOUNTS ($POST) { $id = bigintval($id); // Get the admin's data - $result = SQL_QUERY_ESC("SELECT login, email, default_acl AS mode, la_mode FROM `{!MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT login, email, default_acl AS mode, la_mode FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", array($id), __FILE__, __LINE__); if ((SQL_NUMROWS($result) == 1) && ($sel == 1)) { // Entry found @@ -282,7 +282,7 @@ function ADMINS_EDIT_ADMIN_ACCOUNTS ($POST) { // Shall we allow changing default ACL? if ($currMode == "allow") { // Allow chaning it - $content['mode'] = ADD_OPTION_LINES("/ARRAY/", array("allow", "deny"), array(ADMINS_ALLOW_MODE, ADMINS_DENY_MODE), $content['mode']); + $content['mode'] = ADD_OPTION_LINES("/ARRAY/", array("allow", "deny"), array(constant('ADMINS_ALLOW_MODE'), constant('ADMINS_DENY_MODE')), $content['mode']); } else { // Don't allow it $content['mode'] = " "; @@ -303,7 +303,7 @@ function ADMINS_EDIT_ADMIN_ACCOUNTS ($POST) { // Delete given admin accounts function ADMINS_DELETE_ADMIN_ACCOUNTS ($POST) { // Check if this account is the last one which cannot be deleted... - $result_main = SQL_QUERY("SELECT id FROM `{!MYSQL_PREFIX!}_admins`", __FILE__, __LINE__); + $result_main = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_admins`", __FILE__, __LINE__); $accounts = SQL_NUMROWS($result_main); SQL_FREERESULT($result_main); if ($accounts > 1) { @@ -314,7 +314,7 @@ function ADMINS_DELETE_ADMIN_ACCOUNTS ($POST) { $id = bigintval($id); // Get the admin's data - $result = SQL_QUERY_ESC("SELECT login, email, default_acl AS mode, la_mode FROM `{!MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT login, email, default_acl AS mode, la_mode FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", array($id), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Entry found @@ -338,7 +338,7 @@ function ADMINS_DELETE_ADMIN_ACCOUNTS ($POST) { LOAD_TEMPLATE("admin_del_admins"); } else { // Cannot delete last account! - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_ADMINS_CANNOT_DELETE_LAST); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_ADMINS_CANNOT_DELETE_LAST')); } } @@ -353,11 +353,11 @@ function ADMINS_REMOVE_ADMIN_ACCOUNTS ($POST) { // Delete only when it's not your own account! if (($del == 1) && (GET_CURRENT_ADMIN_ID() != $id)) { // Rewrite his tasks to all admins - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_task_system` SET assigned_admin=0 WHERE assigned_admin=%s", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET assigned_admin=0 WHERE assigned_admin=%s", array($id), __FILE__, __LINE__); // Remove account - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", array($id), __FILE__, __LINE__); // Purge cache @@ -373,7 +373,7 @@ function ADMINS_REMOVE_ADMIN_ACCOUNTS ($POST) { // List all admin accounts function ADMINS_LIST_ADMIN_ACCOUNTS() { // Select all admin accounts - $result = SQL_QUERY("SELECT id, login, email, default_acl AS mode, la_mode FROM `{!MYSQL_PREFIX!}_admins` ORDER BY login ASC", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id, login, email, default_acl AS mode, la_mode FROM `{!_MYSQL_PREFIX!}_admins` ORDER BY login ASC", __FILE__, __LINE__); $SW = 2; $OUT = ""; while ($content = SQL_FETCHARRAY($result)) { // Compile some variables diff --git a/inc/libs/autopurge_functions.php b/inc/libs/autopurge_functions.php index 89abcf3dee..31a1c82e22 100644 --- a/inc/libs/autopurge_functions.php +++ b/inc/libs/autopurge_functions.php @@ -41,7 +41,7 @@ function AUTOPURGE_ADD_POINTS($uid, $points) { global $jackpot; // Check if he has locked points or not - $result = SQL_QUERY_ESC("SELECT ref_payout FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT ref_payout FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); list($payout) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -62,7 +62,7 @@ function AUTOPURGE_ADD_POINTS($uid, $points) { $jackpot += $points; } else { // .. to user's account - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_points` SET %s=%s+%s WHERE userid=%s AND ref_depth=0 LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_points` SET %s=%s+%s WHERE userid=%s AND ref_depth=0 LIMIT 1", array($target, $target, $points, bigintval($uid)), __FILE__, __LINE__); // Update mediadata as well diff --git a/inc/libs/beg_functions.php b/inc/libs/beg_functions.php index e6c17e9004..fdadd1a116 100644 --- a/inc/libs/beg_functions.php +++ b/inc/libs/beg_functions.php @@ -48,7 +48,7 @@ function BEG_ADD_POINTS ($uid, $points) { // Is begging rallye active? if (getConfig('beg_rallye') == "Y") { // Add points to rallye account - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET beg_points=beg_points+%s WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET beg_points=beg_points+%s WHERE userid=%s LIMIT 1", array($points, $uid), __FILE__, __LINE__); } else { // Add points to account diff --git a/inc/libs/bonus_functions.php b/inc/libs/bonus_functions.php index c428208c11..68ac09ada8 100644 --- a/inc/libs/bonus_functions.php +++ b/inc/libs/bonus_functions.php @@ -72,7 +72,7 @@ function BONUS_ADD_TURBO_POINTS($mid, $uid, $type) { } // END - if // Check for entry - $result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt FROM `{!MYSQL_PREFIX!}_bonus_turbo` WHERE userid=%s AND %s=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt FROM `{!_MYSQL_PREFIX!}_bonus_turbo` WHERE userid=%s AND %s=%s LIMIT 1", array($uid, $column, $mid), __FILE__, __LINE__); // Load clicks from table as current rank @@ -101,11 +101,11 @@ function BONUS_ADD_TURBO_POINTS($mid, $uid, $type) { } // Add points to his account directly - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET turbo_bonus=turbo_bonus+".$points." WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET turbo_bonus=turbo_bonus+".$points." WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); // Rember this whole data for displaying ranking list - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_bonus_turbo` (userid, mail_id, bonus_id, level, points, timemark) VALUES ('%s', '%s', '%s', '%s', '%s', UNIX_TIMESTAMP())", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_bonus_turbo` (userid, mail_id, bonus_id, level, points, timemark) VALUES ('%s', '%s', '%s', '%s', '%s', UNIX_TIMESTAMP())", array(bigintval($uid), bigintval($mail), bigintval($bonus), $rank, $points), __FILE__, __LINE__); if ((GET_EXT_VERSION("bonus") >= "0.3.5") && (getConfig('bonus_mode') != "ADD") && ($points > 0)) BONUS_POINTS_HANDLER($points); @@ -119,7 +119,7 @@ function BONUS_MAKE_RANK_ROWS ($data, $type, $uid) { $ranks = sizeof(explode(";", getConfig('turbo_rates'))) + 1; // Load current user's data - $result = SQL_QUERY_ESC("SELECT level, points, timemark FROM `{!MYSQL_PREFIX!}_bonus_turbo` WHERE %s=%s AND userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT level, points, timemark FROM `{!_MYSQL_PREFIX!}_bonus_turbo` WHERE %s=%s AND userid=%s LIMIT 1", array($type, $data, $uid), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Load data @@ -138,7 +138,7 @@ function BONUS_MAKE_RANK_ROWS ($data, $type, $uid) { } // END - if // Load rankings - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_bonus_turbo` WHERE %s=%s ORDER BY level LIMIT %s", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_bonus_turbo` WHERE %s=%s ORDER BY level LIMIT %s", array($type, $data, getConfig('bonus_lines')), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Start generating the ranking list @@ -147,7 +147,7 @@ function BONUS_MAKE_RANK_ROWS ($data, $type, $uid) { $SW = 2; 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__); // Nothing found by default @@ -243,7 +243,7 @@ function BONUS_PURGE_EXPIRED_TURBO_BONUS() global $_CONFIG; // Remove entries - $result = SQL_QUERY("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_bonus_turbo` WHERE timemark < (UNIX_TIMESTAMP() - ".getConfig('bonus_timeout').")", __FILE__, __LINE__); + $result = SQL_QUERY("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_bonus_turbo` WHERE timemark < (UNIX_TIMESTAMP() - ".getConfig('bonus_timeout').")", __FILE__, __LINE__); if (SQL_AFFECTEDROWS() > 0) { // Send out email to admin SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_TURBO_SUBJECT, "admin_autopurge_turbo", SQL_AFFECTEDROWS(), ""); diff --git a/inc/libs/booking_functions.php b/inc/libs/booking_functions.php index 78252fb5c8..bb3aac762f 100644 --- a/inc/libs/booking_functions.php +++ b/inc/libs/booking_functions.php @@ -47,7 +47,7 @@ function ADD_BOOKING_RECORD ($subject, $uid, $points, $mode) { } // END - if // Add record entry here - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_user_book` (`userid`,`subject`,`mode`,`points`) VALUES(%s,'%s','%s',%s)", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_book` (`userid`,`subject`,`mode`,`points`) VALUES(%s,'%s','%s',%s)", array($uid, $subject, $mode, $points), __FILE__, __LINE__); } diff --git a/inc/libs/country_functions.php b/inc/libs/country_functions.php index fa6694c3dc..30b1cfec4f 100644 --- a/inc/libs/country_functions.php +++ b/inc/libs/country_functions.php @@ -40,7 +40,7 @@ if (!defined('__SECURITY')) { // Generate a human-readable country description with code function COUNTRY_GENERATE_INFO ($id) { // Load code and description - $result = SQL_QUERY_ESC("SELECT code, descr FROM `{!MYSQL_PREFIX!}_countries` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT code, descr FROM `{!_MYSQL_PREFIX!}_countries` WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); // Is there an entry? diff --git a/inc/libs/doubler_functions.php b/inc/libs/doubler_functions.php index f80d13630d..be2f18c129 100644 --- a/inc/libs/doubler_functions.php +++ b/inc/libs/doubler_functions.php @@ -67,7 +67,7 @@ function DOUBLER_GENERATE_TABLE ($uid="0", $done='N', $ref='N', $sort="ASC") { // List entries $result = SQL_QUERY("SELECT userid, refid, points, timemark -FROM `{!MYSQL_PREFIX!}_doubler` +FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='".$done."' AND is_ref='".$ref."'".$ADD." ORDER BY timemark ".$sort." LIMIT ".$limit, __FILE__, __LINE__); @@ -75,7 +75,7 @@ LIMIT ".$limit, __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // List entries $OUT = ""; $SW = 2; - while(list($uid, $rid, $points, $time) = SQL_FETCHROW($result)) { + while (list($uid, $rid, $points, $time) = SQL_FETCHROW($result)) { if (IS_ADMIN()) { // Set links to admin area if ($uid > 0) { $uid = ADMIN_USER_PROFILE_LINK($uid); } else { $uid = "---"; } @@ -123,7 +123,7 @@ function DOUBLER_GET_TOTAL_POINTS_LEFT() { if (getConfig('doubler_jackpot') == "Y") { // Load jackpot - $result = SQL_QUERY("SELECT points FROM `{!MYSQL_PREFIX!}_jackpot` WHERE ok='ok' LIMIT 1", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT points FROM `{!_MYSQL_PREFIX!}_jackpot` WHERE ok='ok' LIMIT 1", __FILE__, __LINE__); list($jackpot) = SQL_FETCHROW($result); SQL_FREERESULT($result); diff --git a/inc/libs/holiday_functions.php b/inc/libs/holiday_functions.php index 079e99af89..1e74c62d32 100644 --- a/inc/libs/holiday_functions.php +++ b/inc/libs/holiday_functions.php @@ -41,7 +41,7 @@ if (!defined('__SECURITY')) { function HOLIDAY_STOP_HOLIDAYS () { // Let's find some expired holiday requests... $result_stop = SQL_QUERY("SELECT userid, holiday_start, holiday_end, comments -FROM `{!MYSQL_PREFIX!}_user_holidays` +FROM `{!_MYSQL_PREFIX!}_user_holidays` WHERE holiday_end <= UNIX_TIMESTAMP() ORDER BY userid", __FILE__, __LINE__); if (SQL_NUMROWS($result_stop) > 0) { @@ -49,11 +49,11 @@ ORDER BY userid", __FILE__, __LINE__); $admin = ""; while (list($uid, $start, $end, $comments) = SQL_FETCHROW($result_stop)) { // Stop holiday - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_user_holidays` WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_holidays` WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); // Unlock account - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET holiday_active='N', holiday_activated='0' WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); diff --git a/inc/libs/mediadata_functions.php b/inc/libs/mediadata_functions.php index 48eaa19551..50f921272a 100644 --- a/inc/libs/mediadata_functions.php +++ b/inc/libs/mediadata_functions.php @@ -46,12 +46,12 @@ function MEDIA_UPDATE_ENTRY($keys_array, $mode, $value) foreach ($keys_array as $key) { // First check if it does exist - $result_media = SQL_QUERY_ESC("SELECT media_key FROM `{!MYSQL_PREFIX!}_mediadata` + $result_media = SQL_QUERY_ESC("SELECT media_key FROM `{!_MYSQL_PREFIX!}_mediadata` WHERE media_key = '%s' LIMIT 1", array($key), __FILE__, __LINE__); if (SQL_NUMROWS($result_media) == 0) { // Not found so we create it (mode will be ignored here!) - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_mediadata` (media_key, media_value) VALUES ('%s', '%s')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_mediadata` (media_key, media_value) VALUES ('%s', '%s')", array($key, $value), __FILE__, __LINE__); } else @@ -65,13 +65,13 @@ WHERE media_key = '%s' LIMIT 1", array($key), __FILE__, __LINE__); if ($mode == "init") { // Initialize entry - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_mediadata` SET media_value=%s WHERE media_key='%s' LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_mediadata` SET media_value=%s WHERE media_key='%s' LIMIT 1", array($value, $key), __FILE__, __LINE__); } else { // Update entry - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_mediadata` SET media_value=media_value".$mode."%s WHERE media_key='%s' LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_mediadata` SET media_value=media_value".$mode."%s WHERE media_key='%s' LIMIT 1", array($value, $key), __FILE__, __LINE__); } } @@ -85,7 +85,7 @@ function MEDIA_GET_ENTRY($key) $value = ""; // Check for entry - $result = SQL_QUERY_ESC("SELECT media_value FROM `{!MYSQL_PREFIX!}_mediadata` WHERE media_key='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT media_value FROM `{!_MYSQL_PREFIX!}_mediadata` WHERE media_key='%s' LIMIT 1", array($key), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Load data diff --git a/inc/libs/nickname_functions.php b/inc/libs/nickname_functions.php index c9a44dec6b..d218289fd5 100644 --- a/inc/libs/nickname_functions.php +++ b/inc/libs/nickname_functions.php @@ -54,7 +54,7 @@ function NICKNAME_IS_ACTIVE ($uidNick) { } else { // Search in database // @TODO Can we replace this with GET_TOTAL_DATA() ? - $result = SQL_QUERY_ESC("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s OR nickname='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s OR nickname='%s' LIMIT 1", array(bigintval($uidNick), $uidNick), __FILE__, __LINE__); // Check existence of nickname @@ -87,7 +87,7 @@ function NICKNAME_GET_NICK ($userid) { incrementConfigEntry('cache_hits'); } elseif (NICKNAME_IS_ACTIVE($userid)) { // Search for non-empty nickname - $result = SQL_QUERY_ESC("SELECT nickname FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s AND nickname != '' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT nickname FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND nickname != '' LIMIT 1", array(bigintval($userid)), __FILE__, __LINE__); // Found? diff --git a/inc/libs/online_functions.php b/inc/libs/online_functions.php index 9b8fcbe9d1..4e43875e37 100644 --- a/inc/libs/online_functions.php +++ b/inc/libs/online_functions.php @@ -73,13 +73,13 @@ function FILTER_UPDATE_ONLINE_LIST () { } // END - if // Now search for the user - $result = SQL_QUERY_ESC("SELECT timestamp FROM `{!MYSQL_PREFIX!}_online` WHERE sid='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT timestamp FROM `{!_MYSQL_PREFIX!}_online` WHERE sid='%s' LIMIT 1", array($PHPSESSID), __FILE__, __LINE__); // Entry found? if (SQL_NUMROWS($result) == 1) { // Then update it - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_online` SET + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_online` SET module='%s', action='%s', what='%s', @@ -104,7 +104,7 @@ WHERE sid='%s' LIMIT 1", ); } else { // No entry does exists so we simply add it! - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_online` (module, action, what, userid, refid, is_member, is_admin, timestamp, sid, ip) VALUES ('%s','%s','%s', %s, %s, '%s','%s', UNIX_TIMESTAMP(), '%s','%s')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_online` (module, action, what, userid, refid, is_member, is_admin, timestamp, sid, ip) VALUES ('%s','%s','%s', %s, %s, '%s','%s', UNIX_TIMESTAMP(), '%s','%s')", array( $GLOBALS['module'], $GLOBALS['action'], @@ -123,7 +123,7 @@ WHERE sid='%s' LIMIT 1", SQL_FREERESULT($result); // Purge old entries - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_online` WHERE timestamp <= (UNIX_TIMESTAMP() - %s)", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_online` WHERE timestamp <= (UNIX_TIMESTAMP() - %s)", array(getConfig('online_timeout')), __FILE__, __LINE__); } diff --git a/inc/libs/optimize_functions.php b/inc/libs/optimize_functions.php index e6f2101f92..5c953dd061 100644 --- a/inc/libs/optimize_functions.php +++ b/inc/libs/optimize_functions.php @@ -85,10 +85,10 @@ function REPAIR_OPTIMIZE_DB() $ret['total_gain'] = $total_gain; // Insert new row - $result = SQL_QUERY("INSERT INTO `{!MYSQL_PREFIX!}_optimize_gain` (gain) VALUES ('".$total_gain."')", __FILE__, __LINE__); + $result = SQL_QUERY("INSERT INTO `{!_MYSQL_PREFIX!}_optimize_gain` (gain) VALUES ('".$total_gain."')", __FILE__, __LINE__); // Get total runs and total optimization count - $result = SQL_QUERY("SELECT COUNT(id) AS rows, SUM(gain) AS opti FROM `{!MYSQL_PREFIX!}_optimize_gain`", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT COUNT(id) AS rows, SUM(gain) AS opti FROM `{!_MYSQL_PREFIX!}_optimize_gain`", __FILE__, __LINE__); list($total_rows, $total_opti) = SQL_FETCHROW($result); // Free memory diff --git a/inc/libs/payout_functions.php b/inc/libs/payout_functions.php index 088a0b4eed..ae0c105121 100644 --- a/inc/libs/payout_functions.php +++ b/inc/libs/payout_functions.php @@ -44,12 +44,12 @@ function PAYOUT_OUTPUT_PAYOUT_LIST ($points) { if ($points > 0) { // Pay this out! $result = SQL_QUERY_ESC("SELECT id, type, rate, min_points -FROM `{!MYSQL_PREFIX!}_payout_types` +FROM `{!_MYSQL_PREFIX!}_payout_types` WHERE %s >= min_points ORDER BY type", array($points), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { OUTPUT_HTML("
    -
    ".PAYOUT_NOW.":

    +
    {!PAYOUT_NOW!}:

    "); } else { // No payout types setup so far - LOAD_TEMPLATE("admin_settings_saved", false, "
    ".PAYOUT_NO_PAYOUT_TYPES."{!PAYOUT_NO_PAYOUT_TYPES!}".PAYOUT_NO_POINTS_ENTERED."{!PAYOUT_NO_POINTS_ENTERED!} 0 AND d.mails_confirmed >= %s AND p.ref_depth=1 AND p.points > 0 AND d.userid=%s", array(getConfig('ref_payout'), bigintval($uid)), __FILE__, __LINE__); @@ -110,7 +110,7 @@ WHERE d.status='CONFIRMED' AND d.max_mails > 0 AND d.mails_confirmed >= %s AND p if (empty($cpoints)) $cpoints = "0.00000"; // Add info line - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_rallye_users` (rallye_id, userid, refs, curr_points) + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_rallye_users` (rallye_id, userid, refs, curr_points) VALUES ('%s','%s','%s','%s')", array(bigintval($id), bigintval($uid), bigintval($cnt), $cpoints), __FILE__, __LINE__); $un = true; @@ -147,7 +147,7 @@ function RALLYE_ADD_PRICES($rallye,$mode="email") } // Load prices - $result_prices = SQL_QUERY("SELECT price_level, points, info FROM `{!MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id='".$rallye."' ORDER BY price_level", __FILE__, __LINE__); + $result_prices = SQL_QUERY("SELECT price_level, points, info FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id='".$rallye."' ORDER BY price_level", __FILE__, __LINE__); if (SQL_NUMROWS($result_prices) > 0) { // Load prices @@ -185,14 +185,14 @@ function RALLYE_ADD_PRICES($rallye,$mode="email") function RALLYE_ADD_TOPUSERS($rallye,$default=0) { // First check how many prices are set - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s ORDER BY price_level", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s ORDER BY price_level", array(bigintval($rallye)), __FILE__, __LINE__); $prices = SQL_NUMROWS($result); SQL_FREERESULT($result); // And load only limited users - $result = SQL_QUERY_ESC("SELECT DISTINCT u.userid, u.refs, u.curr_points FROM `{!MYSQL_PREFIX!}_rallye_users` AS u -LEFT JOIN `{!MYSQL_PREFIX!}_refsystem` AS r + $result = SQL_QUERY_ESC("SELECT DISTINCT u.userid, u.refs, u.curr_points FROM `{!_MYSQL_PREFIX!}_rallye_users` AS u +LEFT JOIN `{!_MYSQL_PREFIX!}_refsystem` AS r ON u.userid=r.userid WHERE u.rallye_id=%s AND r.counter > 0 ORDER BY u.refs DESC", array(bigintval($rallye)), __FILE__, __LINE__); @@ -204,14 +204,14 @@ WHERE u.rallye_id=%s AND r.counter > 0 ORDER BY u.refs DESC", 'cpoints' => array() ); - while(list($uid, $refs, $cpoints) = SQL_FETCHROW($result)) + while (list($uid, $refs, $cpoints) = SQL_FETCHROW($result)) { // Get current refs $cnt = RALLYE_GET_REFCOUNT($uid, $refs); // Points of ref's - $result_ref = SQL_QUERY_ESC("SELECT DISTINCT p.points FROM `{!MYSQL_PREFIX!}_user_points` AS p -LEFT JOIN `{!MYSQL_PREFIX!}_user_data` AS d + $result_ref = SQL_QUERY_ESC("SELECT DISTINCT p.points FROM `{!_MYSQL_PREFIX!}_user_points` AS p +LEFT JOIN `{!_MYSQL_PREFIX!}_user_data` AS d ON p.userid=d.userid WHERE d.userid=%s AND d.status='CONFIRMED' AND p.ref_depth=1 AND d.max_mails > 0 AND d.mails_confirmed >= %s LIMIT 1", array(bigintval($uid), getConfig('ref_payout')), __FILE__, __LINE__); @@ -279,7 +279,7 @@ function RALLYE_AUTOADD_USER($uid) } // END - if // Check for an auto-add rallye - $result = SQL_QUERY("SELECT id, title, start_time, end_time, send_notify".$ADD." FROM `{!MYSQL_PREFIX!}_rallye_data` WHERE is_active='Y' AND notified='Y' AND auto_add_new_user='Y' AND expired='N' LIMIT 1", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id, title, start_time, end_time, send_notify".$ADD." FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE is_active='Y' AND notified='Y' AND auto_add_new_user='Y' AND expired='N' LIMIT 1", __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Init variables $min_users = 0; $min_prices = 0; @@ -294,13 +294,13 @@ function RALLYE_AUTOADD_USER($uid) SQL_FREERESULT($result); // Check if line is already included... - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s AND userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s AND userid=%s LIMIT 1", array(bigintval($id), bigintval($uid)), __FILE__, __LINE__); // Is this user added? if (SQL_NUMROWS($result) == 0) { // Add userid and his ref count to table - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_rallye_users` (rallye_id, userid, refs) + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_rallye_users` (rallye_id, userid, refs) VALUES ('%s','%s','0')", array(bigintval($id), bigintval($uid)), __FILE__, __LINE__); } else { @@ -370,7 +370,7 @@ function RALLYE_EXPIRE_RALLYES($result) // active = 1: account is still confirmed // active = 0: account is deleted or locked $result = SQL_QUERY_ESC("SELECT COUNT(userid) AS active -FROM `{!MYSQL_PREFIX!}_user_data` +FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND status='CONFIRMED' LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); list($active) = SQL_FETCHROW($result); @@ -391,7 +391,7 @@ LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); } // END - if // Expire rallye - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_rallye_data` SET expired='Y' WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET expired='Y' WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); // Run array through (by uid is the most important 2nd-level-array) @@ -461,7 +461,7 @@ LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); SEND_ADMIN_NOTIFICATION(RALLYE_ADMIN_EXPIRED.": ".$title, $templ, $cnt, 0); // Add task - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_task_system` (status, task_type, subject, text, task_created) + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_task_system` (status, task_type, subject, text, task_created) VALUES ('NEW','RALLYE_EXPIRED','".RALLYE_ADMIN_EXPIRED.": %s','".RALLYE_ADMIN_EXPIRED_TEXT."',UNIX_TIMESTAMP())", array($title), __FILE__, __LINE__); @@ -474,7 +474,7 @@ function RALLYE_LOAD_USER_DATA($uids_array) $uid_string = implode(",", $uids_array['uid']); // Load users - $result = SQL_QUERY_ESC("SELECT userid, gender, surname, family, email FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid IN(%s) AND status='CONFIRMED' ORDER BY userid LIMIT %s", + $result = SQL_QUERY_ESC("SELECT userid, gender, surname, family, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid IN(%s) AND status='CONFIRMED' ORDER BY userid LIMIT %s", array($uid_string, count($uids_array)), __FILE__, __LINE__); $ret = ""; while (list($u, $gender, $surname, $family, $email) = SQL_FETCHROW($result)) @@ -496,9 +496,9 @@ function RALLYE_LOAD_PRICES_ARRAY($rallye) ); // Load prices - $result = SQL_QUERY_ESC("SELECT price_level, points, info FROM `{!MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s ORDER BY price_level", + $result = SQL_QUERY_ESC("SELECT price_level, points, info FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s ORDER BY price_level", array(bigintval($rallye)), __FILE__, __LINE__); - while(list($level, $points, $info) = SQL_FETCHROW($result)) + while (list($level, $points, $info) = SQL_FETCHROW($result)) { $prices['level'][] = $level; $prices['points'][] = $points; @@ -527,7 +527,7 @@ function RALLYE_LOAD_USERS_ARRAY ($rallye) { ); // Load users uid old points earned - $result_user = SQL_QUERY_ESC("SELECT userid, refs, curr_points FROM `{!MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s ORDER BY userid", + $result_user = SQL_QUERY_ESC("SELECT userid, refs, curr_points FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s ORDER BY userid", array(bigintval($rallye)), __FILE__, __LINE__); while (list($uid, $refs, $cpoints) = SQL_FETCHROW($result_user)) { // Load current ref count @@ -535,8 +535,8 @@ function RALLYE_LOAD_USERS_ARRAY ($rallye) { // Points of ref's $result_ref = SQL_QUERY_ESC("SELECT DISTINCT SUM(p.points) -FROM `{!MYSQL_PREFIX!}_user_points` AS p -LEFT JOIN `{!MYSQL_PREFIX!}_user_data` AS d +FROM `{!_MYSQL_PREFIX!}_user_points` AS p +LEFT JOIN `{!_MYSQL_PREFIX!}_user_data` AS d ON p.userid=d.userid WHERE d.status='CONFIRMED' AND d.max_mails > 0 AND d.mails_confirmed >= %s AND p.ref_depth=1 AND p.points > 0 AND d.userid=%s", array(getConfig('ref_payout'), bigintval($uid)), __FILE__, __LINE__); @@ -579,7 +579,7 @@ WHERE d.status='CONFIRMED' AND d.max_mails > 0 AND d.mails_confirmed >= %s AND p // function RALLYE_LIST_WINNERS ($rallye, $default=0) { // First check how many prices are set - $result_prices = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s ORDER BY price_level", + $result_prices = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s ORDER BY price_level", array(bigintval($rallye)), __FILE__, __LINE__); $prices = SQL_NUMROWS($result_prices); SQL_FREERESULT($result_prices); @@ -595,7 +595,7 @@ function RALLYE_LIST_WINNERS ($rallye, $default=0) { // Check status // active = 1: account is still confirmed // active = 0: account is deleted or locked - $result_active = SQL_QUERY_ESC("SELECT COUNT(userid) FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s AND status='CONFIRMED' LIMIT 1", + $result_active = SQL_QUERY_ESC("SELECT COUNT(userid) FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND status='CONFIRMED' LIMIT 1", array(bigintval($DATA['uid'][$idx])), __FILE__, __LINE__); list($active) = SQL_FETCHROW($result_active); SQL_FREERESULT($result_active); @@ -654,14 +654,14 @@ function RALLYE_DELETE_EXPIRED_RALLYES() // Check for expired rallyes $EXPIRE = getConfig('one_day') * 3; // @TODO The hard-coded value... $result_rallye = SQL_QUERY_ESC("SELECT id, title, start_time, end_time -FROM `{!MYSQL_PREFIX!}_rallye_data` +FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE end_time <= (UNIX_TIMESTAMP() - %s) AND expired='Y'", array($EXPIRE), __FILE__, __LINE__); if (SQL_NUMROWS($result_rallye) > 0) { // Expire found rallyes and notify admin - while(list($id, $title, $start, $end) = SQL_FETCHROW($result_rallye)) + while (list($id, $title, $start, $end) = SQL_FETCHROW($result_rallye)) { // Prepare data for mail template $DATA['title'] = $title; @@ -673,16 +673,16 @@ WHERE end_time <= (UNIX_TIMESTAMP() - %s) AND expired='Y'", SEND_ADMIN_NOTIFICATION(RALLYE_ADMIN_PURGED.": ".$title, "admin_rallye_purged", "", 0); // Purge whole rallye - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_rallye_data` WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); } // Add task - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_task_system` (status, task_type, subject, text, task_created) + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_task_system` (status, task_type, subject, text, task_created) VALUES ('NEW','RALLYE_PURGED','".RALLYE_ADMIN_PURGED.": %s','".RALLYE_ADMIN_PURGED_TEXT."',UNIX_TIMESTAMP())", array($title), __FILE__, __LINE__); } @@ -781,8 +781,8 @@ function RALLYE_GET_REFCOUNT($uid, $old=0) { } else { // Load current refs from database $result_ref = SQL_QUERY_ESC("SELECT DISTINCT SUM(s.counter) AS cnt -FROM `{!MYSQL_PREFIX!}_refsystem` AS s -LEFT JOIN `{!MYSQL_PREFIX!}_refdepths` AS d +FROM `{!_MYSQL_PREFIX!}_refsystem` AS s +LEFT JOIN `{!_MYSQL_PREFIX!}_refdepths` AS d ON s.level=d.level WHERE s.userid=%s AND s.level=1", array(bigintval($uid)), __FILE__, __LINE__); list($cnt) = SQL_FETCHROW($result_ref); diff --git a/inc/libs/refback_functions.php b/inc/libs/refback_functions.php index 2c7c17b3a0..8dd3c22671 100644 --- a/inc/libs/refback_functions.php +++ b/inc/libs/refback_functions.php @@ -49,7 +49,7 @@ 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", __FILE__, __LINE__); // "Walk" through all level while (list($level, $perc) = SQL_FETCHROW($result_refs)) { @@ -73,7 +73,7 @@ function ADD_REFBACK_POINTS ($uid, $ref, $points, $ref_points) { $refback = $points * ($perc / 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", + 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__); //* DEBUG: */ print __FUNCTION__."(".__LINE__."):refback={$refback},uid={$uid},refid={$refid} - UPDATE! (".SQL_AFFECTEDROWS().")
    \n"; @@ -112,7 +112,7 @@ function GET_REFBACK_PERCENTS ($uid, $ref) { $percents = 0; // Get percents from database - $result = SQL_QUERY_ESC("SELECT refback FROM `{!MYSQL_PREFIX!}_user_refs` WHERE userid=%s AND refid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT refback FROM `{!_MYSQL_PREFIX!}_user_refs` WHERE userid=%s AND refid=%s LIMIT 1", array($ref, $uid), __FILE__, __LINE__); // Entry found? (Should be!) @@ -142,7 +142,7 @@ function GET_REFBACK_USERID_ARRAY ($rid, $level) { // Look for all $result = SQL_QUERY_ESC("SELECT userid -FROM `{!MYSQL_PREFIX!}_user_refs` +FROM `{!_MYSQL_PREFIX!}_user_refs` WHERE refid=%s AND level=%s ORDER BY userid ASC", array($rid,$level), __FILE__, __LINE__); @@ -179,14 +179,14 @@ function UPDATE_REFBACK_TABLE($uid) { $old = 0; $minus = 0; // Check for his referal - $result_refid = SQL_QUERY_ESC("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE refid=%s ORDER BY userid ASC", + $result_refid = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE refid=%s ORDER BY userid ASC", array(bigintval($uid)), __FILE__, __LINE__); // When no entry was updated then we have to create it here //* DEBUG: */ print __FUNCTION__."(".__LINE__."):found=".SQL_NUMROWS($result_refid)."
    \n"; if (SQL_NUMROWS($result_refid) > 0) { // Load all refids - while(list($cacheArray['up_refid'][$cacheArray['back_level']]) = SQL_FETCHROW($result_refid)) { + while (list($cacheArray['up_refid'][$cacheArray['back_level']]) = SQL_FETCHROW($result_refid)) { // Remmber userid $cacheArray['up_userid'][$cacheArray['up_refid'][$cacheArray['back_level']]] = $uid; @@ -203,7 +203,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? @@ -211,7 +211,7 @@ function UPDATE_REFBACK_TABLE($uid) { if (SQL_NUMROWS($result) == 0) { // Insert this level //* DEBUG: */ print __FUNCTION__."(".__LINE__."):uid={$uid},level={$cacheArray['back_level']},ref={$cacheArray['up_refid'][$cacheArray['back_level']]} - ADD!
    \n"; - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_user_refs` (userid,level,refid) VALUES (%s,%s,%s)", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_refs` (userid,level,refid) VALUES (%s,%s,%s)", array(bigintval($uid), $cacheArray['back_level'], bigintval($cacheArray['up_refid'][$cacheArray['back_level']])), __FILE__, __LINE__); // Move to next referal level and count his counter one up! @@ -224,14 +224,14 @@ 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? //* DEBUG: */ print __FUNCTION__."(".__LINE__."):uid={$uid},level=".($cacheArray['back_level']-$minus).",ref={$cacheArray['up_refid'][$cacheArray['back_level']]},numRows=".SQL_NUMROWS($result)." - BACK!
    \n"; if (SQL_NUMROWS($result) == 0) { // Insert this level - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_user_refs` (userid,level,refid) VALUES (%s,%s,%s)", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_refs` (userid,level,refid) VALUES (%s,%s,%s)", array(bigintval($uid), ($cacheArray['back_level']-$minus), bigintval($cacheArray['up_refid'][$cacheArray['back_level']])), __FILE__, __LINE__); //* DEBUG: */ print __FUNCTION__."(".__LINE__."):uid={$uid},level=".($cacheArray['back_level']-$minus).",ref={$cacheArray['up_refid'][$cacheArray['back_level']]} - RETURNED!
    \n"; } // END - if @@ -274,8 +274,8 @@ function GET_USER_REFS ($uid, $level) { // Get refs from database $result = SQL_QUERY_ESC("SELECT r.id, r.refid, r.refback, r.points, d.status".$ADD." -FROM `{!MYSQL_PREFIX!}_user_refs` AS r -LEFT JOIN `{!MYSQL_PREFIX!}_user_data` AS d +FROM `{!_MYSQL_PREFIX!}_user_refs` AS r +LEFT JOIN `{!_MYSQL_PREFIX!}_user_data` AS d ON r.refid=d.userid WHERE r.userid=%s AND r.level=%s ORDER BY r.refid ASC", @@ -307,7 +307,7 @@ function GET_USER_REF_ENTRY ($id) { $id = bigintval($id); // Get entry from database - $result = SQL_QUERY_ESC("SELECT id, refid, refback, level FROM `{!MYSQL_PREFIX!}_user_refs` WHERE id=%s AND userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id, refid, refback, level FROM `{!_MYSQL_PREFIX!}_user_refs` WHERE id=%s AND userid=%s LIMIT 1", array($id, $GLOBALS['userid']), __FILE__, __LINE__); // Is there an entry? @@ -358,7 +358,7 @@ function REFBACK_CHANGE_MEMBER_PERCENTS ($id, $percents) { $percents = REVERT_COMMA($percents); // Update entry - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_refs` SET refback='%s' WHERE id=%s AND userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_refs` SET refback='%s' WHERE id=%s AND userid=%s LIMIT 1", array($percents, $id, $GLOBALS['userid']), __FILE__, __LINE__); // Entry updated? diff --git a/inc/libs/register_functions.php b/inc/libs/register_functions.php index 0564fb375e..042ed73134 100644 --- a/inc/libs/register_functions.php +++ b/inc/libs/register_functions.php @@ -40,8 +40,8 @@ if (!defined('__SECURITY')) { // function REGISTER_FILL_MUST_CONSTANTS() { - $result = SQL_QUERY("SELECT field_name, field_required FROM `{!MYSQL_PREFIX!}_must_register` ORDER BY id", __FILE__, __LINE__); - while(list($name, $required) = SQL_FETCHROW($result)) { + $result = SQL_QUERY("SELECT field_name, field_required FROM `{!_MYSQL_PREFIX!}_must_register` ORDER BY `id`", __FILE__, __LINE__); + while (list($name, $required) = SQL_FETCHROW($result)) { $value = ""; if ($required == "Y") $value = "
     (*)
    "; $eval = "define('MUST_".strtoupper($name)."', \"".$value."\");"; @@ -63,7 +63,7 @@ function REGISTER_CHECK_REQUIRED_FIELDS(&$array) $ret = false; foreach ($array as $key => $value) { - $result = SQL_QUERY("SELECT field_required FROM `{!MYSQL_PREFIX!}_must_register` WHERE field_name='".$key."' LIMIT 1", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT field_required FROM `{!_MYSQL_PREFIX!}_must_register` WHERE field_name='".$key."' LIMIT 1", __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // "Must-line" found @@ -87,8 +87,8 @@ function REGISTER_CHECK_REQUIRED_FIELDS(&$array) // function REGISTER_OUTPUT_REQUIRE_CHECK(&$array) { - $result = SQL_QUERY("SELECT field_name, field_required FROM `{!MYSQL_PREFIX!}_must_register` ORDER BY id", __FILE__, __LINE__); - while(list($name, $required) = SQL_FETCHROW($result)) + $result = SQL_QUERY("SELECT field_name, field_required FROM `{!_MYSQL_PREFIX!}_must_register` ORDER BY `id`", __FILE__, __LINE__); + while (list($name, $required) = SQL_FETCHROW($result)) { if (($array[$name] == "!") && ($required == "Y")) { // Empty entry found @@ -109,11 +109,11 @@ function REGISTER_ADD_CATEGORY_TABLE ($MODE, $return=false) // Guests are mostly not interested in how many members has // choosen an individual category - $AND = "WHERE visible='Y' "; + $AND = "WHERE `visible`='Y' "; // Admins are allowed to see every category... if (IS_ADMIN()) $AND = ""; - $result = SQL_QUERY("SELECT id, cat, visible FROM `{!MYSQL_PREFIX!}_cats` ".$AND." ORDER BY sort", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id, cat, visible FROM `{!_MYSQL_PREFIX!}_cats` ".$AND." ORDER BY `sort`", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // List alle visible modules (or all to the admin) diff --git a/inc/libs/rewrite_functions.php b/inc/libs/rewrite_functions.php index 5a1929e6a2..8a8d6f01fc 100644 --- a/inc/libs/rewrite_functions.php +++ b/inc/libs/rewrite_functions.php @@ -45,18 +45,18 @@ function REWRITE_LINKS ($HTML) { if (ereg($GLOBALS['module'], getConfig('rewrite_skip'))) return $HTML; // Strip slashes with double-backslashes for the preg_replace() function - $URL = str_replace("/", "\\/", URL); + $URL = str_replace("/", "\\/", constant('URL')); // Generate target URL - $target = URL."/cms/"; + $target = constant('URL')."/cms/"; // Convert modules.php?module=... $test = preg_replace("/".$URL."\\/modules.php\\?module=/i", $target, $HTML); if (eregi(SERVER_URL, $test)) { // Konvert URLs from my server - $URL = str_replace("/", "\\/", SERVER_URL); - $test = preg_replace("/".$URL."\\/modules.php\\?module=/i", SERVER_URL."/cms/", $test); + $URL = str_replace("/", "\\/", constant('SERVER_URL')); + $test = preg_replace("/".$URL."\\/modules.php\\?module=/i", constant('SERVER_URL')."/cms/", $test); } // END - if // Strip slashes as above for the main URL diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php index 50b0d509cb..1bc1c7ed7f 100644 --- a/inc/libs/sponsor_functions.php +++ b/inc/libs/sponsor_functions.php @@ -69,7 +69,7 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_S $SAVE = false; } else { // Do we want to add a new sponsor or update his data? - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_sponsor_data` WHERE email='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE email='%s' LIMIT 1", array($POST['email']), __FILE__, __LINE__); // Is a sponsor alread in the db? @@ -125,7 +125,7 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_S // 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', "; } @@ -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(ADMIN_SPONSOR_ADDED, "added", $MSGs); @@ -264,7 +264,7 @@ function IS_SPONSOR () { $ret = false; if ((isSessionVariableSet('sponsorid'))) && (isSessionVariableSet('sponsorpass')))) { // Check cookies against database records... - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_sponsor_data` + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' AND password='%s' AND status='CONFIRMED' LIMIT 1", array(bigintval(get_session('sponsorid')), get_session('sponsorpass')), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { @@ -287,23 +287,23 @@ function GENERATE_SPONSOR_MENU($current) if (IS_ADMIN()) $WHERE = ""; // Load main menu entries - $result_main = SQL_QUERY("SELECT action, title FROM `{!MYSQL_PREFIX!}_sponsor_menu` -WHERE (what='' OR what IS NULL) ".$WHERE." -ORDER BY sort", __FILE__, __LINE__); + $result_main = SQL_QUERY("SELECT action, title FROM `{!_MYSQL_PREFIX!}_sponsor_menu` +WHERE (what='' OR `what` IS NULL) ".$WHERE." +ORDER BY `sort`", __FILE__, __LINE__); if (SQL_NUMROWS($result_main) > 0) { // Load every menu and it's sub menus - while(list($action, $title_main) = SQL_FETCHROW($result_main)) + while (list($action, $title_main) = SQL_FETCHROW($result_main)) { // Load sub menus - $result_sub = SQL_QUERY_ESC("SELECT what, title FROM `{!MYSQL_PREFIX!}_sponsor_menu` -WHERE action='%s' AND what != '' AND what IS NOT NULL ".$WHERE." -ORDER BY sort", array($action), __FILE__, __LINE__); + $result_sub = SQL_QUERY_ESC("SELECT what, title FROM `{!_MYSQL_PREFIX!}_sponsor_menu` +WHERE action='%s' AND `what` != '' AND `what` IS NOT NULL ".$WHERE." +ORDER BY `sort`", array($action), __FILE__, __LINE__); if (SQL_NUMROWS($result_sub) > 0) { // Load sub menus $SUB = ""; - while(list($what, $title_sub) = SQL_FETCHROW($result_sub)) + while (list($what, $title_sub) = SQL_FETCHROW($result_sub)) { // Check if current selected menu is matching the loaded one if ($current == $what) $title_sub = "".$title_sub.""; @@ -374,7 +374,7 @@ function UPDATE_SPONSOR_LOGIN () { // Is sponsor? if (IS_SPONSOR()) { // Update last online timestamp - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_sponsor_data` + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET last_online=UNIX_TIMESTAMP() WHERE id='%s' AND password='%s' LIMIT 1", array(bigintval(get_session('sponsorid')), get_session('sponsorpass')), __FILE__, __LINE__); @@ -417,7 +417,7 @@ 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',"; diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php index 914494b368..a20d2f8e10 100644 --- a/inc/libs/surfbar_functions.php +++ b/inc/libs/surfbar_functions.php @@ -185,7 +185,7 @@ function SURFBAR_MEMBER_ACTIONS ($urlId, $status) { foreach ($actionArray as $actionId=>$action) { // Add form for this action $OUT .= sprintf(" -
    + @@ -264,7 +264,7 @@ function SURFBAR_VALIDATE_MEMBER_ACTION_STATUS ($action, $status) { global $SURFBAR_CACHE; // Search for the requested action/status combination in database - $result = SQL_QUERY_ESC("SELECT new_status FROM `{!MYSQL_PREFIX!}_surfbar_actions` WHERE action='%s' AND status='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT new_status FROM `{!_MYSQL_PREFIX!}_surfbar_actions` WHERE action='%s' AND status='%s' LIMIT 1", array($action, $status), __FILE__, __LINE__); // Is the entry there? @@ -432,7 +432,7 @@ function SURFBAR_MEMBER_EXECUTE_EDIT_ACTION ($urlData) { if (true) { //if (($urlData['views_allowed'] != $urlData['edit']['limit']) || ($url1 != $url2)) { // Run the query - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_surfbar_urls` SET url='%s', views_allowed=%s, views_max=%s WHERE id=%s AND status='%s' LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_surfbar_urls` SET url='%s', views_allowed=%s, views_max=%s WHERE id=%s AND status='%s' LIMIT 1", array($urlData['url'], $urlData['edit']['limit'], $urlData['edit']['limit'], $urlData['id'], $urlData['status']), __FILE__, __LINE__); // All fine @@ -504,7 +504,7 @@ function SURFBAR_HANDLE_LOW_POINTS () { SURFBAR_NOTIFY_USER("low_points", $content); // Update last notified - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET surfbar_low_notified=NOW() WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET surfbar_low_notified=NOW() WHERE userid=%s LIMIT 1", array($uid), __FILE__, __LINE__); } // END - if } // END - foreach @@ -543,7 +543,7 @@ function SURFBAR_GET_URL_DATA ($searchTerm, $column="id", $order="id", $sort="AS // Look up the record $result = SQL_QUERY_ESC("SELECT id, userid, url, views_total, views_max, views_allowed, status, registered, last_locked, lock_reason, views_max, views_allowed, fixed_reload -FROM `{!MYSQL_PREFIX!}_surfbar_urls` +FROM `{!_MYSQL_PREFIX!}_surfbar_urls` WHERE %s='%s'".$add." ORDER BY %s %s %s", @@ -622,7 +622,7 @@ function SURFBAR_INSERT_URL_BY_ARRAY ($urlData) { if (empty($uid)) $uid = 0; // Just run the insert query for now - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_surfbar_urls` (userid,url,status,views_max,views_allowed,fixed_reload) VALUES (%s,'%s','%s',%s,%s,%s)", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_urls` (userid,url,status,views_max,views_allowed,fixed_reload) VALUES (%s,'%s','%s',%s,%s,%s)", array( $uid, $urlData['url'], @@ -821,8 +821,8 @@ function SURFBAR_CHECK_RELOAD_FULL() { } // END - if // Ask the database - $result = SQL_QUERY_ESC("SELECT COUNT(l.id) AS cnt FROM `{!MYSQL_PREFIX!}_surfbar_locks` AS l -INNER JOIN `{!MYSQL_PREFIX!}_surfbar_urls` AS u + $result = SQL_QUERY_ESC("SELECT COUNT(l.id) AS cnt FROM `{!_MYSQL_PREFIX!}_surfbar_locks` AS l +INNER JOIN `{!_MYSQL_PREFIX!}_surfbar_urls` AS u ON u.id=l.url_id WHERE l.userid=%s AND (UNIX_TIMESTAMP() - ".SURFBAR_GET_SURF_LOCK().") < UNIX_TIMESTAMP(l.last_surfed) AND (((UNIX_TIMESTAMP(l.last_surfed) - u.fixed_reload) < 0 AND u.fixed_reload > 0) OR u.fixed_reload = 0) LIMIT 1", @@ -864,7 +864,7 @@ function SURFBAR_GET_TOTAL_URLS ($status="ACTIVE", $excludeUserId=0) { // Get amount from database $result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt -FROM `{!MYSQL_PREFIX!}_surfbar_urls` +FROM `{!_MYSQL_PREFIX!}_surfbar_urls` WHERE userid NOT IN (".implode(",", $UIDs['uid']).") AND status='%s'", array($status), __FILE__, __LINE__ ); @@ -918,7 +918,7 @@ function SURFBAR_GET_TOTAL_USER_URLS ($uid=0, $status="",$exclude="") { // Get amount from database $result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt -FROM `{!MYSQL_PREFIX!}_surfbar_urls` +FROM `{!_MYSQL_PREFIX!}_surfbar_urls` WHERE userid=%s".$ADD." LIMIT %s", array($uid, getConfig('surfbar_max_order')), __FILE__, __LINE__ @@ -995,11 +995,11 @@ function SURFBAR_LOCKDOWN_ID ($urlId) { //* DEBUG: */ print "LOCK!"); ///* DEBUG: */ return; // Just add it to the database - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_surfbar_locks` (userid, url_id) VALUES (%s, %s)", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_locks` (userid, url_id) VALUES (%s, %s)", array($GLOBALS['userid'], bigintval($urlId)), __FILE__, __LINE__); // Remove the salt from database - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_surfbar_salts` WHERE url_id=%s AND userid=%s LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_surfbar_salts` WHERE url_id=%s AND userid=%s LIMIT 1", array(bigintval($urlId), $GLOBALS['userid']), __FILE__, __LINE__); } // Pay points to the user and remove it from the sender if userid is given else it is a "sponsored surf" @@ -1033,17 +1033,17 @@ function SURFBAR_UPDATE_INSERT_STATS_RECORD () { } // END - if // Update URL stats - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_surfbar_urls` SET views_total=views_total+1".$ADD." WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_surfbar_urls` SET views_total=views_total+1".$ADD." WHERE id=%s LIMIT 1", array(SURFBAR_GET_ID()), __FILE__, __LINE__); // Update the stats entry - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_surfbar_stats` SET count=count+1 WHERE userid=%s AND url_id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_surfbar_stats` SET count=count+1 WHERE userid=%s AND url_id=%s LIMIT 1", array($GLOBALS['userid'], SURFBAR_GET_ID()), __FILE__, __LINE__); // Was that update okay? if (SQL_AFFECTEDROWS() < 1) { // No, then insert entry - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_surfbar_stats` (userid,url_id,count) VALUES (%s,%s,1)", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_stats` (userid,url_id,count) VALUES (%s,%s,1)", array($GLOBALS['userid'], SURFBAR_GET_ID()), __FILE__, __LINE__); } // END - if @@ -1062,7 +1062,7 @@ function SURFBAR_UPDATE_SALT_STATS () { SURFBAR_UPDATE_INSERT_STATS_RECORD(); // Simply store the salt from cache away in database... - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_surfbar_salts` SET last_salt='%s' WHERE url_id=%s AND userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_surfbar_salts` SET last_salt='%s' WHERE url_id=%s AND userid=%s LIMIT 1", array(SURFBAR_GET_SALT(), SURFBAR_GET_ID(), $GLOBALS['userid']), __FILE__, __LINE__); // Debug message @@ -1071,7 +1071,7 @@ function SURFBAR_UPDATE_SALT_STATS () { // Was that okay? if (SQL_AFFECTEDROWS() < 1) { // Insert missing entry! - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_surfbar_salts` (url_id,userid,last_salt) VALUES (%s, %s, '%s')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_salts` (url_id,userid,last_salt) VALUES (%s, %s, '%s')", array(SURFBAR_GET_ID(), $GLOBALS['userid'], SURFBAR_GET_SALT()), __FILE__, __LINE__); } // END - if @@ -1086,7 +1086,7 @@ function SURFBAR_CHECK_RELOAD_LOCK ($urlId) { //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "id={$urlId}", false); // Ask the database $result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt -FROM `{!MYSQL_PREFIX!}_surfbar_locks` +FROM `{!_MYSQL_PREFIX!}_surfbar_locks` WHERE userid=%s AND url_id=%s AND (UNIX_TIMESTAMP() - ".SURFBAR_GET_SURF_LOCK().") < UNIX_TIMESTAMP(last_surfed) ORDER BY last_surfed ASC LIMIT 1", @@ -1121,8 +1121,8 @@ function SURFBAR_DETERMINE_DEPLETED_USERIDS ($limit=0) { // Get all userid except logged in one $result = SQL_QUERY_ESC("SELECT u.userid, UNIX_TIMESTAMP(d.surfbar_low_notified) AS notified -FROM `{!MYSQL_PREFIX!}_surfbar_urls` AS u -INNER JOIN `{!MYSQL_PREFIX!}_user_data` AS d +FROM `{!_MYSQL_PREFIX!}_surfbar_urls` AS u +INNER JOIN `{!_MYSQL_PREFIX!}_user_data` AS d ON u.userid=d.userid WHERE u.userid NOT IN (%s,0) AND u.status='ACTIVE' GROUP BY u.userid @@ -1131,8 +1131,8 @@ ORDER BY u.userid ASC", } else { // Get all userid $result = SQL_QUERY("SELECT u.userid, UNIX_TIMESTAMP(d.surfbar_low_notified) AS notified -FROM `{!MYSQL_PREFIX!}_surfbar_urls` AS u -INNER JOIN `{!MYSQL_PREFIX!}_user_data` AS d +FROM `{!_MYSQL_PREFIX!}_surfbar_urls` AS u +INNER JOIN `{!_MYSQL_PREFIX!}_user_data` AS d ON u.userid=d.userid WHERE u.status='ACTIVE' GROUP BY u.userid @@ -1170,7 +1170,7 @@ function SURFBAR_DETERMINE_TOTAL_ONLINE () { // Count all users in surfbar modue and return the value $result = SQL_QUERY_ESC("SELECT id -FROM `{!MYSQL_PREFIX!}_surfbar_stats` +FROM `{!_MYSQL_PREFIX!}_surfbar_stats` WHERE (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(last_online)) <= %s GROUP BY userid", array(getConfig('online_timeout')), __FILE__, __LINE__); @@ -1235,7 +1235,7 @@ function SURFBAR_CHANGE_STATUS ($urlId, $prevStatus, $newStatus, $data=array()) // Update the status now // ---------- Comment out for debugging/developing member actions! --------- - //SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_surfbar_urls` SET status='%s' WHERE id=%s LIMIT 1", + //SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_surfbar_urls` SET status='%s' WHERE id=%s LIMIT 1", // array($newStatus, bigintval($urlId)), __FILE__, __LINE__); // ---------- Comment out for debugging/developing member actions! --------- @@ -1403,10 +1403,10 @@ function SURFBAR_GET_MAX_RANDOM ($UIDs, $ADD) { global $_CONFIG; // Count max availabe entries $result = SQL_QUERY("SELECT sbu.id AS cnt -FROM `{!MYSQL_PREFIX!}_surfbar_urls` AS sbu -LEFT JOIN `{!MYSQL_PREFIX!}_surfbar_salts` AS sbs +FROM `{!_MYSQL_PREFIX!}_surfbar_urls` AS sbu +LEFT JOIN `{!_MYSQL_PREFIX!}_surfbar_salts` AS sbs ON sbu.id=sbs.url_id -LEFT JOIN `{!MYSQL_PREFIX!}_surfbar_locks` AS l +LEFT JOIN `{!_MYSQL_PREFIX!}_surfbar_locks` AS l ON sbu.id=l.url_id WHERE sbu.userid NOT IN (".implode(",", $UIDs).") AND (sbu.views_allowed=0 OR (sbu.views_allowed > 0 AND sbu.views_max > 0)) AND sbu.status='ACTIVE'".$ADD." GROUP BY sbu.id", __FILE__, __LINE__); @@ -1430,7 +1430,7 @@ function SURFBAR_GET_USER_URLS () { // Begin the query $result = SQL_QUERY_ESC("SELECT u.id, u.userid, u.url, u.views_total, u.views_max, u.views_allowed, u.status, UNIX_TIMESTAMP(u.registered) AS registered, UNIX_TIMESTAMP(u.last_locked) AS last_locked, u.lock_reason AS lock_reason -FROM `{!MYSQL_PREFIX!}_surfbar_urls` AS u +FROM `{!_MYSQL_PREFIX!}_surfbar_urls` AS u WHERE u.userid=%s AND u.status != 'DELETED' ORDER BY u.id ASC", array($GLOBALS['userid']), __FILE__, __LINE__); @@ -1456,7 +1456,7 @@ function SURFBAR_GET_ACTION_ARRAY ($status) { $returnArray = array(); // Get all assigned actions - $result = SQL_QUERY_ESC("SELECT action FROM `{!MYSQL_PREFIX!}_surfbar_actions` WHERE status='%s' ORDER BY id ASC", + $result = SQL_QUERY_ESC("SELECT action FROM `{!_MYSQL_PREFIX!}_surfbar_actions` WHERE status='%s' ORDER BY `id` ASC", array($status), __FILE__, __LINE__); // Some entries there? @@ -1528,10 +1528,10 @@ function SURFBAR_DETERMINE_NEXT_ID ($urlId = 0) { // And query the database //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "randNum={$randNum},maxRand={$maxRand},surfLock=".SURFBAR_GET_SURF_LOCK()."", false); $result = SQL_QUERY_ESC("SELECT sbu.id, sbu.userid, sbu.url, sbs.last_salt, sbu.views_total, sbu.views_max, sbu.views_allowed, UNIX_TIMESTAMP(l.last_surfed) AS last_surfed, sbu.fixed_reload -FROM `{!MYSQL_PREFIX!}_surfbar_urls` AS sbu -LEFT JOIN `{!MYSQL_PREFIX!}_surfbar_salts` AS sbs +FROM `{!_MYSQL_PREFIX!}_surfbar_urls` AS sbu +LEFT JOIN `{!_MYSQL_PREFIX!}_surfbar_salts` AS sbs ON sbu.id=sbs.url_id -LEFT JOIN `{!MYSQL_PREFIX!}_surfbar_locks` AS l +LEFT JOIN `{!_MYSQL_PREFIX!}_surfbar_locks` AS l ON sbu.id=l.url_id WHERE sbu.userid NOT IN (".implode(",", $UIDs['uid']).") AND sbu.status='ACTIVE' AND (sbu.views_allowed=0 OR (sbu.views_allowed > 0 AND sbu.views_max > 0))".$ADD." GROUP BY sbu.id @@ -1542,10 +1542,10 @@ LIMIT %s,1", } else { // Get data from specified id number $result = SQL_QUERY_ESC("SELECT sbu.id, sbu.userid, sbu.url, sbs.last_salt, sbu.views_total, sbu.views_max, sbu.views_allowed, UNIX_TIMESTAMP(l.last_surfed) AS last_surfed, sbu.fixed_reload -FROM `{!MYSQL_PREFIX!}_surfbar_urls` AS sbu -LEFT JOIN `{!MYSQL_PREFIX!}_surfbar_salts` AS sbs +FROM `{!_MYSQL_PREFIX!}_surfbar_urls` AS sbu +LEFT JOIN `{!_MYSQL_PREFIX!}_surfbar_salts` AS sbs ON sbu.id=sbs.url_id -LEFT JOIN `{!MYSQL_PREFIX!}_surfbar_locks` AS l +LEFT JOIN `{!_MYSQL_PREFIX!}_surfbar_locks` AS l ON sbu.id=l.url_id WHERE sbu.userid != %s AND sbu.status='ACTIVE' AND sbu.id=%s AND (sbu.views_allowed=0 OR (sbu.views_allowed > 0 AND sbu.views_max > 0)) LIMIT 1", diff --git a/inc/libs/task_functions.php b/inc/libs/task_functions.php index 59f30ec08e..4b7dc98d3b 100644 --- a/inc/libs/task_functions.php +++ b/inc/libs/task_functions.php @@ -66,7 +66,7 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) $value = GET_TOTAL_DATA(GET_CURRENT_ADMIN_ID(), "task_system", "id", "assigned_admin", true, " AND status='NEW' AND task_type='EXTENSION_UPDATE'"); if ($value > 0) { - define('__TASK_UPDATE_VALUE', "".$value.""); + define('__TASK_UPDATE_VALUE', "".$value.""); } else { define('__TASK_UPDATE_VALUE', "0"); } @@ -81,7 +81,7 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) $value = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true); if ($value > 0) { - define('__CONFIRMED_VALUE', "".$value.""); + define('__CONFIRMED_VALUE', "".$value.""); } else { define('__CONFIRMED_VALUE', "0"); } @@ -90,7 +90,7 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) $value = GET_TOTAL_DATA("UNCONFIRMED", "user_data", "userid", "status", true); if ($value > 0) { - define('__UNCONFIRMED_VALUE', "".$value.""); + define('__UNCONFIRMED_VALUE', "".$value.""); } else { define('__UNCONFIRMED_VALUE', "0"); } @@ -99,7 +99,7 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) $value = GET_TOTAL_DATA("LOCKED", "user_data", "userid", "status", true); if ($value > 0) { - define('__LOCKED_VALUE', "".$value.""); + define('__LOCKED_VALUE', "".$value.""); } else { define('__LOCKED_VALUE', "0"); } @@ -110,7 +110,7 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) $value = GET_TOTAL_DATA("0", "task_system", "id", "assigned_admin", true, " AND `status` != 'DELETED'"); if ($value > 0) { - define('__TASK_NEW_VALUE', "".$value.""); + define('__TASK_NEW_VALUE', "".$value.""); } else { define('__TASK_NEW_VALUE', "0"); } @@ -121,7 +121,7 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) $value = GET_TOTAL_DATA("CLOSED", "task_system", "id", "status", true); if ($value > 0) { - define('__TASK_CLOSED_VALUE', "".$value.""); + define('__TASK_CLOSED_VALUE', "".$value.""); } else { define('__TASK_CLOSED_VALUE', "0"); } @@ -132,7 +132,7 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) $value = GET_TOTAL_DATA("DELETED", "task_system", "id", "status", true); if ($value > 0) { - define('__TASK_DELETED_VALUE', "".$value.""); + define('__TASK_DELETED_VALUE', "".$value.""); } else { define('__TASK_DELETED_VALUE', "0"); } @@ -143,7 +143,7 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) $value = GET_TOTAL_DATA("SOLVED", "task_system", "id", "status", true, sprintf(" AND assigned_admin=%s", GET_CURRENT_ADMIN_ID())); if ($value > 0) { - define('__TASK_SOLVED_VALUE', "".$value.""); + define('__TASK_SOLVED_VALUE', "".$value.""); } else { define('__TASK_SOLVED_VALUE', "0"); } @@ -154,7 +154,7 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) $value = GET_TOTAL_DATA(GET_CURRENT_ADMIN_ID(), "task_system", "id", "assigned_admin", true, " AND status = 'NEW' AND task_type != 'EXTENSION_UPDATE'"); if ($value > 0) { - define('__TASK_YOUR_VALUE', "".$value.""); + define('__TASK_YOUR_VALUE', "".$value.""); } else { define('__TASK_YOUR_VALUE', "0"); } @@ -165,7 +165,7 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) $value = GET_TOTAL_DATA("ADMIN", "pool", "id", "data_type", true); if ($value > 0) { - define('__MAIL_ADMIN_VALUE', "".$value.""); + define('__MAIL_ADMIN_VALUE', "".$value.""); } else { define('__MAIL_ADMIN_VALUE', "0"); } @@ -176,7 +176,7 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) $value = GET_TOTAL_DATA("TEMP", "pool", "id", "data_type", true); if ($value > 0) { - define('__MAIL_TEMP_VALUE', "".$value.""); + define('__MAIL_TEMP_VALUE', "".$value.""); } else { define('__MAIL_TEMP_VALUE', "0"); } @@ -187,7 +187,7 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) $value = GET_TOTAL_DATA("SEND", "pool", "id", "data_type", true); if ($value > 0) { - define('__MAIL_SEND_VALUE', "".$value.""); + define('__MAIL_SEND_VALUE', "".$value.""); } else { define('__MAIL_SEND_VALUE', "0"); } @@ -200,7 +200,7 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) $value = GET_TOTAL_DATA("DELETED", "pool", "id", "data_type", true); if ($value > 0) { - define('__MAIL_DELETED_VALUE', "".$value.""); + define('__MAIL_DELETED_VALUE', "".$value.""); } else { define('__MAIL_DELETED_VALUE', "0"); } @@ -213,18 +213,18 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) $value = GET_TOTAL_DATA("DELETED", "bonus", "id", "data_type", true); if ($value > 0) { - define('__MAIL_BONUS_AP_VALUE', "".$value.""); + define('__MAIL_BONUS_AP_VALUE', "".$value.""); } else { define('__MAIL_BONUS_AP_VALUE', "0"); } } elseif (EXT_IS_ACTIVE("bonus")) { define('__MAIL_BONUS_AP_VALUE', ADMIN_EXT_BONUS_OUTDATED_1."0.1.8".ADMIN_EXT_BONUS_OUTDATED_2); } else { - define('__MAIL_BONUS_AP_VALUE', "
    ".ADMIN_EXT_BONUS_404."
    "); + define('__MAIL_BONUS_AP_VALUE', "
    {!ADMIN_EXT_BONUS_404!}
    "); } } else { - define('__MAIL_BONUS_AP_VALUE', "
    ".ADMIN_EXT_AUTOPURGE_404."
    "); - define('__MAIL_DELETED_VALUE', "
    ".ADMIN_EXT_AUTOPURGE_404."
    "); + define('__MAIL_BONUS_AP_VALUE', "
    {!ADMIN_EXT_AUTOPURGE_404!}
    "); + define('__MAIL_DELETED_VALUE', "
    {!ADMIN_EXT_AUTOPURGE_404!}
    "); } // @@ -235,14 +235,14 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) $value = GET_TOTAL_DATA("SEND", "bonus", "id", "data_type", true, " AND is_notify='N'"); if ($value > 0) { - define('__MAIL_BONUS_SEND_VALUE', "".$value.""); + define('__MAIL_BONUS_SEND_VALUE', "".$value.""); } else { define('__MAIL_BONUS_SEND_VALUE', "0"); } } elseif (EXT_IS_ACTIVE("bonus")) { define('__MAIL_BONUS_SEND_VALUE', ADMIN_EXT_BONUS_OUTDATED_1."0.1.8".ADMIN_EXT_BONUS_OUTDATED_2); } else { - define('__MAIL_BONUS_SEND_VALUE', ADMIN_EXT_BONUS_404); + define('__MAIL_BONUS_SEND_VALUE', getMessage('ADMIN_EXT_BONUS_404')); } if (EXT_IS_ACTIVE("autopurge")) { @@ -261,65 +261,65 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) // Check for all accounts $SQLs[] = "SELECT DISTINCT d.userid, d.email, d.last_online -FROM `{!MYSQL_PREFIX!}_user_data` AS d +FROM `{!_MYSQL_PREFIX!}_user_data` AS d WHERE d.status='CONFIRMED' AND d.joined < (UNIX_TIMESTAMP() - ".$since.") AND d.last_online < (UNIX_TIMESTAMP() - ".$since.") AND d.ap_notified < (UNIX_TIMESTAMP() - ".$since.") ".$EXCLUDE_LIST." ORDER BY d.userid"; $WHATs[] = "list_autopurge"; - $DESCRs[] = TASK_ADMIN_INACTIVE_AUTOPURGE; - $TITLEs[] = TASK_ADMIN_INACTIVE_AUTOPURGE_TITLE; + $DESCRs[] = getMessage('TASK_ADMIN_INACTIVE_AUTOPURGE'); + $TITLEs[] = getMessage('TASK_ADMIN_INACTIVE_AUTOPURGE_TITLE'); } if (GET_EXT_VERSION("sql_patches") >= "0.3.4") { // Check for accounts without referal - $SQLs[] = "SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE refid='0' ORDER BY userid"; - $DESCRs[] = TASK_ADMIN_LIST_ACCOUNT_NOREF; - $TITLEs[] = TASK_ADMIN_LIST_ACCOUNT_NOREF_TITLE; + $SQLs[] = "SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE refid='0' ORDER BY userid"; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_ACCOUNT_NOREF'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_ACCOUNT_NOREF_TITLE'); $WHATs[] = "list_user&mode=norefs"; } if (EXT_IS_ACTIVE("payout")) { // List new payout requests - $SQLs[] = "SELECT userid FROM `{!MYSQL_PREFIX!}_user_payouts` WHERE status='NEW' ORDER BY userid"; + $SQLs[] = "SELECT userid FROM `{!_MYSQL_PREFIX!}_user_payouts` WHERE status='NEW' ORDER BY userid"; $WHATs[] = "list_payouts"; - $DESCRs[] = TASK_ADMIN_LIST_PAYOUTS_WAITING; - $TITLEs[] = TASK_ADMIN_LIST_PAYOUTS_WAITING_TITLE; - $SQLs[] = "SELECT userid FROM `{!MYSQL_PREFIX!}_user_payouts` ORDER BY userid"; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_PAYOUTS_WAITING'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_PAYOUTS_WAITING_TITLE'); + $SQLs[] = "SELECT userid FROM `{!_MYSQL_PREFIX!}_user_payouts` ORDER BY userid"; $WHATs[] = "list_payouts"; - $DESCRs[] = TASK_ADMIN_LIST_PAYOUTS_ALL; - $TITLEs[] = TASK_ADMIN_LIST_PAYOUTS_ALL_TITLE; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_PAYOUTS_ALL'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_PAYOUTS_ALL_TITLE'); } if (EXT_IS_ACTIVE("wernis")) { // List new wernis requests - $SQLs[] = "SELECT userid FROM `{!MYSQL_PREFIX!}_user_wernis` ORDER BY userid"; + $SQLs[] = "SELECT userid FROM `{!_MYSQL_PREFIX!}_user_wernis` ORDER BY userid"; $WHATs[] = "list_wernis"; - $DESCRs[] = TASK_ADMIN_LIST_WERNIS_ALL; - $TITLEs[] = TASK_ADMIN_LIST_WERNIS_ALL_TITLE; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_WERNIS_ALL'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_WERNIS_ALL_TITLE'); } if (EXT_IS_ACTIVE("primera")) { // List new primera requests - $SQLs[] = "SELECT userid FROM `{!MYSQL_PREFIX!}_user_primera` ORDER BY userid"; + $SQLs[] = "SELECT userid FROM `{!_MYSQL_PREFIX!}_user_primera` ORDER BY userid"; $WHATs[] = "list_primera"; - $DESCRs[] = TASK_ADMIN_LIST_PRIMERA_ALL; - $TITLEs[] = TASK_ADMIN_LIST_PRIMERA_ALL_TITLE; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_PRIMERA_ALL'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_PRIMERA_ALL_TITLE'); } if (EXT_IS_ACTIVE("holiday")) { // List holiday requests - $SQLs[] = "SELECT userid FROM `{!MYSQL_PREFIX!}_user_holidays` ORDER BY userid"; + $SQLs[] = "SELECT userid FROM `{!_MYSQL_PREFIX!}_user_holidays` ORDER BY userid"; $WHATs[] = "list_holiday"; - $DESCRs[] = TASK_ADMIN_LIST_HOLIDAYS; - $TITLEs[] = TASK_ADMIN_LIST_HOLIDAYS_TITLE; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_HOLIDAYS'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_HOLIDAYS_TITLE'); } if (GET_EXT_VERSION("bonus") >= "0.8.7") { // List all notifications - $SQLs[] = "SELECT id FROM `{!MYSQL_PREFIX!}_bonus` WHERE is_notify='Y' ORDER BY timestamp DESC"; + $SQLs[] = "SELECT id FROM `{!_MYSQL_PREFIX!}_bonus` WHERE is_notify='Y' ORDER BY timestamp DESC"; $WHATs[] = "list_notifications"; - $DESCRs[] = TASK_ADMIN_LIST_NOTIFICATIONS; - $TITLEs[] = TASK_ADMIN_LIST_NOTIFICATIONS_TITLE; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_NOTIFICATIONS'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_NOTIFICATIONS_TITLE'); } // END - if if (GET_EXT_VERSION("bonus") >= "0.2.3") { @@ -346,12 +346,12 @@ ORDER BY d.userid"; } $SQLs[] = "SELECT ".$USE." AS points -FROM `{!MYSQL_PREFIX!}_user_data` +FROM `{!_MYSQL_PREFIX!}_user_data` WHERE status='CONFIRMED' AND ".$USE.">0".$LAST." ORDER BY points DESC, userid"; $WHATs[] = "list_bonus"; - $DESCRs[] = TASK_ADMIN_LIST_BONUS; - $TITLEs[] = TASK_ADMIN_LIST_BONUS_TITLE; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_BONUS'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_BONUS_TITLE'); } if (GET_EXT_VERSION("beg") >= "0.1.2") { @@ -364,160 +364,164 @@ ORDER BY points DESC, userid"; $LAST = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", getConfig('ap_inactive_since')); } - $SQLs[] = "SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` + $SQLs[] = "SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE status='CONFIRMED' AND beg_points>0".$LAST." ORDER BY beg_points DESC, userid"; $WHATs[] = "list_beg"; - $DESCRs[] = TASK_ADMIN_LIST_BEG; - $TITLEs[] = TASK_ADMIN_LIST_BEG_TITLE; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_BEG'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_BEG_TITLE'); } if (EXT_IS_ACTIVE("doubler")) { // List waiting payouts - $SQLs[] = "SELECT id FROM `{!MYSQL_PREFIX!}_doubler` WHERE completed='N' ORDER BY id"; + $SQLs[] = "SELECT id FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='N' ORDER BY `id`"; $WHATs[] = "list_doubler&mode=waiting&select=all"; - $DESCRs[] = TASK_ADMIN_LIST_DOUBLER_WAITING; - $TITLEs[] = TASK_ADMIN_LIST_DOUBLER_WAITING_TITLE; - $SQLs[] = "SELECT id FROM `{!MYSQL_PREFIX!}_doubler` ORDER BY id"; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_DOUBLER_WAITING'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_DOUBLER_WAITING_TITLE'); + $SQLs[] = "SELECT id FROM `{!_MYSQL_PREFIX!}_doubler` ORDER BY `id`"; $WHATs[] = "list_doubler"; - $DESCRs[] = TASK_ADMIN_LIST_DOUBLER_ALL; - $TITLEs[] = TASK_ADMIN_LIST_DOUBLER_ALL_TITLE; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_DOUBLER_ALL'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_DOUBLER_ALL_TITLE'); } // // All referal banner // - $SQLs[] = "SELECT id FROM `{!MYSQL_PREFIX!}_refbanner` ORDER BY id"; + $SQLs[] = "SELECT id FROM `{!_MYSQL_PREFIX!}_refbanner` ORDER BY `id`"; $WHATs[] = "refbanner"; - $DESCRs[] = TASK_ADMIN_LIST_REFBANNER_ALL; - $TITLEs[] = TASK_ADMIN_LIST_REFBANNER_ALL_TITLE; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_REFBANNER_ALL'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_REFBANNER_ALL_TITLE'); // // All activated referal banner // - $SQLs[] = "SELECT id FROM `{!MYSQL_PREFIX!}_refbanner` WHERE visible='Y' ORDER BY id"; + $SQLs[] = "SELECT id FROM `{!_MYSQL_PREFIX!}_refbanner` WHERE `visible`='Y' ORDER BY `id`"; $WHATs[] = "refbanner"; - $DESCRs[] = TASK_ADMIN_LIST_REFBANNER_ACTIVE; - $TITLEs[] = TASK_ADMIN_LIST_REFBANNER_ACTIVE_TITLE; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_REFBANNER_ACTIVE'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_REFBANNER_ACTIVE_TITLE'); // // All extensions // - $SQLs[] = "SELECT id FROM `{!MYSQL_PREFIX!}_extensions` ORDER BY id"; + $SQLs[] = "SELECT id FROM `{!_MYSQL_PREFIX!}_extensions` ORDER BY `id`"; $WHATs[] = "extensions"; - $DESCRs[] = TASK_ADMIN_LIST_EXTENSIONS_ALL; - $TITLEs[] = TASK_ADMIN_LIST_EXTENSIONS_ALL_TITLE; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_EXTENSIONS_ALL'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_EXTENSIONS_ALL_TITLE'); // // All activated extensions // - $SQLs[] = "SELECT id FROM `{!MYSQL_PREFIX!}_extensions` WHERE ext_active='Y' ORDER BY id"; - $WHATs[] = "extensions&active=Y"; - $DESCRs[] = TASK_ADMIN_LIST_EXTENSIONS_ACTIVE; - $TITLEs[] = TASK_ADMIN_LIST_EXTENSIONS_ACTIVE_TITLE; + $SQLs[] = "SELECT id FROM `{!_MYSQL_PREFIX!}_extensions` WHERE ext_active='Y' ORDER BY `id`"; + $WHATs[] = "extensions&active=Y"; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_EXTENSIONS_ACTIVE'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_EXTENSIONS_ACTIVE_TITLE'); if (EXT_IS_ACTIVE("engine")) { // List all export accounts - $SQLs[] = "SELECT id FROM `{!MYSQL_PREFIX!}_engine_accounts` ORDER BY id"; - $WHATs[] = "list_engine"; - $DESCRs[] = TASK_ADMIN_LIST_ENGINE; + $SQLs[] = "SELECT id FROM `{!_MYSQL_PREFIX!}_engine_accounts` ORDER BY `id`"; + $WHATs[] = "list_engine"; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_ENGINE'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_ENGINE_TITLE'); // List all pending accounts - $SQLs[] = "SELECT id FROM `{!MYSQL_PREFIX!}_engine_accounts` WHERE status='UNCONFIRMED' ORDER BY id"; - $WHATs[] = "unlock_engine"; - $DESCRs[] = TASK_ADMIN_UNLOCK_ENGINE; + $SQLs[] = "SELECT id FROM `{!_MYSQL_PREFIX!}_engine_accounts` WHERE status='UNCONFIRMED' ORDER BY `id`"; + $WHATs[] = "unlock_engine"; + $DESCRs[] = getMessage('TASK_ADMIN_UNLOCK_ENGINE'); + $TITLEs[] = getMessage('TASK_ADMIN_UNLOCK_ENGINE_TITLE'); // List all safes - $SQLs[] = "SELECT id FROM `{!MYSQL_PREFIX!}_engine_safe` ORDER BY id"; - $WHATs[] = "list_engine&mode=safe"; - $DESCRs[] = TASK_ADMIN_LIST_ENGINE_SAFES; + $SQLs[] = "SELECT id FROM `{!_MYSQL_PREFIX!}_engine_safe` ORDER BY `id`"; + $WHATs[] = "list_engine&mode=safe"; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_ENGINE_SAFES'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_ENGINE_SAFES_TITLE'); // List all export URLs - $SQLs[] = "SELECT id FROM `{!MYSQL_PREFIX!}_engine_urls` ORDER BY id"; - $WHATs[] = "engine_urls"; - $DESCRs[] = TASK_ADMIN_LIST_ENGINE_URLS; + $SQLs[] = "SELECT id FROM `{!_MYSQL_PREFIX!}_engine_urls` ORDER BY `id`"; + $WHATs[] = "engine_urls"; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_ENGINE_URLS'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_ENGINE_URLS_TITLE'); } if (EXT_IS_ACTIVE("sponsor")) { // List all sponsors - $SQLs[] = "SELECT id FROM `{!MYSQL_PREFIX!}_sponsor_data` ORDER BY id"; + $SQLs[] = "SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_data` ORDER BY `id`"; $WHATs[] = "list_sponsor"; - $DESCRs[] = TASK_ADMIN_LIST_SPONSOR; - $TITLEs[] = TASK_ADMIN_LIST_SPONSOR_TITLE; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_SPONSOR'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_SPONSOR_TITLE'); // List confirmed sponsor accounts - $SQLs[] = "SELECT id FROM `{!MYSQL_PREFIX!}_sponsor_data` WHERE status='CONFIRMED' ORDER BY id"; + $SQLs[] = "SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE status='CONFIRMED' ORDER BY `id`"; $WHATs[] = "list_sponsor"; - $DESCRs[] = TASK_ADMIN_LIST_SPONSOR_CONFIRMED; - $TITLEs[] = TASK_ADMIN_LIST_SPONSOR_CONFIRMED_TITLE; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_SPONSOR_CONFIRMED'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_SPONSOR_CONFIRMED_TITLE'); // List unconfirmed sponsor accounts - $SQLs[] = "SELECT id FROM `{!MYSQL_PREFIX!}_sponsor_data` WHERE status='UNCONFIRMED' ORDER BY id"; + $SQLs[] = "SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE status='UNCONFIRMED' ORDER BY `id`"; $WHATs[] = "list_sponsor"; - $DESCRs[] = TASK_ADMIN_LIST_SPONSOR_UNCONFIRMED; - $TITLEs[] = TASK_ADMIN_LIST_SPONSOR_UNCONFIRMED_TITLE; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_SPONSOR_UNCONFIRMED'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_SPONSOR_UNCONFIRMED_TITLE'); // List locked sponsor accounts - $SQLs[] = "SELECT id FROM `{!MYSQL_PREFIX!}_sponsor_data` WHERE status='LOCKED' ORDER BY id"; + $SQLs[] = "SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE status='LOCKED' ORDER BY `id`"; $WHATs[] = "list_sponsor"; - $DESCRs[] = TASK_ADMIN_LIST_SPONSOR_LOCKED; - $TITLEs[] = TASK_ADMIN_LIST_SPONSOR_LOCKED_TITLE; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_SPONSOR_LOCKED'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_SPONSOR_LOCKED_TITLE'); // List waiting sponsor accounts to be approved - $SQLs[] = "SELECT id FROM `{!MYSQL_PREFIX!}_sponsor_data` WHERE status='PENDING' ORDER BY id"; + $SQLs[] = "SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE status='PENDING' ORDER BY `id`"; $WHATs[] = "unlock_sponsor"; - $DESCRs[] = TASK_ADMIN_LIST_SPONSOR_PENDING; - $TITLEs[] = TASK_ADMIN_LIST_SPONSOR_PENDING_TITLE; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_SPONSOR_PENDING'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_SPONSOR_PENDING_TITLE'); // Waiting payments - $SQLs[] = "SELECT id FROM `{!MYSQL_PREFIX!}_sponsor_orders` WHERE pay_status='PENDING' ORDER BY id"; + $SQLs[] = "SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_orders` WHERE pay_status='PENDING' ORDER BY `id`"; $WHATs[] = "list_sponsor_pays"; - $DESCRs[] = TASK_ADMIN_LIST_SPONSOR_ORDERS; - $TITLEs[] = TASK_ADMIN_LIST_SPONSOR_ORDERS_TITLE; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_SPONSOR_ORDERS'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_SPONSOR_ORDERS_TITLE'); } if (EXT_IS_ACTIVE("country")) { // List country codes - $SQLs[] = "SELECT id FROM `{!MYSQL_PREFIX!}_countries` ORDER BY id"; + $SQLs[] = "SELECT id FROM `{!_MYSQL_PREFIX!}_countries` ORDER BY `id`"; $WHATs[] = "list_country"; - $DESCRs[] = TASK_ADMIN_LIST_COUNTRY; - $TITLEs[] = TASK_ADMIN_LIST_COUNTRY_TITLE; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_COUNTRY'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_COUNTRY_TITLE'); } if (EXT_IS_ACTIVE("theme")) { // List all themes - $SQLs[] = "SELECT id FROM `{!MYSQL_PREFIX!}_themes` ORDER BY id"; + $SQLs[] = "SELECT id FROM `{!_MYSQL_PREFIX!}_themes` ORDER BY `id`"; $WHATs[] = "theme_edit"; - $DESCRs[] = TASK_ADMIN_LIST_THEME_ALL; - $TITLEs[] = TASK_ADMIN_LIST_THEME_ALL_TITLE; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_THEME_ALL'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_THEME_ALL_TITLE'); // List active themes - $SQLs[] = "SELECT id FROM `{!MYSQL_PREFIX!}_themes` WHERE theme_active='Y' ORDER BY id"; + $SQLs[] = "SELECT id FROM `{!_MYSQL_PREFIX!}_themes` WHERE theme_active='Y' ORDER BY `id`"; $WHATs[] = "theme_edit"; - $DESCRs[] = TASK_ADMIN_LIST_THEME_ACTIVE; - $TITLEs[] = TASK_ADMIN_LIST_THEME_ACTIVE_TITLE; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_THEME_ACTIVE'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_THEME_ACTIVE_TITLE'); } if (EXT_IS_ACTIVE("admins")) { // List all administrator logins - $SQLs[] = "SELECT id FROM `{!MYSQL_PREFIX!}_admins` ORDER BY id"; + $SQLs[] = "SELECT id FROM `{!_MYSQL_PREFIX!}_admins` ORDER BY `id`"; $WHATs[] = "admins_edit"; - $DESCRs[] = TASK_ADMIN_LIST_ADMINS_ALL; - $TITLEs[] = TASK_ADMIN_LIST_ADMINS_ALL_TITLE; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_ADMINS_ALL'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_ADMINS_ALL_TITLE'); } if (EXT_IS_ACTIVE("surfbar")) { // List all URLs in surfbar - $SQLs[] = "SELECT id FROM `{!MYSQL_PREFIX!}_surfbar_urls` ORDER BY id"; + $SQLs[] = "SELECT id FROM `{!_MYSQL_PREFIX!}_surfbar_urls` ORDER BY `id`"; $WHATs[] = "list_surfbar_urls"; - $DESCRs[] = TASK_ADMIN_LIST_SURFBAR_URLS_ALL; - $TITLEs[] = TASK_ADMIN_LIST_SURFBAR_URLS_ALL_TITLE; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_SURFBAR_URLS_ALL'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_SURFBAR_URLS_ALL_TITLE'); // List all pending URLs in surfbar - $SQLs[] = "SELECT id FROM `{!MYSQL_PREFIX!}_surfbar_urls` WHERE status='PENDING' ORDER BY id"; + $SQLs[] = "SELECT id FROM `{!_MYSQL_PREFIX!}_surfbar_urls` WHERE status='PENDING' ORDER BY `id`"; $WHATs[] = "unlock_surfbar_urls"; - $DESCRs[] = TASK_ADMIN_LIST_SURFBAR_URLS_PENDING; - $TITLEs[] = TASK_ADMIN_LIST_SURFBAR_URLS_PENDING_TITLE; + $DESCRs[] = getMessage('TASK_ADMIN_LIST_SURFBAR_URLS_PENDING'); + $TITLEs[] = getMessage('TASK_ADMIN_LIST_SURFBAR_URLS_PENDING_TITLE'); } // Generate extra overview rows @@ -534,7 +538,7 @@ ORDER BY beg_points DESC, userid"; } // -function TASK_CREATE_EXTRA_ROWS($SQLs, $WHATs, $DESCRs, $TITLEs){ +function TASK_CREATE_EXTRA_ROWS ($SQLs, $WHATs, $DESCRs, $TITLEs) { // Init $OUT = ""; $SW = 2; $MAX = sizeof($SQLs) - 1; foreach ($SQLs as $key => $sql) { @@ -555,8 +559,8 @@ function TASK_CREATE_EXTRA_ROWS($SQLs, $WHATs, $DESCRs, $TITLEs){ if ($key < $MAX) $content['bottom'] = "bottom2"; if (($value > 0) && (!empty($WHATs[$key]))) { - if (empty($TITLEs[$key])) $TITLEs[$key] = TASK_ADMIN_UNKNOWN_LIST_TITLE; - $content['row_link'] = "".$value.""; + if (empty($TITLEs[$key])) $TITLEs[$key] = getMessage('TASK_ADMIN_UNKNOWN_LIST_TITLE'); + $content['row_link'] = "".$value.""; } else { $content['row_link'] = 0; } diff --git a/inc/libs/theme_functions.php b/inc/libs/theme_functions.php index 92a2a47ac4..61b32431eb 100644 --- a/inc/libs/theme_functions.php +++ b/inc/libs/theme_functions.php @@ -39,7 +39,7 @@ if (!defined('__SECURITY')) { function THEME_SELECTION_BOX($mod, $act, $wht, $result) { // Construction URL - $FORM = URL."/modules.php?module=".$mod; + $FORM = "{!URL!}/modules.php?module=".$mod; if (!empty($act)) $FORM .= "&action=".$act; if (!empty($wht)) $FORM .= "&what=".$wht; define('__FORM_VALUE', $FORM); @@ -51,7 +51,7 @@ function THEME_SELECTION_BOX($mod, $act, $wht, $result) { ); // Load all themes - while(list($theme) = SQL_FETCHROW($result)) { + while (list($theme) = SQL_FETCHROW($result)) { // Load it's theme.php file $INC = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($theme)); if (FILE_READABLE($INC)) { @@ -101,7 +101,7 @@ function THEME_GET_VERSION ($name) { incrementConfigEntry('cache_hits'); } elseif (GET_EXT_VERSION("cache") != "0.1.8") { // Load version from database - $result = SQL_QUERY_ESC("SELECT theme_ver FROM `{!MYSQL_PREFIX!}_themes` WHERE theme_path='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT theme_ver FROM `{!_MYSQL_PREFIX!}_themes` WHERE theme_path='%s' LIMIT 1", array($name), __FILE__, __LINE__); // Entry found? @@ -146,7 +146,7 @@ function THEME_IS_ACTIVE ($name) { incrementConfigEntry('cache_hits'); } elseif (GET_EXT_VERSION("cache") != "0.1.8") { // Check if current theme is already imported or not - $result = SQL_QUERY_ESC("SELECT theme_active FROM `{!MYSQL_PREFIX!}_themes` WHERE theme_path='%s' AND theme_active='Y' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT theme_active FROM `{!_MYSQL_PREFIX!}_themes` WHERE theme_path='%s' AND theme_active='Y' LIMIT 1", array($name), __FILE__, __LINE__); // Is the theme active and installed? @@ -182,7 +182,7 @@ function GET_CURR_THEME_NAME () { incrementConfigEntry('cache_hits'); } elseif (GET_EXT_VERSION("cache") != "0.1.8") { // Check if current theme is already imported or not - $result = SQL_QUERY_ESC("SELECT theme_name FROM `{!MYSQL_PREFIX!}_themes` WHERE theme_path='%s' AND theme_active='Y' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT theme_name FROM `{!_MYSQL_PREFIX!}_themes` WHERE theme_path='%s' AND theme_active='Y' LIMIT 1", array($name), __FILE__, __LINE__); // Load theme name diff --git a/inc/libs/transfer_functions.php b/inc/libs/transfer_functions.php index ce94a35246..48fccd8de3 100644 --- a/inc/libs/transfer_functions.php +++ b/inc/libs/transfer_functions.php @@ -40,31 +40,31 @@ if (!defined('__SECURITY')) { // function TRANSFER_AUTPPURGE($max, $age) { // First get total in-going lines - $result = SQL_QUERY("SELECT id FROM `{!MYSQL_PREFIX!}_user_transfers_in` ORDER BY id", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_user_transfers_in` ORDER BY `id`", __FILE__, __LINE__); if (SQL_NUMROWS($result) > $max) { // Update overdue transfers $remove = SQL_NUMROWS($result) - $max; // This will make it really old, so the final removal query will find it - $result = SQL_QUERY("UPDATE `{!MYSQL_PREFIX!}_user_transfers_in` SET time_trans='0' ORDER BY id LIMIT ".$remove, __FILE__, __LINE__); + $result = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_user_transfers_in` SET time_trans='0' ORDER BY `id` LIMIT ".$remove, __FILE__, __LINE__); } // Second get total out-going lines - $result = SQL_QUERY("SELECT id FROM `{!MYSQL_PREFIX!}_user_transfers_out` ORDER BY id", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_user_transfers_out` ORDER BY `id`", __FILE__, __LINE__); if (SQL_NUMROWS($result) > $max) { // Update overdue transfers $remove = SQL_NUMROWS($result) - $max; // This will make it really old, so the final removal query will find it - $result = SQL_QUERY("UPDATE `{!MYSQL_PREFIX!}_user_transfers_out` SET time_trans='0' ORDER BY id LIMIT ".$remove, __FILE__, __LINE__); + $result = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_user_transfers_out` SET time_trans='0' ORDER BY `id` LIMIT ".$remove, __FILE__, __LINE__); } // Remove old in-going transfers - $result = SQL_QUERY("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_user_transfers_in` WHERE time_trans < (UNIX_TIMESTAMP() - ".$age.")", __FILE__, __LINE__); + $result = SQL_QUERY("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_transfers_in` WHERE time_trans < (UNIX_TIMESTAMP() - ".$age.")", __FILE__, __LINE__); $REMOVE = SQL_AFFECTEDROWS(); // Remove old out-going transfers - $result = SQL_QUERY("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_user_transfers_out` WHERE time_trans < (UNIX_TIMESTAMP() - ".$age.")", __FILE__, __LINE__); + $result = SQL_QUERY("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_transfers_out` WHERE time_trans < (UNIX_TIMESTAMP() - ".$age.")", __FILE__, __LINE__); $REMOVE += SQL_AFFECTEDROWS(); // Only send email to admin(s) when we have removed entries diff --git a/inc/libs/user_functions.php b/inc/libs/user_functions.php index c1b19229e7..0e37d985be 100644 --- a/inc/libs/user_functions.php +++ b/inc/libs/user_functions.php @@ -54,7 +54,7 @@ function alpha ($sortby, $colspan, $return=false) { $OUT .= "".$ltr.""; } else { // Output link to letter - $OUT .= "".$ltr.""; } @@ -112,7 +112,7 @@ function SortLinks($letter, $sortby, $colspan, $return=false) { if ($sortby == $sort) { $OUT .= "".$title." | "; } else { - $OUT .= "".$title." | "; + $OUT .= "".$title." | "; } } // END - foreach @@ -156,7 +156,7 @@ function ADD_PAGENAV($PAGES, $offset, $show_form, $colspan,$return=false) { if (empty($_GET['sortby'])) $_GET['sortby'] = "userid"; // Base link - $OUT .= "= %s ORDER BY `rand_confirmed` DESC LIMIT %s, 1", + $result = SQL_QUERY_ESC("SELECT `userid` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `status`='CONFIRMED' AND `rand_confirmed` >= %s ORDER BY `rand_confirmed` DESC LIMIT %s, 1", array(getConfig('user_min_confirmed'), $randNum), __FILE__, __LINE__); // Do we have one entry there? @@ -244,7 +244,7 @@ function SELECT_RANDOM_REFID () { list($refid) = SQL_FETCHROW($result); // Reset this user's counter - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET `rand_confirmed`=0 WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `rand_confirmed`=0 WHERE userid=%s LIMIT 1", array($refid), __FILE__, __LINE__); } // END - if @@ -269,13 +269,13 @@ function USER_DO_LOGIN ($uid, $passwd) { $password = ""; $uid2 = ""; $dmy = ""; $online = 0; $login = 0; if ((EXT_IS_ACTIVE("nickname")) && (NICKNAME_PROBE_ON_USERID($uid))) { // Nickname entered - $result = SQL_QUERY_ESC("SELECT userid, password, last_online".$LAST." FROM `{!MYSQL_PREFIX!}_user_data` WHERE nickname='%s' AND status='CONFIRMED' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT userid, password, last_online".$LAST." FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' AND status='CONFIRMED' LIMIT 1", array($uid), __FILE__, __LINE__); list($uid2, $password, $online, $login) = SQL_FETCHROW($result); if (!empty($uid2)) $uid = bigintval($uid2); } else { // Direct userid entered - $result = SQL_QUERY_ESC("SELECT userid, password, last_online".$LAST." FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s AND status='CONFIRMED' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT userid, password, last_online".$LAST." FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND status='CONFIRMED' LIMIT 1", array($uid, $hash), __FILE__, __LINE__); list($uid2, $password, $online, $login) = SQL_FETCHROW($result); } @@ -302,7 +302,7 @@ function USER_DO_LOGIN ($uid, $passwd) { $hash = generateHash($passwd); // ... and update database - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET password='%s' WHERE userid=%s AND status='CONFIRMED' LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET password='%s' WHERE userid=%s AND status='CONFIRMED' LIMIT 1", array($hash, $uid), __FILE__, __LINE__); // No login bonus by default @@ -336,7 +336,7 @@ function USER_DO_LOGIN ($uid, $passwd) { // Try to set session data (which shall normally always work!) if ((set_session('userid', $uid )) && (set_session('u_hash', $hash))) { // Update database records - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET total_logins=total_logins+1".$ADD." WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET total_logins=total_logins+1".$ADD." WHERE userid=%s LIMIT 1", array($uid), __FILE__, __LINE__); if (SQL_AFFECTEDROWS() == 1) { // Procedure to checking for login data @@ -357,7 +357,7 @@ function USER_DO_LOGIN ($uid, $passwd) { } } elseif (GET_EXT_VERSION("sql_patches") >= "0.6.1") { // Update failture counter - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET login_failures=login_failures+1,last_failure=NOW() WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET login_failures=login_failures+1,last_failure=NOW() WHERE userid=%s LIMIT 1", array($uid), __FILE__, __LINE__); // Wrong password! @@ -366,7 +366,7 @@ function USER_DO_LOGIN ($uid, $passwd) { } elseif ((($probe_nickname) && (!empty($uid2))) || ($uid2 == $uid)) { // Other account status? // @TODO Can this query be merged with above query? - $result = SQL_QUERY_ESC("SELECT status FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT status FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($uid), __FILE__, __LINE__); // Entry found? @@ -404,15 +404,15 @@ function USER_DO_NEW_PASSWORD ($email, $uid) { // Probe userid/nickname if ((EXT_IS_ACTIVE("nickname")) && (NICKNAME_PROBE_ON_USERID($uid))) { // Nickname entered - $result = SQL_QUERY_ESC("SELECT userid, status FROM `{!MYSQL_PREFIX!}_user_data` WHERE nickname='%s' OR email='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT userid, status FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' OR email='%s' LIMIT 1", array($uid, $email), __FILE__, __LINE__); } elseif (($uid > 0) && (empty($email))) { // Direct userid entered - $result = SQL_QUERY_ESC("SELECT userid, status FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT userid, status FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); } elseif (!empty($email)) { // Email entered - $result = SQL_QUERY_ESC("SELECT userid, status FROM `{!MYSQL_PREFIX!}_user_data` WHERE email='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT userid, status FROM `{!_MYSQL_PREFIX!}_user_data` WHERE email='%s' LIMIT 1", array($email), __FILE__, __LINE__); } else { // Userid not set! @@ -428,17 +428,17 @@ function USER_DO_NEW_PASSWORD ($email, $uid) { if ($status == "CONFIRMED") { // Ooppps, this was missing! ;-) We should update the database... $NEW_PASS = GEN_PASS(); - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET password='%s' WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET password='%s' WHERE userid=%s LIMIT 1", array(generateHash($NEW_PASS), $uid), __FILE__, __LINE__); // Prepare data and message for email $msg = LOAD_EMAIL_TEMPLATE("new-pass", array('new_pass' => $NEW_PASS), $uid); // ... and send it away - SEND_EMAIL($uid, GUEST_NEW_PASSWORD, $msg); + SEND_EMAIL($uid, getMessage('GUEST_NEW_PASSWORD'), $msg); // Output note to user - LOAD_TEMPLATE("admin_settings_saved", false, GUEST_NEW_PASSWORD_SEND); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('GUEST_NEW_PASSWORD_SEND')); } else { // Account is locked or unconfirmed $ERROR = GEN_ERROR_CODE_FROM_ACCOUNT_STATUS($status); diff --git a/inc/libs/wernis_functions.php b/inc/libs/wernis_functions.php index ee1bb275ca..0fbc50f3fa 100644 --- a/inc/libs/wernis_functions.php +++ b/inc/libs/wernis_functions.php @@ -326,7 +326,7 @@ function WERNIS_TRANSFER_STATUS ($status) { // Log the transfer function WERNIS_LOG_TRANSFER ($wdsId, $amount, $type = 'FAILED', $message = "", $status = "") { // Register this wernis movement - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_user_wernis` (`userid`, `wernis_account`, `wernis_amount`, `wernis_timestamp`, `wernis_type`, `wernis_api_message`, `wernis_api_status`) VALUES (%d, %d, %d, UNIX_TIMESTAMP(), '%s', '%s', '%s')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_wernis` (`userid`, `wernis_account`, `wernis_amount`, `wernis_timestamp`, `wernis_type`, `wernis_api_message`, `wernis_api_status`) VALUES (%d, %d, %d, UNIX_TIMESTAMP(), '%s', '%s', '%s')", array($GLOBALS['userid'], bigintval($wdsId), bigintval($amount), $type, $message, $status), __FILE__, __LINE__); } diff --git a/inc/libs/yoomedia_functions.php b/inc/libs/yoomedia_functions.php index 49a45d16fa..08334e4ef3 100644 --- a/inc/libs/yoomedia_functions.php +++ b/inc/libs/yoomedia_functions.php @@ -242,7 +242,7 @@ function YOOMEDIA_EXCLUDE_MAIL ($data, $mode) { $mode = YOOMEDIA_CONVERT_MODE($mode); // Add the entry - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_yoomedia_reload` (`type`,`y_id`,`y_reload`,`inserted`) VALUES ('%s',%s,%s,'0000-00-00 00:00')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_yoomedia_reload` (`type`,`y_id`,`y_reload`,`inserted`) VALUES ('%s',%s,%s,'0000-00-00 00:00')", array($mode, bigintval($data['id']), bigintval($data['reload'])), __FILE__, __LINE__); } // END - if } @@ -253,7 +253,7 @@ function YOOMEDIA_UNLIST_MAIL ($data, $mode) { $mode = YOOMEDIA_CONVERT_MODE($mode); // Add the entry - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_yoomedia_reload` WHERE `type`='%s' AND `y_id`=%s LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_yoomedia_reload` WHERE `type`='%s' AND `y_id`=%s LIMIT 1", array($mode, bigintval($data['id'])), __FILE__, __LINE__); } @@ -303,7 +303,7 @@ function YOOMEDIA_CHECK_RELOAD ($id, $reload, $type) { $reloaded = false; // Query database - $result = SQL_QUERY_ESC("SELECT `id`, UNIX_TIMESTAMP(`inserted`) AS inserted FROM `{!MYSQL_PREFIX!}_yoomedia_reload` WHERE `type`='%s' AND `y_id`=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT `id`, UNIX_TIMESTAMP(`inserted`) AS inserted FROM `{!_MYSQL_PREFIX!}_yoomedia_reload` WHERE `type`='%s' AND `y_id`=%s LIMIT 1", array($type, bigintval($id)), __FILE__, __LINE__); // Entry found? @@ -314,7 +314,7 @@ function YOOMEDIA_CHECK_RELOAD ($id, $reload, $type) { // Are we ready to sent again? if (((time() - $time) >= ($reload * 60*60)) && ($time > 0)) { // Remove entry - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_yoomedia_reload` WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_yoomedia_reload` WHERE id=%s LIMIT 1", array($id), __FILE__, __LINE__); } else { // Dont' sent again this mail @@ -337,7 +337,7 @@ function YOOMEDIA_RELOAD_LOCK ($data, $mode) { $mode = YOOMEDIA_CONVERT_MODE($mode); // Add the entry - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_yoomedia_reload` (`type`,`y_id`,`y_reload`) VALUES ('%s',%s,%s)", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_yoomedia_reload` (`type`,`y_id`,`y_reload`) VALUES ('%s',%s,%s)", array($mode, bigintval($data['id']), bigintval($data['reload'])), __FILE__, __LINE__); } // END - if } diff --git a/inc/load_extensions.php b/inc/load_extensions.php index 4830affddf..c033051562 100644 --- a/inc/load_extensions.php +++ b/inc/load_extensions.php @@ -176,12 +176,12 @@ if ($cacheMode == "load") { if (GET_EXT_VERSION("sql_patches") >= "0.0.6") { // Query with CSS file from DB $res_ext_crt = SQL_QUERY("SELECT id AS ext_id, ext_name, ext_has_css AS ext_css, ext_active, ext_version -FROM `{!MYSQL_PREFIX!}_extensions`".$ADD." +FROM `{!_MYSQL_PREFIX!}_extensions`".$ADD." ORDER BY ext_name", __FILE__, __LINE__); } else { // Old obsolete query string $res_ext_crt = SQL_QUERY("SELECT id AS ext_id, ext_name, ext_name, ext_active, ext_version -FROM `{!MYSQL_PREFIX!}_extensions`".$ADD." +FROM `{!_MYSQL_PREFIX!}_extensions`".$ADD." ORDER BY ext_name", __FILE__, __LINE__); } } @@ -278,11 +278,11 @@ if (!empty($DEL[0])) { // Remove extensions from two tables: extension registry and tasks table foreach ($DEL as $del_ext) { // First remove entry from extensions table - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_extensions` WHERE ext_name='%s' LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_extensions` WHERE ext_name='%s' LIMIT 1", array($del_ext), __FILE__, __LINE__); // Remove (maybe?) found tasks (main task and possible updates - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_task_system` WHERE subject='[%s:]' AND (task_type='EXTENSION' OR task_type='EXTENSION_UPDATE')", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_task_system` WHERE subject='[%s:]' AND (task_type='EXTENSION' OR task_type='EXTENSION_UPDATE')", array($del_ext), __FILE__, __LINE__); } // END - foreach diff --git a/inc/loader/load_cache-admin.php b/inc/loader/load_cache-admin.php index 7e2a91baff..5f240f5526 100644 --- a/inc/loader/load_cache-admin.php +++ b/inc/loader/load_cache-admin.php @@ -93,7 +93,7 @@ if (($cacheInstance->loadCacheFile("admins")) && ($cacheInstance->extensionVersi // Query the database about this $result_admins = SQL_QUERY("SELECT id AS aid, login, password, email".$ADD." -FROM `{!MYSQL_PREFIX!}_admins` +FROM `{!_MYSQL_PREFIX!}_admins` ORDER BY login", __FILE__, __LINE__); while($dummy = SQL_FETCHARRAY($result_admins)) { // Save row @@ -123,7 +123,7 @@ if (GET_EXT_VERSION("admins") >= "0.3") { $cacheInstance->storeExtensionVersion("admins"); // Load all modules and their data - $result = SQL_QUERY("SELECT id, admin_id, action_menu, what_menu, access_mode FROM `{!MYSQL_PREFIX!}_admins_acls` ORDER BY admin_id, action_menu, what_menu", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id, admin_id, action_menu, what_menu, access_mode FROM `{!_MYSQL_PREFIX!}_admins_acls` ORDER BY admin_id, action_menu, what_menu", __FILE__, __LINE__); // Add all rows while ($data = SQL_FETCHARRAY($result)) { diff --git a/inc/loader/load_cache-config.php b/inc/loader/load_cache-config.php index 97668f2444..133a6dcbef 100644 --- a/inc/loader/load_cache-config.php +++ b/inc/loader/load_cache-config.php @@ -53,7 +53,7 @@ if (($cacheInstance->loadCacheFile("config", true)) && ($cacheInstance->extensio $cacheInstance->storeExtensionVersion("sql_patches"); // Load all modules and their data - $result = SQL_QUERY("SELECT * FROM `{!MYSQL_PREFIX!}_config` ORDER BY config ASC", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT * FROM `{!_MYSQL_PREFIX!}_config` ORDER BY config ASC", __FILE__, __LINE__); while ($data = SQL_FETCHARRAY($result)) { // Add row to cache file $cacheInstance->addRow($data); diff --git a/inc/loader/load_cache-modreg.php b/inc/loader/load_cache-modreg.php index 351550fee5..b6eb02a2da 100644 --- a/inc/loader/load_cache-modreg.php +++ b/inc/loader/load_cache-modreg.php @@ -76,11 +76,11 @@ if (($cacheInstance->loadCacheFile("mod_reg")) && ($cacheInstance->extensionVers if (GET_EXT_VERSION("sql_patches") >= "0.3.6") { // Load has_menu $result = SQL_QUERY("SELECT id, module, title, locked, hidden, admin_only, title, mem_only, has_menu -FROM `{!MYSQL_PREFIX!}_mod_reg` ORDER BY id", __FILE__, __LINE__); +FROM `{!_MYSQL_PREFIX!}_mod_reg` ORDER BY `id`", __FILE__, __LINE__); } else { // Don't load has_menu $result = SQL_QUERY("SELECT id, module, title, locked, hidden, admin_only, title, mem_only -FROM `{!MYSQL_PREFIX!}_mod_reg` ORDER BY id", __FILE__, __LINE__); +FROM `{!_MYSQL_PREFIX!}_mod_reg` ORDER BY `id`", __FILE__, __LINE__); } // Cache all data diff --git a/inc/loader/load_cache-refdepths.php b/inc/loader/load_cache-refdepths.php index f6bcbd0cbc..208d8825ad 100644 --- a/inc/loader/load_cache-refdepths.php +++ b/inc/loader/load_cache-refdepths.php @@ -51,7 +51,7 @@ if (($cacheInstance->loadCacheFile("refdepths")) && ($cacheInstance->extensionVe $cacheInstance->storeExtensionVersion("sql_patches"); // Load all modules and their data - $result = SQL_QUERY("SELECT id, level, percents FROM `{!MYSQL_PREFIX!}_refdepths` ORDER BY level", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id, level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` ORDER BY level", __FILE__, __LINE__); while ($data = SQL_FETCHARRAY($result)) { // Add row to cache file $cacheInstance->addRow($data); diff --git a/inc/loader/load_cache-refsystem.php b/inc/loader/load_cache-refsystem.php index 5a34d05e76..87dce53986 100644 --- a/inc/loader/load_cache-refsystem.php +++ b/inc/loader/load_cache-refsystem.php @@ -51,7 +51,7 @@ if (($cacheInstance->loadCacheFile("refsystem")) && ($cacheInstance->extensionVe $cacheInstance->storeExtensionVersion("sql_patches"); // Load all modules and their data - $result = SQL_QUERY("SELECT id, userid, level, counter FROM `{!MYSQL_PREFIX!}_refsystem` ORDER BY userid, level", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id, userid, level, counter FROM `{!_MYSQL_PREFIX!}_refsystem` ORDER BY userid, level", __FILE__, __LINE__); while ($data = SQL_FETCHARRAY($result)) { // Add row to cache file $cacheInstance->addRow($data); diff --git a/inc/loader/load_cache-them.php b/inc/loader/load_cache-them.php index 18781a48e4..c516fe9c9d 100644 --- a/inc/loader/load_cache-them.php +++ b/inc/loader/load_cache-them.php @@ -75,9 +75,9 @@ if (($cacheInstance->loadCacheFile("themes")) && ($cacheInstance->extensionVersi // Load all themes and their data if (GET_EXT_VERSION("theme") >= "0.0.7") { - $result = SQL_QUERY("SELECT id, theme_path, theme_active, theme_ver, theme_name FROM `{!MYSQL_PREFIX!}_themes` ORDER BY id", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id, theme_path, theme_active, theme_ver, theme_name FROM `{!_MYSQL_PREFIX!}_themes` ORDER BY `id`", __FILE__, __LINE__); } else { - $result = SQL_QUERY("SELECT id, theme_path, theme_active, theme_ver FROM `{!MYSQL_PREFIX!}_themes` ORDER BY id", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id, theme_path, theme_active, theme_ver FROM `{!_MYSQL_PREFIX!}_themes` ORDER BY `id`", __FILE__, __LINE__); } while ($data = SQL_FETCHARRAY($result)) { // Add row to cache file diff --git a/inc/mails/beg_mails.php b/inc/mails/beg_mails.php index defa215d44..f0aa99ed67 100644 --- a/inc/mails/beg_mails.php +++ b/inc/mails/beg_mails.php @@ -48,7 +48,7 @@ $mark = mktime(0, 0, 0, getConfig('last_month'), date("d", time()), date('Y', ti $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 @@ -113,9 +113,9 @@ if (!empty($SQL)) { $RECEIVER = ""; $UIDs = array(); // Okay lets notify all users! - while(list($uid, $email) = SQL_FETCHROW($result_main)) { + while (list($uid, $email) = SQL_FETCHROW($result_main)) { // Update account - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET beg_ral_notify='%s', beg_ral_%s_notify='%s' WHERE userid=%s LIMIT 1", diff --git a/inc/mails/birthday_mails.php b/inc/mails/birthday_mails.php index 0a69e1c09e..be67b650fd 100644 --- a/inc/mails/birthday_mails.php +++ b/inc/mails/birthday_mails.php @@ -57,7 +57,7 @@ if ((getConfig('birthday_active')) && (EXT_IS_ACTIVE("autopurge")) && (getConfig // Only confirmed members shall receive birthday mails... $result_birthday = SQL_QUERY_ESC("SELECT userid, email, birth_year -FROM `{!MYSQL_PREFIX!}_user_data` +FROM `{!_MYSQL_PREFIX!}_user_data` WHERE status='CONFIRMED' AND birth_day=%s AND birth_month=%s AND birthday_sent < (UNIX_TIMESTAMP() - ".(getConfig('one_day') * 364).")".$ADD." ORDER BY userid", array($DAY, $MONTH, $VALUE), __FILE__, __LINE__); @@ -85,7 +85,7 @@ if (SQL_NUMROWS($result_birthday) > 0) { } // Insert row into database - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_user_birthday` (userid, points, chk_value) VALUES ('%s','%s','%s' )", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_birthday` (userid, points, chk_value) VALUES ('%s','%s','%s' )", array(bigintval($uid), getConfig('birthday_points'), $content['check']), __FILE__, __LINE__); // Load email template with confirmation link @@ -99,7 +99,7 @@ if (SQL_NUMROWS($result_birthday) > 0) { SEND_EMAIL($uid, HAPPY_BIRTHDAY, $msg); // Remember him that he has received a birthday mail - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET birthday_sent=UNIX_TIMESTAMP() WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET birthday_sent=UNIX_TIMESTAMP() WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); } diff --git a/inc/mails/bonus_mails.php b/inc/mails/bonus_mails.php index e565d624e5..48590a115c 100644 --- a/inc/mails/bonus_mails.php +++ b/inc/mails/bonus_mails.php @@ -48,7 +48,7 @@ $mark = mktime(0, 0, 0, getConfig('last_month'), date("d", time()), date('Y', ti $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 @@ -92,9 +92,9 @@ if (!empty($SQL)) { $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)) { + while (list($uid, $email) = SQL_FETCHROW($result_main)) { // Update account - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET bonus_ral_notify='%s', bonus_ral_%s_notify='%s' WHERE userid=%s LIMIT 1", diff --git a/inc/modules/admin.php b/inc/modules/admin.php index 0635460a52..fec5cc9fc5 100644 --- a/inc/modules/admin.php +++ b/inc/modules/admin.php @@ -170,7 +170,7 @@ if (!isBooleanConstantAndTrue('admin_registered')) { LOAD_TEMPLATE("admin_reset_password_form", false, $content); } else { // Cannot validate the login data and hash - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_VALIDATION_RESET_LOGIN_HASH_FAILED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_VALIDATION_RESET_LOGIN_HASH_FAILED')); } } elseif ((isset($_POST['reset_pass'])) && (!empty($_POST['hash'])) && (!empty($_POST['login'])) && (!empty($_POST['pass1'])) && ($_POST['pass1'] == $_POST['pass2'])) { // Okay, we shall the admin password here. So first revalidate the hash @@ -182,7 +182,7 @@ if (!isBooleanConstantAndTrue('admin_registered')) { LOAD_TEMPLATE("admin_reset_pass_done", false, $OUT); } else { // Validation failed - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_VALIDATION_RESET_LOGIN_HASH_FAILED2); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_VALIDATION_RESET_LOGIN_HASH_FAILED2')); } } else { // Output reset password form @@ -197,7 +197,7 @@ if (!isBooleanConstantAndTrue('admin_registered')) { if (!empty($_GET['register'])) { // Registration of first admin is done - if ($_GET['register'] == "done") LOAD_TEMPLATE("admin_settings_saved", false, "
    ".ADMIN_REGISTER_DONE."
    "); + if ($_GET['register'] == "done") LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_REGISTER_DONE')); } // END - if // Check if the admin has submitted data or not @@ -229,13 +229,13 @@ if (!isBooleanConstantAndTrue('admin_registered')) { case "404": // Administrator login not found $_POST['ok'] = $ret; - $ret = ADMIN_NOT_FOUND; + $ret = getMessage('ADMIN_NOT_FOUND'); DESTROY_ADMIN_SESSION(); break; case "pass": // Wrong password $_POST['ok'] = $ret; - $ret = WRONG_PASS." [
    ".ADMIN_RESET_PASS."]\n"; + $ret = "{!WRONG_PASS!} [{!ADMIN_RESET_PASS!}]\n"; DESTROY_ADMIN_SESSION(); break; diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 39e47d68e6..75f66ff5b2 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -43,13 +43,13 @@ function REGISTER_ADMIN ($user, $md5, $email=WEBMASTER) { $ret = "already"; // Lookup the user - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_admins` WHERE login='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admins` WHERE login='%s' LIMIT 1", array($user), __FILE__, __LINE__); // Is the entry there? if (SQL_NUMROWS($result) == 0) { // Ok, let's create the admin login - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_admins` (login, password, email) VALUES ('%s', '%s', '%s')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_admins` (login, password, email) VALUES ('%s', '%s', '%s')", array($user, $md5, $email), __FILE__, __LINE__); $ret = "done"; } // END - if @@ -91,7 +91,7 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) { $ADD = RUN_FILTER('sql_admin_extra_data'); // Get password from DB - $result = SQL_QUERY_ESC("SELECT password".$ADD." FROM `{!MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT password".$ADD." FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", array($aid), __FILE__, __LINE__); // Entry found? @@ -140,11 +140,11 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) { set_session('mxchange_admin_last_fail', $data['last_failure']); // Update password and reset login failures - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_admins` SET password='%s',login_failures=0,last_failure='0000-00-00 00:00:00' WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins` SET password='%s',login_failures=0,last_failure='0000-00-00 00:00:00' WHERE id=%s LIMIT 1", array($data['password'], $aid), __FILE__, __LINE__); } else { // Update password - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_admins` SET password='%s' WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins` SET password='%s' WHERE id=%s LIMIT 1", array($data['password'], $aid), __FILE__, __LINE__); } @@ -173,7 +173,7 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) { // Count login failure if admins extension version is 0.7.0+ if (($ret == "pass") && (GET_EXT_VERSION("admins") >= "0.7.0")) { // Update counter - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_admins` SET login_failures=login_failures+1,last_failure=NOW() WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins` SET login_failures=login_failures+1,last_failure=NOW() WHERE id=%s LIMIT 1", array($aid), __FILE__, __LINE__); // Rebuild cache @@ -192,7 +192,7 @@ function LOGIN_ADMIN ($adminLogin, $passHash) { // Reset failure counter on matching admins version if ((GET_EXT_VERSION("admins") >= "0.7.0") && ((EXT_VERSION_IS_OLDER("sql_patches", "0.3.6")) || (GET_EXT_VERSION("sql_patches") == ""))) { // Reset counter on out-dated sql_patches version - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_admins` SET login_failures=0,last_failure='0000-00-00 00:00:00' WHERE login='%s' LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins` SET login_failures=0,last_failure='0000-00-00 00:00:00' WHERE login='%s' LIMIT 1", array($adminLogin), __FILE__, __LINE__); // Rebuild cache @@ -343,8 +343,8 @@ function ADMIN_DO_ACTION($wht) { LOAD_TEMPLATE("admin_main_header"); // Check if action/what pair is valid - $result_action = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_admin_menu` -WHERE action='%s' AND ((what='%s' AND what != 'overview') OR ((what='' OR what IS NULL) AND '%s'='overview')) + $result_action = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admin_menu` +WHERE action='%s' AND ((what='%s' AND what != 'overview') OR ((what='' OR `what` IS NULL) AND '%s'='overview')) LIMIT 1", array($act, $wht, $wht), __FILE__, __LINE__); if (SQL_NUMROWS($result_action) == 1) { @@ -355,16 +355,16 @@ LIMIT 1", array($act, $wht, $wht), __FILE__, __LINE__); require($INC); } elseif (__ACL_ALLOW == false) { // Access denied - LOAD_TEMPLATE("admin_menu_failed", false, ADMIN_ACCESS_DENIED); - addFatalMessage(ADMIN_ACCESS_DENIED); + LOAD_TEMPLATE("admin_menu_failed", false, getMessage('ADMIN_ACCESS_DENIED')); + addFatalMessage(getMessage('ADMIN_ACCESS_DENIED')); } else { // Include file not found! :-( - LOAD_TEMPLATE("admin_menu_failed", false, ADMIN_404_ACTION); + LOAD_TEMPLATE("admin_menu_failed", false, getMessage('ADMIN_404_ACTION')); addFatalMessage(ADMIN_404_ACTION_1.$act.ADMIN_404_ACTION_2); } } else { // Invalid action/what pair found! - LOAD_TEMPLATE("admin_menu_failed", false, ADMIN_INVALID_ACTION); + LOAD_TEMPLATE("admin_menu_failed", false, getMessage('ADMIN_INVALID_ACTION')); addFatalMessage(ADMIN_INVALID_ACTION_1.$act."/".$wht.ADMIN_INVALID_ACTION_2); } @@ -411,7 +411,7 @@ function ADD_ADMIN_MENU($act, $wht, $return=false) { } // END - if // Build main menu - $result_main = SQL_QUERY("SELECT action, title, descr FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE (what='' OR what IS NULL) ORDER BY sort, id DESC", __FILE__, __LINE__); + $result_main = SQL_QUERY("SELECT action, title, descr FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE (what='' OR `what` IS NULL) ORDER BY `sort`, id DESC", __FILE__, __LINE__); if (SQL_NUMROWS($result_main) > 0) { $OUT = " @@ -444,7 +444,7 @@ function ADD_ADMIN_MENU($act, $wht, $return=false) { } else { - $OUT .= "["; + $OUT .= "["; } $OUT .= $title; if (($menu == $act) && (empty($wht))) @@ -457,8 +457,8 @@ function ADD_ADMIN_MENU($act, $wht, $return=false) { } $OUT .= " \n"; - $result_what = SQL_QUERY_ESC("SELECT what, title, descr FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort, id DESC", - array($menu), __FILE__, __LINE__); + $result_what = SQL_QUERY_ESC("SELECT what, title, descr FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`, id DESC", + array($menu), __FILE__, __LINE__); if ((SQL_NUMROWS($result_what) > 0) && ($act == $menu)) { $menuDesription = array(); @@ -492,7 +492,7 @@ function ADD_ADMIN_MENU($act, $wht, $return=false) { } else { - $OUT .= "["; + $OUT .= "["; } } else @@ -570,7 +570,7 @@ function ADD_ADMIN_MENU($act, $wht, $return=false) { function ADD_MEMBER_SELECTION_BOX ($def="0", $add_all=false, $return=false, $none=false, $field="userid") { // Output selection form with all confirmed user accounts listed - $result = SQL_QUERY("SELECT userid, surname, family FROM `{!MYSQL_PREFIX!}_user_data` ORDER BY userid", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT userid, surname, family FROM `{!_MYSQL_PREFIX!}_user_data` ORDER BY userid", __FILE__, __LINE__); $OUT = ""; // USe this only for adding points (e.g. adding refs really makes no sence ;-) ) @@ -602,9 +602,9 @@ function ADD_MEMBER_SELECTION_BOX ($def="0", $add_all=false, $return=false, $non } // function ADMIN_MENU_SELECTION($MODE, $default="", $defid="") { - $wht = "what != ''"; - if ($MODE == "action") $wht = "(what='' OR what IS NULL) AND action !='login'"; - $result = SQL_QUERY_ESC("SELECT %s, title FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE ".$wht." ORDER BY sort", + $wht = "`what` != ''"; + if ($MODE == "action") $wht = "(what='' OR `what` IS NULL) AND action !='login'"; + $result = SQL_QUERY_ESC("SELECT %s, title FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE ".$wht." ORDER BY `sort`", array($MODE), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Load menu as selection @@ -676,9 +676,9 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName="_config", $whereStatement="con $result = false; if (!$alwaysAdd) { if (!empty($whereStatement)) { - $result = SQL_QUERY("SELECT * FROM `"._MYSQL_PREFIX.$tableName."` WHERE ".$whereStatement." LIMIT 1", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT * FROM `{!_MYSQL_PREFIX!}".$tableName."` WHERE ".$whereStatement." LIMIT 1", __FILE__, __LINE__); } else { - $result = SQL_QUERY("SELECT * FROM `"._MYSQL_PREFIX.$tableName."` LIMIT 1", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT * FROM `{!_MYSQL_PREFIX!}".$tableName."` LIMIT 1", __FILE__, __LINE__); } } // END - if @@ -687,7 +687,7 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName="_config", $whereStatement="con $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 @@ -706,7 +706,7 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName="_config", $whereStatement="con $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 @@ -723,7 +723,7 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName="_config", $whereStatement="con REBUILD_CACHE("config", "config"); // Settings saved - LOAD_TEMPLATE("admin_settings_saved", false, SETTINGS_SAVED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SETTINGS_SAVED')); } // Generate a selection box @@ -778,10 +778,11 @@ function ADMIN_USER_PROFILE_LINK ($uid, $title="", $wht="list_user") { //* DEBUG: */ echo "a:".$title."
    "; // Return link - return "
    ".$title.""; + return "".$title.""; } -// -function ADMIN_CHECK_MENU_MODE() { + +// Check "logical-area-mode" +function ADMIN_CHECK_MENU_MODE () { global $cacheArray; // Set the global mode as the mode for all admins @@ -798,7 +799,7 @@ function ADMIN_CHECK_MENU_MODE() { incrementConfigEntry('cache_hits'); } elseif (GET_EXT_VERSION("admins") >= "0.6.7") { // Load from database when version of "admins" is enough - $result = SQL_QUERY_ESC("SELECT la_mode FROM `{!MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT la_mode FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", array($aid), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Load data @@ -828,7 +829,7 @@ function ADMIN_CHANGE_ACTIVATION_STATUS ($IDs, $table, $row, $idRow = "id") { // Should always be set... ;-) if (!empty($selected)) { // Determine new status - $result = SQL_QUERY_ESC("SELECT %s FROM `{!MYSQL_PREFIX!}_%s` WHERE %s=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT %s FROM `{!_MYSQL_PREFIX!}_%s` WHERE %s=%s LIMIT 1", array($row, $table, $idRow, $id), __FILE__, __LINE__); // Row found? @@ -840,7 +841,7 @@ function ADMIN_CHANGE_ACTIVATION_STATUS ($IDs, $table, $row, $idRow = "id") { if ($currStatus == "Y") $newStatus = "N"; else $newStatus = "Y"; // Change this status - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_%s` SET %s='%s' WHERE %s=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_%s` SET %s='%s' WHERE %s=%s LIMIT 1", array($table, $row, $newStatus, $idRow, $id), __FILE__, __LINE__); // Count up affected rows @@ -856,9 +857,10 @@ function ADMIN_CHANGE_ACTIVATION_STATUS ($IDs, $table, $row, $idRow = "id") { LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_STATUS_CHANGED_1.$cnt.ADMIN_STATUS_CHANGED_2.count($IDs).ADMIN_STATUS_CHANGED_3); } else { // Nothing selected! - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NOTHING_SELECTED_CHANGE); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_NOTHING_SELECTED_CHANGE')); } } + // Send mails for del/edit/lock build modes function ADMIN_SEND_BUILD_MAILS ($mode, $table, $content, $id, $subjectPart="") { // Default subject is the subject part @@ -896,6 +898,7 @@ function ADMIN_SEND_BUILD_MAILS ($mode, $table, $content, $id, $subjectPart="") SEND_ADMIN_NOTIFICATION($subjectLine, "admin_".$mode."_".$table, $content, $_POST['uid_raw'][$id]); } } + // Build a special template list function ADMIN_BUILD_LIST ($listType, $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn) { $OUT = ""; $SW = 2; @@ -953,6 +956,7 @@ function ADMIN_BUILD_LIST ($listType, $IDs, $table, $columns, $filterFunctions, ), false, $OUT ); } + // Change status of "build" list function ADMIN_BUILD_STATUS_HANDLER ($mode, $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $statusArray) { // All valid entries? (We hope so here!) @@ -965,7 +969,7 @@ function ADMIN_BUILD_STATUS_HANDLER ($mode, $IDs, $table, $columns, $filterFunct ); // Load data of entry - $result = SQL_QUERY_ESC("SELECT * FROM `{!MYSQL_PREFIX!}_%s` WHERE %s=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT * FROM `{!_MYSQL_PREFIX!}_%s` WHERE %s=%s LIMIT 1", array($table, $idColumn, $id), __FILE__, __LINE__); // Fetch the data @@ -1037,6 +1041,7 @@ function ADMIN_BUILD_STATUS_HANDLER ($mode, $IDs, $table, $columns, $filterFunct } // END - foreach } // END - if } + // Delete rows by given ID numbers function ADMIN_DELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunctions=array(), $extraValues=array(), $deleteNow=false, $idColumn="id", $userIdColumn="userid") { // All valid entries? (We hope so here!) @@ -1044,7 +1049,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 = ""; @@ -1052,7 +1057,7 @@ function ADMIN_DELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFu // Is there a userid? if (isset($_POST['uid_raw'][$id])) { // Load all data from that id - $result = SQL_QUERY_ESC("SELECT * FROM `{!MYSQL_PREFIX!}_%s` WHERE %s=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT * FROM `{!_MYSQL_PREFIX!}_%s` WHERE %s=%s LIMIT 1", array($table, $idColumn, $id), __FILE__, __LINE__); // Fetch the data @@ -1075,7 +1080,7 @@ function ADMIN_DELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFu // Was this fine? if (SQL_AFFECTEDROWS() == count($IDs)) { // All deleted - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_ALL_ENTRIES_REMOVED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_ALL_ENTRIES_REMOVED')); } else { // Some are still there :( LOAD_TEMPLATE("admin_settings_saved", false, sprintf(ADMIN_SOME_ENTRIES_NOT_DELETED, SQL_AFFECTEDROWS(), count($IDs))); @@ -1086,6 +1091,7 @@ function ADMIN_DELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFu } } // END - if } + // Edit rows by given ID numbers function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunctions=array(), $extraValues=array(), $editNow=false, $idColumn="id", $userIdColumn="userid") { // All valid entries? (We hope so here!) @@ -1147,7 +1153,7 @@ function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunc $affected += SQL_AFFECTEDROWS(); // Load all data from that id - $result = SQL_QUERY_ESC("SELECT * FROM `{!MYSQL_PREFIX!}_%s` WHERE %s=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT * FROM `{!_MYSQL_PREFIX!}_%s` WHERE %s=%s LIMIT 1", array($table, $idColumn, $id), __FILE__, __LINE__); // Fetch the data @@ -1164,7 +1170,7 @@ function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunc // Was this fine? if ($affected == count($IDs)) { // All deleted - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_ALL_ENTRIES_EDITED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_ALL_ENTRIES_EDITED')); } else { // Some are still there :( LOAD_TEMPLATE("admin_settings_saved", false, sprintf(ADMIN_SOME_ENTRIES_NOT_EDITED, $affected, count($IDs))); @@ -1175,6 +1181,7 @@ function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunc } } // END - if } + // Un-/lock rows by given ID numbers function ADMIN_LOCK_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunctions=array(), $extraValues=array(), $statusArray=array(), $lockNow=false, $idColumn="id", $userIdColumn="userid") { // All valid entries? (We hope so here!) @@ -1189,6 +1196,7 @@ function ADMIN_LOCK_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunc } } // END - if } + // Undelete rows by given ID numbers function ADMIN_UNDELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunctions=array(), $extraValues=array(), $statusArray=array(), $lockNow=false, $idColumn="id", $userIdColumn="userid") { // All valid entries? (We hope so here!) @@ -1203,6 +1211,7 @@ function ADMIN_UNDELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filter } } // END - if } + // Checks proxy settins by fetching check-updates3.php from www.mxchange.org function ADMIN_TEST_PROXY_SETTINGS ($settingsArray) { global $_CONFIG; @@ -1219,6 +1228,7 @@ function ADMIN_TEST_PROXY_SETTINGS ($settingsArray) { // Return result return $valid; } + // Sends out a link to the given email adress so the admin can reset his/her password function ADMIN_SEND_PASSWORD_RESET_LINK ($email) { // Init output @@ -1228,13 +1238,13 @@ function ADMIN_SEND_PASSWORD_RESET_LINK ($email) { $email = COMPILE_CODE($email); // Look up administator login - $result = SQL_QUERY_ESC("SELECT id, login, password FROM `{!MYSQL_PREFIX!}_admins` WHERE email='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id, login, password FROM `{!_MYSQL_PREFIX!}_admins` WHERE email='%s' LIMIT 1", array($email), __FILE__, __LINE__); // Is there an account? if (SQL_NUMROWS($result) == 0) { // No account found! - return ADMIN_NO_LOGIN_WITH_EMAIL; + return getMessage('ADMIN_NO_LOGIN_WITH_EMAIL'); } // END - if // Load all data @@ -1254,11 +1264,12 @@ function ADMIN_SEND_PASSWORD_RESET_LINK ($email) { $mailText = LOAD_EMAIL_TEMPLATE("admin_reset_password", $content); // Send it out - SEND_EMAIL($email, ADMIN_RESET_PASS_LINK_SUBJ, $mailText); + SEND_EMAIL($email, getMessage('ADMIN_RESET_PASS_LINK_SUBJ'), $mailText); // Prepare output - return ADMIN_RESET_LINK_SENT; + return getMessage('ADMIN_RESET_LINK_SENT'); } + // Validate hash and login for password reset function ADMIN_VALIDATE_RESET_LINK_HASH_LOGIN ($hash, $login) { // By default nothing validates... ;) @@ -1268,7 +1279,7 @@ function ADMIN_VALIDATE_RESET_LINK_HASH_LOGIN ($hash, $login) { $login = COMPILE_CODE($login); // Then try to find that user - $result = SQL_QUERY_ESC("SELECT id, password, email FROM `{!MYSQL_PREFIX!}_admins` WHERE login='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id, password, email FROM `{!_MYSQL_PREFIX!}_admins` WHERE login='%s' LIMIT 1", array($login), __FILE__, __LINE__); // Is an account here? @@ -1304,7 +1315,7 @@ function ADMIN_RESET_PASSWORD ($login, $password) { } // Update database - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_admins` SET password='%s' WHERE login='%s' LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins` SET password='%s' WHERE login='%s' LIMIT 1", array($passHash, $login), __FILE__, __LINE__); // Run filters @@ -1326,7 +1337,7 @@ function ADMIN_DELETE_TASK ($id) { // Function to update task data function ADMIN_UPDATE_TASK_DATA ($id, $row, $data) { // Update the task - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_task_system` SET %s='%s' WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET %s='%s' WHERE id=%s LIMIT 1", array($row, $data, bigintval($id)), __FILE__, __LINE__); } // diff --git a/inc/modules/admin/overview-inc.php b/inc/modules/admin/overview-inc.php index 840a4ffb7e..188f07abe2 100644 --- a/inc/modules/admin/overview-inc.php +++ b/inc/modules/admin/overview-inc.php @@ -41,7 +41,7 @@ function OUTPUT_STANDARD_OVERVIEW(&$result_tasks) { global $cacheArray, $_CONFIG; // First check for solved and not assigned tasks and assign them to current admin - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_task_system` SET assigned_admin='%s' WHERE assigned_admin < 1 AND status != 'NEW'", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET assigned_admin='%s' WHERE assigned_admin < 1 AND status != 'NEW'", array(GET_CURRENT_ADMIN_ID()), __FILE__, __LINE__); // We currently don't want to install an extension so let's find out if we need... @@ -100,7 +100,7 @@ function OUTPUT_STANDARD_OVERVIEW(&$result_tasks) { // At last - but not least - check for own and new unassigned tasks... $result_tasks = SQL_QUERY_ESC("SELECT id, assigned_admin, userid, task_type, subject, text, task_created -FROM `{!MYSQL_PREFIX!}_task_system` +FROM `{!_MYSQL_PREFIX!}_task_system` WHERE assigned_admin='%s' OR (assigned_admin='0' AND status='NEW') ORDER BY userid DESC, task_type DESC, subject, task_created DESC", array(GET_CURRENT_ADMIN_ID()), __FILE__, __LINE__); @@ -124,7 +124,7 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) { // Assign / do tasks $OUT = ""; $SW = 2; foreach ($POST['task'] as $id => $sel) { - $result_task = SQL_QUERY_ESC("SELECT id, userid, task_type, subject, text, task_created, status, assigned_admin FROM `{!MYSQL_PREFIX!}_task_system` WHERE id=%s AND (assigned_admin='%s' OR (assigned_admin='0' AND status='NEW')) LIMIT 1", + $result_task = SQL_QUERY_ESC("SELECT id, userid, task_type, subject, text, task_created, status, assigned_admin FROM `{!_MYSQL_PREFIX!}_task_system` WHERE id=%s AND (assigned_admin='%s' OR (assigned_admin='0' AND status='NEW')) LIMIT 1", array(bigintval($id), GET_CURRENT_ADMIN_ID()), __FILE__, __LINE__); if (SQL_NUMROWS($result_task) == 1) { // Task is valid... @@ -133,7 +133,7 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) { if ($aid == "0") { // Assgin current admin to unassgigned task - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_task_system` SET assigned_admin='%s' WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET assigned_admin='%s' WHERE id=%s LIMIT 1", array(GET_CURRENT_ADMIN_ID(), bigintval($tid)), __FILE__, __LINE__); } // END - if @@ -145,7 +145,7 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) { } // END - if if ($uid > 0) { - $result_user = SQL_QUERY_ESC("SELECT gender, surname, family, email FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result_user = SQL_QUERY_ESC("SELECT gender, surname, family, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); if (SQL_NUMROWS($result_user) == 1) { list($gender, $sname, $fname, $email) = SQL_FETCHROW($result_user); @@ -229,7 +229,7 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) { { case "EXTENSION": // Install new extensions $ext_name = substr($subj, 1, strpos($subj, ":") - 1); - $result_lines = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_extensions` WHERE ext_name='%s' LIMIT 1", + $result_lines = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_extensions` WHERE ext_name='%s' LIMIT 1", array($ext_name), __FILE__, __LINE__); $lines = SQL_NUMROWS($result_lines); SQL_FREERESULT($result_lines); @@ -275,7 +275,7 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) { case "PAYOUT_REQUEST": // Payout requests if (EXT_IS_ACTIVE("payout")) { // Extension is installed so let him send a notification to the user - $result_pay = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_user_payouts` WHERE userid=%s AND payout_timestamp=%s LIMIT 1", + $result_pay = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_payouts` WHERE userid=%s AND payout_timestamp=%s LIMIT 1", array(bigintval($uid), bigintval($created)), __FILE__, __LINE__); list($pid) = SQL_FETCHROW($result_pay); SQL_FREERESULT($result_pay); @@ -300,7 +300,7 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) { case "WERNIS_REQUEST": // Wernis requests if (EXT_IS_ACTIVE("wernis")) { // Extension is installed so let him send a notification to the user - $result_pay = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_user_wernis` WHERE userid=%s AND wernis_timestamp=%s LIMIT 1", + $result_pay = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_wernis` WHERE userid=%s AND wernis_timestamp=%s LIMIT 1", array(bigintval($uid), bigintval($created)), __FILE__, __LINE__); list($pid) = SQL_FETCHROW($result_pay); SQL_FREERESULT($result_pay); @@ -327,7 +327,7 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) { break; case "NL_UNSUBSCRIBE": // Newsletter unsubscriptions - $result = SQL_QUERY_ESC("SELECT nl_timespan FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT nl_timespan FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); list($span) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -366,19 +366,19 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) { if (!empty($POST['unassign'])) { // Unassign from tasks foreach ($POST['task'] as $id => $sel) { - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_task_system` SET assigned_admin=0 WHERE id=%s AND assigned_admin=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET assigned_admin=0 WHERE id=%s AND assigned_admin=%s LIMIT 1", array(bigintval($id), GET_CURRENT_ADMIN_ID()), __FILE__, __LINE__); } } elseif (isset($POST['del'])) { // Delete tasks foreach ($POST['task'] as $id => $sel) { - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_task_system` WHERE id=%s AND assigned_admin IN (%s,0) LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_task_system` WHERE id=%s AND assigned_admin IN (%s,0) LIMIT 1", array(bigintval($id), GET_CURRENT_ADMIN_ID()), __FILE__, __LINE__); } } // Update query - $result_tasks = SQL_QUERY_ESC("SELECT id, assigned_admin, userid, task_type, subject, text, task_created FROM `{!MYSQL_PREFIX!}_task_system` WHERE assigned_admin=%s OR (assigned_admin=0 AND status='NEW') ORDER BY task_created DESC", + $result_tasks = SQL_QUERY_ESC("SELECT id, assigned_admin, userid, task_type, subject, text, task_created FROM `{!_MYSQL_PREFIX!}_task_system` WHERE assigned_admin=%s OR (assigned_admin=0 AND status='NEW') ORDER BY task_created DESC", array(GET_CURRENT_ADMIN_ID()), __FILE__, __LINE__); } // END - if @@ -395,7 +395,7 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) { $login = GET_ADMIN_LOGIN($admin); if ($login != "***") { // Admin found - $admin = "".$login.""; + $admin = "".$login.""; } else { // Maybe deleted? $admin = "
    ".ADMIN_ID_404_1.$admin.ADMIN_ID_404_2."
    "; diff --git a/inc/modules/admin/what-add_points.php b/inc/modules/admin/what-add_points.php index fafd094a5f..81ddb82b78 100644 --- a/inc/modules/admin/what-add_points.php +++ b/inc/modules/admin/what-add_points.php @@ -47,7 +47,7 @@ if ($_GET['u_id'] == "all") { // Add points to all accounts if ((isset($_POST['ok'])) && ($_POST['points'] > 0)) { define('__POINTS_VALUE', $_POST['points']); - $result_main = SQL_QUERY("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE status='CONFIRMED' ORDER BY userid", __FILE__, __LINE__); + $result_main = SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE status='CONFIRMED' ORDER BY userid", __FILE__, __LINE__); while (list($uid) = SQL_FETCHROW($result_main)) { // Remove depth to prevent booking errors. This is a bad coding // practice, thats also why we need to write this project from @@ -65,21 +65,21 @@ if ($_GET['u_id'] == "all") { // Load email template and send email away $msg = LOAD_EMAIL_TEMPLATE("add-points", $content, bigintval($uid)); - SEND_EMAIL(bigintval($uid), ADMIN_ADD_SUBJ, $msg); + SEND_EMAIL(bigintval($uid), getMessage('ADMIN_ADD_SUBJ'), $msg); } // END - while // Free memory SQL_FREERESULT($result_main); // Output message - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_ALL_POINTS_ADDED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_ALL_POINTS_ADDED')); } else { // Display form add points LOAD_TEMPLATE("admin_add_points_all"); } } elseif (!empty($_GET['u_id'])) { // User ID found in URL so we use this give him some credits - $result = SQL_QUERY_ESC("SELECT surname, family, email FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s AND status='CONFIRMED' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT surname, family, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND status='CONFIRMED' LIMIT 1", array(bigintval($_GET['u_id'])), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Selected user does exist @@ -104,8 +104,8 @@ if ($_GET['u_id'] == "all") { // Message laden $msg = LOAD_EMAIL_TEMPLATE("add-points", $content, bigintval($_GET['u_id'])); - SEND_EMAIL(bigintval($_GET['u_id']), ADMIN_ADD_SUBJ, $msg); - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_POINTS_ADDED); + SEND_EMAIL(bigintval($_GET['u_id']), getMessage('ADMIN_ADD_SUBJ'), $msg); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_POINTS_ADDED')); } else { // Opps, missing form here define('__USER_VALUE', "".$sname." ".$fname.""); diff --git a/inc/modules/admin/what-add_rallye.php b/inc/modules/admin/what-add_rallye.php index b57a28389d..3f32393e10 100644 --- a/inc/modules/admin/what-add_rallye.php +++ b/inc/modules/admin/what-add_rallye.php @@ -47,13 +47,13 @@ if (isset($_POST['ok'])) $END = mktime($_POST['end_hour'] , $_POST['end_min'] , $_POST['end_sec'] , $_POST['end_month'] , $_POST['end_day'] , $_POST['end_year'] ); // Is there already a rallye running? - $result = SQL_QUERY_ESC("SELECT id, admin_id FROM `{!MYSQL_PREFIX!}_rallye_data` WHERE (start_time <= %s AND end_time >= %s) OR (start_time >= %s AND start_time <= %s) LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id, admin_id FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE (start_time <= %s AND end_time >= %s) OR (start_time >= %s AND start_time <= %s) LIMIT 1", array($START, $START, $START, $END), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 0) { // Ok, start and end time did not overlap - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_rallye_data` (admin_id, title, descr, template, start_time, end_time, auto_add_new_user, is_active, send_notify) + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_rallye_data` (admin_id, title, descr, template, start_time, end_time, auto_add_new_user, is_active, send_notify) VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s')", array( GET_CURRENT_ADMIN_ID(), @@ -68,7 +68,7 @@ VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s')", ), __FILE__, __LINE__); // Load ID - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_rallye_data` WHERE start_time='%s' AND end_time='%s' AND title='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE start_time='%s' AND end_time='%s' AND title='%s' LIMIT 1", array($START, $END, $_POST['title']), __FILE__, __LINE__); list($id) = SQL_FETCHROW($result); SQL_FREERESULT($result); diff --git a/inc/modules/admin/what-add_surfbar_url.php b/inc/modules/admin/what-add_surfbar_url.php index d60a9d8602..21268b0bcd 100644 --- a/inc/modules/admin/what-add_surfbar_url.php +++ b/inc/modules/admin/what-add_surfbar_url.php @@ -51,10 +51,10 @@ if ((isset($_POST['add'])) && (!empty($_POST['url']))) { // Then add this URL if (SURFBAR_ADMIN_ADD_URL($_POST['url'], $_POST['limit'], $_POST['reload'])) { // URL was added - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SURFBAR_URL_ADDED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_SURFBAR_URL_ADDED')); } else { // Not added - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SURFBAR_URL_NOT_ADDED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_SURFBAR_URL_NOT_ADDED')); } } // END - if diff --git a/inc/modules/admin/what-admin_add.php b/inc/modules/admin/what-admin_add.php index 6320112d63..23849f3a72 100644 --- a/inc/modules/admin/what-admin_add.php +++ b/inc/modules/admin/what-admin_add.php @@ -51,7 +51,7 @@ if (!isset($_POST['ok'])) $menus = array(); $titles = array(); $below = array(); // Get all available main menus - $result = SQL_QUERY("SELECT action, title, sort FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE (what='' OR what IS NULL) ORDER BY sort", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT action, title, sort FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE (what='' OR `what` IS NULL) ORDER BY `sort`", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Read menu structure @@ -89,7 +89,7 @@ if (!isset($_POST['ok'])) // Load sub menus :) foreach ($menus as $key_main => $value_main) { - $result = SQL_QUERY_ESC("SELECT what, title, sort FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort", + $result = SQL_QUERY_ESC("SELECT what, title, sort FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`", array($value_main), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { @@ -170,7 +170,7 @@ if (!isset($_POST['ok'])) if (!empty($_POST['menu'])) { // Add sub menu - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('%s','%s','%s','%s','%s')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('%s','%s','%s','%s','%s')", array( $_POST['menu'], $_POST['name'], @@ -184,7 +184,7 @@ if (!isset($_POST['ok'])) else { // Add main menu - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (action, title, descr, sort) VALUES ('%s','%s','%s','%s')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (action, title, descr, sort) VALUES ('%s','%s','%s','%s')", array( $_POST['name'], $_POST['title'], @@ -194,12 +194,12 @@ if (!isset($_POST['ok'])) ); CACHE_PURGE_ADMIN_MENU(0, $_POST['name']); } - LOAD_TEMPLATE("admin_settings_saved", false, SAVING_DONE); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SETTINGS_SAVED')); } else { // Is demo login! - LOAD_TEMPLATE("admin_settings_saved", false, SETTINGS_NOT_SAVED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SETTINGS_NOT_SAVED')); } // diff --git a/inc/modules/admin/what-adminedit.php b/inc/modules/admin/what-adminedit.php index 7bf1bff4a2..609f3761c3 100644 --- a/inc/modules/admin/what-adminedit.php +++ b/inc/modules/admin/what-adminedit.php @@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR("admin", __FILE__); // Do we edit/delete/change main menus or sub menus? -$AND = "(what = '' OR what IS NULL)"; $SUB = ""; +$AND = "(`what` = '' OR `what` IS NULL)"; $SUB = ""; if (!empty($_GET['sub'])) { - $AND = sprintf("action='%s' AND what IS NOT NULL", SQL_ESCAPE($_GET['sub'])); + $AND = sprintf("action='%s' AND `what` IS NOT NULL", SQL_ESCAPE($_GET['sub'])); $SUB = SQL_ESCAPE($_GET['sub']); } @@ -63,7 +63,7 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) { if ($confirm == 1) { $cnt++; - $result = SQL_QUERY_ESC("SELECT title, action, what, descr FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE ".$AND." AND id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT title, action, what, descr FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE ".$AND." AND id=%s LIMIT 1", array(bigintval($sel)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { @@ -112,7 +112,7 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) { if ($confirm == 1) { $cnt++; - $result = SQL_QUERY_ESC("SELECT title FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE ".$AND." AND id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE ".$AND." AND id=%s LIMIT 1", array(bigintval($sel)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { @@ -156,7 +156,7 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) { $sel = bigintval($sel); // Update entry - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET title='%s', action='%s', what='%s', @@ -175,18 +175,18 @@ WHERE ".$AND." AND id=%s LIMIT 1", CACHE_PURGE_ADMIN_MENU(0, $_POST['sel_action'][$sel], $_POST['sel_what'][$sel]); // Load template - LOAD_TEMPLATE("admin_settings_saved", false, SAVING_DONE); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SETTINGS_SAVED')); break; case "del": // Delete menu foreach ($_POST['sel'] as $sel => $menu) { - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE ".$AND." AND id=%s LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE ".$AND." AND id=%s LIMIT 1", array(bigintval($sel)), __FILE__, __LINE__); CACHE_PURGE_ADMIN_MENU(0, "", "", $AND); } // END - foreach // Load template - LOAD_TEMPLATE("admin_settings_saved", false, SAVING_DONE); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SETTINGS_SAVED')); break; default: // Unexpected action @@ -200,11 +200,11 @@ WHERE ".$AND." AND id=%s LIMIT 1", // Get IDs if (!empty($_GET['w'])) { // Sub menus selected - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE action='%s' AND sort='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='%s' AND sort='%s' LIMIT 1", array($_GET['act'], bigintval($_GET['tid'])), __FILE__, __LINE__); list($tid) = SQL_FETCHROW($result); SQL_FREERESULT($result); - $result = SQL_QUERY("SELECT id FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE action='%s' AND sort='%s' LIMIT 1", + $result = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='%s' AND sort='%s' LIMIT 1", array($_GET['act'], bigintval($_GET['fid'])), __FILE__, __LINE__); list($fid) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -212,11 +212,11 @@ WHERE ".$AND." AND id=%s LIMIT 1", else { // Main menu selected - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE (what='' OR what IS NULL) AND sort='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE (what='' OR `what` IS NULL) AND sort='%s' LIMIT 1", array(bigintval($_GET['tid'])), __FILE__, __LINE__); list($tid) = SQL_FETCHROW($result); SQL_FREERESULT($result); - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE (what='' OR what IS NULL) AND sort='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE (what='' OR `what` IS NULL) AND sort='%s' LIMIT 1", array(bigintval($_GET['fid'])), __FILE__, __LINE__); list($fid) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -225,9 +225,9 @@ WHERE ".$AND." AND id=%s LIMIT 1", if ((!empty($tid)) && (!empty($fid))) { // Sort menu - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET sort='%s' WHERE ".$AND." AND id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET sort='%s' WHERE ".$AND." AND id=%s LIMIT 1", array(bigintval($_GET['tid']), bigintval($fid)), __FILE__, __LINE__); - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET sort='%s' WHERE ".$AND." AND id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET sort='%s' WHERE ".$AND." AND id=%s LIMIT 1", array(bigintval($_GET['fid']), bigintval($tid)), __FILE__, __LINE__); CACHE_PURGE_ADMIN_MENU(0, "", "", $AND); } @@ -237,13 +237,13 @@ WHERE ".$AND." AND id=%s LIMIT 1", if (!empty($SUB)) { // Sub menus of a main menu - $result = SQL_QUERY_ESC("SELECT id, action, what, title, sort FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort ASC", + $result = SQL_QUERY_ESC("SELECT id, action, what, title, sort FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC", array($SUB), __FILE__, __LINE__); } else { // Main menus - $result = SQL_QUERY("SELECT id, action, what, title, sort FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE (what='' OR what IS NULL) ORDER BY sort ASC", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id, action, what, title, sort FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE (what='' OR `what` IS NULL) ORDER BY `sort` ASC", __FILE__, __LINE__); } $max = SQL_NUMROWS($result); if ($max > 0) @@ -256,17 +256,17 @@ WHERE ".$AND." AND id=%s LIMIT 1", if (($sort == 0) || (($sort == 1) && (!empty($SUB)))) { // Is highest position - $NAVI = "".LOWER.""; + $NAVI = "{!LOWER!}"; } elseif ($cnt == $max) { // Is lowest position - $NAVI = "".HIGHER.""; + $NAVI = "{!HIGHER!}"; } elseif ($sort > 0) { // Anything else between highest and lowest - $NAVI = "".HIGHER."/".LOWER.""; + $NAVI = "{!HIGHER!}/{!LOWER!}"; } if (empty($act)) $act = " "; @@ -296,7 +296,7 @@ WHERE ".$AND." AND id=%s LIMIT 1", else { // Menu entries are missing... (???) - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NO_MENUS_FOUND); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_NO_MENUS_FOUND')); } } diff --git a/inc/modules/admin/what-admins_add.php b/inc/modules/admin/what-admins_add.php index 6fb997102e..5adb87dde1 100644 --- a/inc/modules/admin/what-admins_add.php +++ b/inc/modules/admin/what-admins_add.php @@ -52,7 +52,7 @@ if ((isset($_POST['add'])) && (!empty($_POST['login'])) && (!empty($_POST['email $FORM = false; // Admin login saved - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_ADMINS_ADD_DONE); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_ADMINS_ADD_DONE')); // Run filter chain RUN_FILTER('post_admin_added', $_POST); diff --git a/inc/modules/admin/what-admins_mails.php b/inc/modules/admin/what-admins_mails.php index 71c09abaa7..45ad906840 100644 --- a/inc/modules/admin/what-admins_mails.php +++ b/inc/modules/admin/what-admins_mails.php @@ -52,7 +52,7 @@ if (isset($_POST['edit'])) foreach ($_POST['sel'] as $template => $sel) { // First of all load data from DB - $result = SQL_QUERY_ESC("SELECT admin_id, id FROM `{!MYSQL_PREFIX!}_admins_mails` WHERE mail_template='%s' ORDER BY id", + $result = SQL_QUERY_ESC("SELECT admin_id, id FROM `{!_MYSQL_PREFIX!}_admins_mails` WHERE mail_template='%s' ORDER BY `id`", array($template), __FILE__, __LINE__); $OUT = ""; $aid = 0; $aid2 = 0; while (list($aid, $id) = SQL_FETCHROW($result)) @@ -110,8 +110,8 @@ if (isset($_POST['edit'])) { // Load all assigned mails $result = SQL_QUERY("SELECT DISTINCT m.id, m.admin_id, a.login, m.mail_template -FROM `{!MYSQL_PREFIX!}_admins_mails` AS m -LEFT JOIN `{!MYSQL_PREFIX!}_admins` AS a +FROM `{!_MYSQL_PREFIX!}_admins_mails` AS m +LEFT JOIN `{!_MYSQL_PREFIX!}_admins` AS a ON m.admin_id=a.id WHERE (m.admin_id=a.id OR m.admin_id < 1) AND m.mail_template != '' ORDER BY m.admin_id, m.mail_template", __FILE__, __LINE__); @@ -129,35 +129,35 @@ ORDER BY m.admin_id, m.mail_template", __FILE__, __LINE__); $aid = bigintval($aid); // Update entry - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_admins_mails` SET admin_id=%s WHERE id=%s ORDER BY id LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins_mails` SET admin_id=%s WHERE id=%s ORDER BY `id` LIMIT 1", array($aid, $id), __FILE__, __LINE__); if (($aid < 1) && (!empty($_POST['template'][$id]))) { // Remove any other admin entries - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admins_mails` WHERE mail_template='%s' AND id != '%s'", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admins_mails` WHERE mail_template='%s' AND id != '%s'", array($_POST['template'][$id], $id), __FILE__, __LINE__); } if ($_POST['admin_new'][$_POST['template'][$id]] > 0) { // Add new admin - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_admins_mails` (admin_id, mail_template) VALUES ('%s','%s')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_admins_mails` (admin_id, mail_template) VALUES ('%s','%s')", array($aid, $_POST['template'][$id]), __FILE__, __LINE__); } } // Query again... - $result = SQL_QUERY("SELECT DISTINCT m.id, m.admin_id, a.login, m.mail_template FROM `{!MYSQL_PREFIX!}_admins_mails` AS m, `{!MYSQL_PREFIX!}_admins` AS a WHERE m.admin_id=a.id OR m.admin_id < 1 ORDER BY m.admin_id", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT DISTINCT m.id, m.admin_id, a.login, m.mail_template FROM `{!_MYSQL_PREFIX!}_admins_mails` AS m, `{!_MYSQL_PREFIX!}_admins` AS a WHERE m.admin_id=a.id OR m.admin_id < 1 ORDER BY m.admin_id", __FILE__, __LINE__); } // List found entries $SW = 2; $OUT = ""; - while(list($id, $aid, $admin, $templ) = SQL_FETCHROW($result)) + while (list($id, $aid, $admin, $templ) = SQL_FETCHROW($result)) { if ($aid > 0) { // Admin assigned - $admin_link = "".$admin.""; + $admin_link = "".$admin.""; } elseif ($aid == 0) { diff --git a/inc/modules/admin/what-chk_regs.php b/inc/modules/admin/what-chk_regs.php index 28999a763e..93e8b41697 100644 --- a/inc/modules/admin/what-chk_regs.php +++ b/inc/modules/admin/what-chk_regs.php @@ -42,7 +42,7 @@ ADD_DESCR ("admin", basename(__FILE__)); // Check for accounts $result = SQL_QUERY("SELECT userid, gender, surname, family, email, REMOTE_ADDR, refid, user_hash -FROM `{!MYSQL_PREFIX!}_user_data` +FROM `{!_MYSQL_PREFIX!}_user_data` WHERE status='UNCONFIRMED' ORDER BY userid ASC", __FILE__, __LINE__); @@ -76,7 +76,7 @@ if (SQL_NUMROWS($result) > 0) { LOAD_TEMPLATE("admin_reg"); } else { // No registrations left - or all has confirmed their email address... :-) - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_ALL_CONFIRMED_EMAIL); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_ALL_CONFIRMED_EMAIL')); } // Free memory diff --git a/inc/modules/admin/what-config_admins.php b/inc/modules/admin/what-config_admins.php index 8f3db7d3fc..6c646830e7 100644 --- a/inc/modules/admin/what-config_admins.php +++ b/inc/modules/admin/what-config_admins.php @@ -48,7 +48,7 @@ if ((isset($_POST['edit'])) && ($SEL > 0)) { $SW = 2; $OUT = ""; foreach ($_POST['sel'] as $id => $sel) { // Load data for the ID - $result = SQL_QUERY_ESC("SELECT admin_id, action_menu, what_menu, access_mode FROM `{!MYSQL_PREFIX!}_admins_acls` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT admin_id, action_menu, what_menu, access_mode FROM `{!_MYSQL_PREFIX!}_admins_acls` WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); list($aid, $act, $wht, $mode) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -63,7 +63,7 @@ if ((isset($_POST['edit'])) && ($SEL > 0)) { 'mode_options' => ADD_OPTION_LINES( "/ARRAY/", array("allow", "deny"), - array(ADMINS_ALLOW_MODE, ADMINS_DENY_MODE), + array(constant('ADMINS_ALLOW_MODE'), constant('ADMINS_DENY_MODE')), $mode ), ); @@ -83,7 +83,7 @@ if ((isset($_POST['edit'])) && ($SEL > 0)) { $id = bigintval($id); // Update entries - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_admins_acls` SET admin_id=%s, action_menu='%s', what_menu='%s', access_mode='%s' WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins_acls` SET admin_id=%s, action_menu='%s', what_menu='%s', access_mode='%s' WHERE id=%s LIMIT 1", array($_POST['admin'][$id], $_POST['action_menu'][$id], $_POST['what_menu'][$id], $_POST['mode'][$id], $id),__FILE__, __LINE__); } @@ -96,13 +96,13 @@ if ((isset($_POST['edit'])) && ($SEL > 0)) { } // Entries changed - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_ADMINS_ENTRIES_CHANGED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_ADMINS_ENTRIES_CHANGED')); } elseif ((isset($_POST['del'])) && ($SEL > 0)) { // Delete ACLs $SW = 2; $OUT = ""; foreach ($_POST['sel'] as $id => $sel) { // Load data for the ID - $result = SQL_QUERY_ESC("SELECT admin_id, action_menu, what_menu, access_mode FROM `{!MYSQL_PREFIX!}_admins_acls` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT admin_id, action_menu, what_menu, access_mode FROM `{!_MYSQL_PREFIX!}_admins_acls` WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); list($admin, $act, $wht, $mode) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -118,7 +118,7 @@ if ((isset($_POST['edit'])) && ($SEL > 0)) { $login = GET_ADMIN_LOGIN($admin); if ($login != "***") { // Admin found - $admin = "".$login.""; + $admin = "".$login.""; } else { // Maybe deleted? $admin = "
    ".ADMIN_ID_404_1.$admin.ADMIN_ID_404_2."
    "; @@ -145,7 +145,7 @@ if ((isset($_POST['edit'])) && ($SEL > 0)) { } elseif ((isset($_POST['remove'])) && ($SEL > 0)) { // Remove entries foreach ($_POST['sel'] as $id => $sel) { - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admins_acls` WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admins_acls` WHERE id=%s LIMIT 1", array(bigintval($id)),__FILE__, __LINE__); } @@ -158,7 +158,7 @@ if ((isset($_POST['edit'])) && ($SEL > 0)) { } // Entries deleted - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_ADMINS_ENTRIES_DELETED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_ADMINS_ENTRIES_DELETED')); } elseif (isset($_POST['add'])) { // Check if everything is fine... $mode = GET_ADMIN_DEFAULT_ACL(bigintval($_POST['admin_id'])); @@ -175,11 +175,11 @@ if ((isset($_POST['edit'])) && ($SEL > 0)) { $BOTH = ((!empty($_POST['action_menu'])) && (!empty($_POST['what_menu']))); if (((!empty($_POST['action_menu'])) || (!empty($_POST['what_menu']))) && (!$BOTH)) { // Main or sub menu selected - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_admins_acls` WHERE admin_id=%s AND action_menu='%s' AND what_menu='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admins_acls` WHERE admin_id=%s AND action_menu='%s' AND what_menu='%s' LIMIT 1", array(bigintval($_POST['admin_id']), $_POST['action_menu'], $_POST['what_menu']), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 0) { // Finally add the new ACL - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_admins_acls` (admin_id, action_menu, what_menu, access_mode) + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_admins_acls` (admin_id, action_menu, what_menu, access_mode) VALUES ('%s','%s','%s','%s')", array( bigintval($_POST['admin_id']), @@ -216,12 +216,12 @@ VALUES ('%s','%s','%s','%s')", LOAD_TEMPLATE("admin_settings_saved", false, $content); } else { // List all ACLs - $result_acls = SQL_QUERY("SELECT id, admin_id, action_menu, what_menu, access_mode FROM `{!MYSQL_PREFIX!}_admins_acls` ORDER BY admin_id, id", __FILE__, __LINE__); + $result_acls = SQL_QUERY("SELECT id, admin_id, action_menu, what_menu, access_mode FROM `{!_MYSQL_PREFIX!}_admins_acls` ORDER BY admin_id, id", __FILE__, __LINE__); if (SQL_NUMROWS($result_acls) > 0) { // List ACLs $SW = 2; $OUT = ""; - while(list($id, $admin, $act, $wht, $mode) = SQL_FETCHROW($result_acls)) + while (list($id, $admin, $act, $wht, $mode) = SQL_FETCHROW($result_acls)) { // Prepare variables if (empty($act)) $act = "---"; @@ -232,13 +232,10 @@ VALUES ('%s','%s','%s','%s')", // Load admin's data $login = GET_ADMIN_LOGIN($admin); - if ($login != "***") - { + if ($login != "***") { // Admin found - $admin = "".$login.""; - } - else - { + $admin = "".$login.""; + } else { // Maybe deleted? $admin = "
    ".ADMIN_ID_404_1.$admin.ADMIN_ID_404_2."
    "; } diff --git a/inc/modules/admin/what-config_cats.php b/inc/modules/admin/what-config_cats.php index d3533af3f7..5bda6c5df8 100644 --- a/inc/modules/admin/what-config_cats.php +++ b/inc/modules/admin/what-config_cats.php @@ -46,11 +46,11 @@ $CATS = ""; if (isset($_POST['add'])) { // Add a new category - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_cats` WHERE cat='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_cats` WHERE cat='%s' LIMIT 1", array($_POST['catname']), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 0) { // Category does not exists, we simply add it... - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_cats` (cat, visible, sort) VALUES ('%s','%s','%s')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_cats` (cat, visible, sort) VALUES ('%s','%s','%s')", array($_POST['catname'], $_POST['visible'], bigintval($_POST['parent'] + 1)), __FILE__, __LINE__); $content = CATEGORY_ADDED; } else { @@ -75,15 +75,15 @@ if (isset($_POST['add'])) { switch ($_GET['do']) { case "edit": // Change categories - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_cats` SET cat='%s', visible='%s', sort=%s WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_cats` SET cat='%s', `visible`='%s', sort=%s WHERE id=%s LIMIT 1", array($cat, $_POST['vis'][$id], $_POST['sort'][$id], $id), __FILE__, __LINE__); $TEXT = CATEGORIES_SAVED; break; case "del": // Delete categories - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_cats` WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_cats` WHERE id=%s LIMIT 1", array($id), __FILE__, __LINE__); - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_user_cats` WHERE cat_id=%s", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE cat_id=%s", array($id), __FILE__, __LINE__); $TEXT = CATEGORIES_DELETED; break; @@ -103,7 +103,7 @@ if (isset($_POST['add'])) { $SW = 2; $OUT = ""; foreach ($_POST['sel'] as $id => $value) { // Load data of category - $result = SQL_QUERY_ESC("SELECT cat FROM `{!MYSQL_PREFIX!}_cats` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT cat FROM `{!_MYSQL_PREFIX!}_cats` WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); list($cat) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -129,7 +129,7 @@ if (isset($_POST['add'])) { foreach ($_POST['sel'] as $id => $value) { // Load data from the category - $result = SQL_QUERY_ESC("SELECT cat, visible, sort FROM `{!MYSQL_PREFIX!}_cats` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT cat, visible, sort FROM `{!_MYSQL_PREFIX!}_cats` WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); list($cat, $vis, $sort) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -155,7 +155,7 @@ if (isset($_POST['add'])) { else { // Load all categories - $result = SQL_QUERY("SELECT id, cat, visible, sort FROM `{!MYSQL_PREFIX!}_cats` ORDER BY sort", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id, cat, visible, sort FROM `{!_MYSQL_PREFIX!}_cats` ORDER BY `sort`", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // List already existing categories for editing diff --git a/inc/modules/admin/what-config_email.php b/inc/modules/admin/what-config_email.php index fd443e1f95..754f36912f 100644 --- a/inc/modules/admin/what-config_email.php +++ b/inc/modules/admin/what-config_email.php @@ -45,11 +45,11 @@ if (empty($_POST['max'])) unset($_POST['add_max']); if (isset($_POST['add_max'])) { // Save all settings - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_max_receive` WHERE value='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_max_receive` WHERE value='%s' LIMIT 1", array(bigintval($_POST['max'])), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 0) { // Add this value (including comment) - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_max_receive` (value, comment) VALUES ('%s','%s')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_max_receive` (value, comment) VALUES ('%s','%s')", array(bigintval($_POST['max']), $_POST['comment']),__FILE__, __LINE__); $content = MAX_VALUE_SAVED; } else { @@ -72,13 +72,13 @@ if (isset($_POST['add_max'])) { switch ($_GET['do']) { case "edit": // Change entries - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_max_receive` SET value='%s', comment='%s' WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_max_receive` SET value='%s', comment='%s' WHERE id=%s LIMIT 1", array(bigintval($_POST['val'][$id]), $_POST['comm'][$id], $id),__FILE__, __LINE__); $TEXT = MRECEIVE_SAVED; break; case "del": - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_max_receive` WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_max_receive` WHERE id=%s LIMIT 1", array($id), __FILE__, __LINE__); $TEXT = MRECEIVE_DELETED; break; @@ -95,7 +95,7 @@ if (isset($_POST['add_max'])) { foreach ($_POST['sel'] as $id => $value) { // Load data - $result = SQL_QUERY_ESC("SELECT value, comment FROM `{!MYSQL_PREFIX!}_max_receive` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT value, comment FROM `{!_MYSQL_PREFIX!}_max_receive` WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); list($value, $comment) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -121,7 +121,7 @@ if (isset($_POST['add_max'])) { $SW = 2; $OUT = ""; foreach ($_POST['sel'] as $id => $value) { // Load data - $result = SQL_QUERY_ESC("SELECT value, comment FROM `{!MYSQL_PREFIX!}_max_receive` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT value, comment FROM `{!_MYSQL_PREFIX!}_max_receive` WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); list($value, $comment) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -143,7 +143,7 @@ if (isset($_POST['add_max'])) { // Load main template LOAD_TEMPLATE("admin_config_email_edit"); } else { - $result = SQL_QUERY("SELECT id, value, comment FROM `{!MYSQL_PREFIX!}_max_receive` ORDER BY value", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id, value, comment FROM `{!_MYSQL_PREFIX!}_max_receive` ORDER BY value", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // List already existing entries for editing $SW = 2; $OUT = ""; diff --git a/inc/modules/admin/what-config_home.php b/inc/modules/admin/what-config_home.php index 5185bfb4ba..3a9c3ae627 100644 --- a/inc/modules/admin/what-config_home.php +++ b/inc/modules/admin/what-config_home.php @@ -53,7 +53,7 @@ case "settings": // Settings related to the index page if (isset($_POST['ok'])) { // Save settings ADMIN_SAVE_SETTINGS($_POST); - OUTPUT_HTML("".ADMIN_CONTINUE_TO_CONFIG.""); + OUTPUT_HTML("".ADMIN_CONTINUE_TO_CONFIG.""); } else { // Prepare data for the template $content = array_fill(-1, 60, ""); @@ -72,16 +72,16 @@ case "target": // Set which what-file will be placed in home-page (only modules. // Load all what menu points $result = SQL_QUERY("SELECT id, what, title -FROM `{!MYSQL_PREFIX!}_guest_menu` -WHERE action='main' AND what != '' AND what IS NOT NULL AND locked='N' -ORDER BY sort ASC", __FILE__, __LINE__); +FROM `{!_MYSQL_PREFIX!}_guest_menu` +WHERE action='main' AND `what` != '' AND `what` IS NOT NULL AND `locked`='N' +ORDER BY `sort` ASC", __FILE__, __LINE__); $SW = 2; $OUT = ""; $atitle = ""; while (list($id, $wht, $wtitle) = SQL_FETCHROW($result)) { - $LINK = ""._IS_NEW_HOME.""; + $LINK = ""._IS_NEW_HOME.""; if ($wht == getConfig('index_home')) { // Is current home - $LINK = "
    "._IS_CURRENT_HOME."
    "; + $LINK = "
    {!_IS_CURRENT_HOME!}
    "; $atitle = "
    ".$atitle."
    "; $wtitle = "
    ".$wtitle."
    "; } diff --git a/inc/modules/admin/what-config_mods.php b/inc/modules/admin/what-config_mods.php index 424121c8f7..ffdecb854a 100644 --- a/inc/modules/admin/what-config_mods.php +++ b/inc/modules/admin/what-config_mods.php @@ -54,7 +54,7 @@ if (isset($_POST['edit'])) foreach ($_POST['sel'] as $id => $sel) { // Load module data - $result = SQL_QUERY_ESC("SELECT module, title, locked, hidden, admin_only, mem_only FROM `{!MYSQL_PREFIX!}_mod_reg` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT module, title, locked, hidden, admin_only, mem_only FROM `{!_MYSQL_PREFIX!}_mod_reg` WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); list($mod, $title, $locked, $hidden, $admin, $mem) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -99,7 +99,7 @@ if (isset($_POST['edit'])) $id = bigintval($id); // Update module - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_mod_reg` SET title='%s', locked='%s', hidden='%s', admin_only='%s', mem_only='%s' WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET title='%s', `locked`='%s', hidden='%s', admin_only='%s', mem_only='%s' WHERE id=%s LIMIT 1", array($_POST['title'][$id], $_POST['locked'][$id], $_POST['hidden'][$id], $_POST['admin'][$id], $_POST['member'][$id], $id), __FILE__, __LINE__); } @@ -118,7 +118,7 @@ if ($SEL == 0) { // Load module data (We do not need to check if there's at least one...) $result = SQL_QUERY("SELECT id, module, locked, hidden, admin_only, title, mem_only, clicks -FROM `{!MYSQL_PREFIX!}_mod_reg` +FROM `{!_MYSQL_PREFIX!}_mod_reg` ORDER BY module", __FILE__, __LINE__); $OUT = ""; $SW = 2; while (list($id, $mod, $locked, $hidden, $admin, $title, $mem) = SQL_FETCHROW($result)) @@ -128,7 +128,7 @@ ORDER BY module", __FILE__, __LINE__); if (($mod == "index") || ($mod == "login")) { // Add link to detail statistics - $mod = "".$mod.""; + $mod = "".$mod.""; } // Prepare array for the template diff --git a/inc/modules/admin/what-config_payouts.php b/inc/modules/admin/what-config_payouts.php index 9bd9591c46..fd1e6faf1e 100644 --- a/inc/modules/admin/what-config_payouts.php +++ b/inc/modules/admin/what-config_payouts.php @@ -44,11 +44,11 @@ if (!empty($_POST['rate'])) $_POST['rate'] = REVERT_COMMA($_POST['rate']); if ((isset($_POST['add'])) && (!empty($_POST['title'])) && ($_POST['rate'] > 0)) { // Add new payout type - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_payout_types` WHERE type='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_payout_types` WHERE type='%s' LIMIT 1", array($_POST['title']), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 0) { // Add now - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_payout_types` + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_payout_types` (type, rate, min_points, from_account, from_pass, engine_url, engine_ret_ok, engine_ret_failed, pass_enc, allow_url) VALUES ('%s', %d, %d,'%s','%s','%s','%s','%s','%s','%s')", array( @@ -74,7 +74,7 @@ VALUES ('%s', %d, %d,'%s','%s','%s','%s','%s','%s','%s')", } // Payout requests by your members -$result_mem = SQL_QUERY("SELECT id FROM `{!MYSQL_PREFIX!}_user_payouts` WHERE status='NEW' ORDER BY payout_timestamp DESC", __FILE__, __LINE__); +$result_mem = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_user_payouts` WHERE status='NEW' ORDER BY payout_timestamp DESC", __FILE__, __LINE__); $display = true; if ((isset($_POST['edit'])) && (SELECTION_COUNT($_POST['sel']) > 0)) { @@ -88,7 +88,7 @@ if ((isset($_POST['edit'])) && (SELECTION_COUNT($_POST['sel']) > 0)) { // Edit only if something is entered if ((!empty($_POST['title'][$id])) && ($_POST['rate'][$id] > 0)) { // Update entry - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_payout_types` SET + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_payout_types` SET type='%s', rate=%s, min_points=%s, @@ -108,7 +108,7 @@ WHERE id='".$id."' LIMIT 1", $SW = 2; $OUT = ""; foreach ($_POST['sel'] as $id => $sel) { // Load data - $result = SQL_QUERY_ESC("SELECT type, rate, min_points, allow_url FROM `{!MYSQL_PREFIX!}_payout_types` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT type, rate, min_points, allow_url FROM `{!_MYSQL_PREFIX!}_payout_types` WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); list($title, $rate, $mpoi, $allow) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -137,7 +137,7 @@ WHERE id='".$id."' LIMIT 1", if ((isset($_GET['ok'])) && ($_GET['ok'] == "ok")) { // Delete entries foreach ($_POST['sel'] as $id => $sel) { - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_payout_types` WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_payout_types` WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); } $msg = ADMIN_PAYOUT_ENTRIES_DELETED; @@ -149,7 +149,7 @@ WHERE id='".$id."' LIMIT 1", $id = bigintval($id); // Load data - $result = SQL_QUERY_ESC("SELECT type, rate, min_points FROM `{!MYSQL_PREFIX!}_payout_types` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT type, rate, min_points FROM `{!_MYSQL_PREFIX!}_payout_types` WHERE id=%s LIMIT 1", array($id), __FILE__, __LINE__); list($title, $rate, $mpoi) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -180,7 +180,7 @@ if (!empty($msg)) { } // Payout types -$result_type = SQL_QUERY("SELECT id, type, rate, min_points, from_account FROM `{!MYSQL_PREFIX!}_payout_types` ORDER BY type", __FILE__, __LINE__); +$result_type = SQL_QUERY("SELECT id, type, rate, min_points, from_account FROM `{!_MYSQL_PREFIX!}_payout_types` ORDER BY type", __FILE__, __LINE__); if ((SQL_NUMROWS($result_type) > 0) && ($display)) { // List all payout types @@ -212,10 +212,10 @@ if ((SQL_NUMROWS($result_type) > 0) && ($display)) { // Does your members request payouts? if ((SQL_NUMROWS($result_mem) > 0) && ($display)) { // Members has requested payouts - LOAD_TEMPLATE("admin_settings_saved", false, "".ADMIN_PAYOUT_LIST_REQUESTS."

    "); + LOAD_TEMPLATE("admin_settings_saved", false, "".ADMIN_PAYOUT_LIST_REQUESTS."

    "); } elseif ($display) { // No member requests so far - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_PAYOUT_NO_MEMBER_REQUESTS); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_PAYOUT_NO_MEMBER_REQUESTS')); } // Free result diff --git a/inc/modules/admin/what-config_points.php b/inc/modules/admin/what-config_points.php index 357d122204..07698bc9c0 100644 --- a/inc/modules/admin/what-config_points.php +++ b/inc/modules/admin/what-config_points.php @@ -72,14 +72,14 @@ if (isset($_POST['ok'])) { switch ($_GET['sub']) { case "points": - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_config` SET points_register='".$_POST['points_register']."', points_ref='".$_POST['points_ref']."' WHERE config=0 LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_config` SET points_register='".$_POST['points_register']."', points_ref='".$_POST['points_ref']."' WHERE config=0 LIMIT 1"; break; case "ref": switch ($_GET['do']) { case "add": - $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_refdepths` (level, percents) VALUES ('".$_POST['lvl']."','".$_POST['perc']."')"; + $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_refdepths` (level, percents) VALUES ('".$_POST['lvl']."','".$_POST['perc']."')"; break; case "edit": // Change entries @@ -91,7 +91,7 @@ if (isset($_POST['ok'])) { $_POST['perc'][$id] = REVERT_COMMA($_POST['perc'][$id]); // Update entry - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_refdepths` SET level='%s', percents='%s' WHERE id=%s LIMIT 1", + 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__); } $message = REF_DEPTHS_SAVED; @@ -99,7 +99,7 @@ if (isset($_POST['ok'])) { case "del": foreach ($_POST['id'] as $id => $value) { - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_refdepths` WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); } $message = REF_DEPTHS_DELETED; @@ -114,7 +114,7 @@ if (isset($_POST['ok'])) { case "settings": $REF = bigintval($_POST['ref_payout']); - $SQLs[] = sprintf("UPDATE `{!MYSQL_PREFIX!}_config` SET + $SQLs[] = sprintf("UPDATE `{!_MYSQL_PREFIX!}_config` SET allow_direct_pay='%s', reg_points_mode='%s', ref_payout='%s' @@ -125,20 +125,20 @@ WHERE config=0 LIMIT 1", ); if ((getConfig('ref_payout') == 0) && ($_POST['ref_payout'] > 0)) { // Update account's ref_payout for "must-confirm" - $SQLs[] = sprintf("UPDATE `{!MYSQL_PREFIX!}_user_data` SET ref_payout=(%s - mails_confirmed) + $SQLs[] = sprintf("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET ref_payout=(%s - mails_confirmed) WHERE mails_confirmed < %s", $REF, $REF); } elseif ((getConfig('ref_payout') > 0) && ($_POST['ref_payout'] == 0)) { // Update account's ref_payout for "not-must-confirm" - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_user_data` SET ref_payout=0 WHERE ref_payout > 0"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_user_points` SET points=points+locked_points WHERE locked_points>0"; - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_user_points` SET locked_points=0 WHERE locked_points>0"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_user_data` SET ref_payout=0 WHERE ref_payout > 0"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_user_points` SET points=points+locked_points WHERE locked_points>0"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_user_points` SET locked_points=0 WHERE locked_points>0"; } break; } if ((isset($SQLs)) && (is_array($SQLs)) && (!empty($SQLs[0]))) { if (strpos($SQLs[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); } // END - if @@ -197,7 +197,7 @@ WHERE mails_confirmed < %s", $REF, $REF); // Delete entries $SW = 2; $OUT = ""; foreach ($_POST['sel'] as $id => $value) { - $result = SQL_QUERY_ESC("SELECT level, percents FROM `{!MYSQL_PREFIX!}_refdepths` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); list($lvl, $perc) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -222,7 +222,7 @@ WHERE mails_confirmed < %s", $REF, $REF); // Edit entries $SW = 2; $OUT = ""; foreach ($_POST['sel'] as $id => $value) { - $result = SQL_QUERY_ESC("SELECT level, percents FROM `{!MYSQL_PREFIX!}_refdepths` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); list($lvl, $perc) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -245,7 +245,7 @@ WHERE mails_confirmed < %s", $REF, $REF); LOAD_TEMPLATE("admin_points_edit"); } else { // Referal levels - $result = SQL_QUERY("SELECT id, level, percents FROM `{!MYSQL_PREFIX!}_refdepths` ORDER BY level", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id, level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` ORDER BY level", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Make referal levels editable and deletable $SW = 2; $OUT = ""; diff --git a/inc/modules/admin/what-config_proxy.php b/inc/modules/admin/what-config_proxy.php index 3a2f37ec31..9d74c9bf7a 100644 --- a/inc/modules/admin/what-config_proxy.php +++ b/inc/modules/admin/what-config_proxy.php @@ -47,7 +47,7 @@ if (isset($_POST['ok'])) { ADMIN_SAVE_SETTINGS($_POST); } else { // Invalid! - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_PROXY_SETTINGS_INVALID); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_PROXY_SETTINGS_INVALID')); } } else { // Prepare content diff --git a/inc/modules/admin/what-config_rallye_prices.php b/inc/modules/admin/what-config_rallye_prices.php index fea6546b9b..33f53536c6 100644 --- a/inc/modules/admin/what-config_rallye_prices.php +++ b/inc/modules/admin/what-config_rallye_prices.php @@ -48,13 +48,13 @@ 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) { // Ok, new price level entered! - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_rallye_prices` (rallye_id, price_level, points, info) + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_rallye_prices` (rallye_id, price_level, points, info) VALUES ('%s','%s','%s','%s')", array( bigintval($_GET['rallye']), @@ -79,7 +79,7 @@ VALUES ('%s','%s','%s','%s')", if ($SEL > 0) { // Delete selected entries foreach ($_POST['sel'] as $id => $sel) { - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_rallye_prices` WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); } @@ -95,7 +95,7 @@ VALUES ('%s','%s','%s','%s')", $id = bigintval($id); // Update entry - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_rallye_prices` SET rallye_id=%s, price_level='%s', points='%s', info='%s' WHERE id=%s LIMIT 1", + 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__); } @@ -113,7 +113,7 @@ VALUES ('%s','%s','%s','%s')", foreach ($_POST['sel'] as $id => $sel) { // Load data to selected rallye - $result = SQL_QUERY_ESC("SELECT rallye_id, price_level, points, info FROM `{!MYSQL_PREFIX!}_rallye_prices` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT rallye_id, price_level, points, info FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); list($rallye, $level, $points, $infos) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -143,7 +143,7 @@ VALUES ('%s','%s','%s','%s')", else { // Nothing selected - $content = RALLYE_NO_PRICES_SELECTED_1."".RALLYE_NO_PRICES_SELECTED_2."".RALLYE_NO_PRICES_SELECTED_3; + $content = RALLYE_NO_PRICES_SELECTED_1."".RALLYE_NO_PRICES_SELECTED_2."".RALLYE_NO_PRICES_SELECTED_3; LOAD_TEMPLATE("admin_settings_saved", false, $content); } } @@ -158,7 +158,7 @@ VALUES ('%s','%s','%s','%s')", foreach ($_POST['sel'] as $id => $sel) { // Load data to selected rallye - $result = SQL_QUERY_ESC("SELECT rallye_id, price_level, points, info FROM `{!MYSQL_PREFIX!}_rallye_prices` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT rallye_id, price_level, points, info FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); list($rallye, $level, $points, $infos) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -189,21 +189,21 @@ VALUES ('%s','%s','%s','%s')", else { // Nothing selected - $content = RALLYE_NO_PRICES_SELECTED_1."".RALLYE_NO_PRICES_SELECTED_2."".RALLYE_NO_PRICES_SELECTED_3; + $content = RALLYE_NO_PRICES_SELECTED_1."".RALLYE_NO_PRICES_SELECTED_2."".RALLYE_NO_PRICES_SELECTED_3; LOAD_TEMPLATE("admin_settings_saved", false, $content); } } else { // a rallye was selected, so check if there are already prices assigned... - $result = SQL_QUERY_ESC("SELECT id, price_level, points, info FROM `{!MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s ORDER BY price_level", + $result = SQL_QUERY_ESC("SELECT id, price_level, points, info FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s ORDER BY price_level", array(bigintval($_GET['rallye'])), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Load all prices for the selected rallye $SW = 2; $OUT = ""; - while(list($id, $level, $points, $infos) = SQL_FETCHROW($result)) + while (list($id, $level, $points, $infos) = SQL_FETCHROW($result)) { if (empty($infos)) $infos = "---"; @@ -243,7 +243,7 @@ VALUES ('%s','%s','%s','%s')", { // No rallye selected so display all available without prices $result = SQL_QUERY("SELECT d.id, d.admin_id, d.start_time, d.end_time, d.title, a.login, d.is_active -FROM `{!MYSQL_PREFIX!}_rallye_data` AS d, `{!MYSQL_PREFIX!}_admins` AS a +FROM `{!_MYSQL_PREFIX!}_rallye_data` AS d, `{!_MYSQL_PREFIX!}_admins` AS a WHERE d.admin_id=a.id ORDER BY start_time DESC", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { diff --git a/inc/modules/admin/what-config_register.php b/inc/modules/admin/what-config_register.php index 8814b810ae..21e4c6d53a 100644 --- a/inc/modules/admin/what-config_register.php +++ b/inc/modules/admin/what-config_register.php @@ -43,14 +43,14 @@ ADD_DESCR("admin", __FILE__); // Do we want to save changes? if (isset($_POST['ok'])) { foreach ($_POST['sel'] as $id => $value) { - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_must_register` SET field_required='%s' WHERE id=%s AND field_required != '%s' LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_must_register` SET field_required='%s' WHERE id=%s AND field_required != '%s' LIMIT 1", array($value, bigintval($id), $value),__FILE__, __LINE__); } LOAD_TEMPLATE("admin_settings_saved", false, REGISTER_ADMIN_CHANGES_SAVED); } // List all register values -$result = SQL_QUERY("SELECT id, field_name, field_required FROM `{!MYSQL_PREFIX!}_must_register` ORDER BY id", __FILE__, __LINE__); +$result = SQL_QUERY("SELECT id, field_name, field_required FROM `{!_MYSQL_PREFIX!}_must_register` ORDER BY `id`", __FILE__, __LINE__); $SW = 2; $OUT = ""; while (list($id, $name, $required) = SQL_FETCHROW($result)) { // Get constant value diff --git a/inc/modules/admin/what-config_rewrite.php b/inc/modules/admin/what-config_rewrite.php index 0fa42eae84..ed73ec998f 100644 --- a/inc/modules/admin/what-config_rewrite.php +++ b/inc/modules/admin/what-config_rewrite.php @@ -59,9 +59,9 @@ if (isset($_POST['ok'])) { ADMIN_SAVE_SETTINGS($_POST); } else { // Load existing modules and generate TR rows for the template - $result = SQL_QUERY("SELECT module, title FROM `{!MYSQL_PREFIX!}_mod_reg` ORDER BY module", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT module, title FROM `{!_MYSQL_PREFIX!}_mod_reg` ORDER BY module", __FILE__, __LINE__); $SW = 2; $OUT = ""; - while(list($mod, $title) = SQL_FETCHROW($result)) { + while (list($mod, $title) = SQL_FETCHROW($result)) { // Set title to three dashes when no title is supplied if (empty($title)) $title = "---"; diff --git a/inc/modules/admin/what-config_session.php b/inc/modules/admin/what-config_session.php index 79f9dd9666..9da34ffb18 100644 --- a/inc/modules/admin/what-config_session.php +++ b/inc/modules/admin/what-config_session.php @@ -47,7 +47,7 @@ if (isset($_POST['ok'])) { ADMIN_SAVE_SETTINGS($_POST); } else { // Invalid! - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SESSION_SAVE_PATH_INVALID); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_SESSION_SAVE_PATH_INVALID')); } } else { // Prepare content diff --git a/inc/modules/admin/what-config_yoomedia.php b/inc/modules/admin/what-config_yoomedia.php index f196a2838c..5171c0a622 100644 --- a/inc/modules/admin/what-config_yoomedia.php +++ b/inc/modules/admin/what-config_yoomedia.php @@ -51,7 +51,7 @@ if (isset($_POST['ok'])) { ADMIN_SAVE_SETTINGS($_POST); } else { // Config not saved - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_CONFIG_YOOMEDIA_TEST_FAILED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_CONFIG_YOOMEDIA_TEST_FAILED')); } } else { // Prepare content diff --git a/inc/modules/admin/what-del_email.php b/inc/modules/admin/what-del_email.php index 5d6784c963..a1ed1b1c45 100644 --- a/inc/modules/admin/what-del_email.php +++ b/inc/modules/admin/what-del_email.php @@ -48,7 +48,7 @@ $cnt = 0; if (!empty($_GET['mid'])) { // Load email data - $result = SQL_QUERY_ESC("SELECT id, sender, subject, url, timestamp, payment_id FROM `{!MYSQL_PREFIX!}_pool` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id, sender, subject, url, timestamp, payment_id FROM `{!_MYSQL_PREFIX!}_pool` WHERE id=%s LIMIT 1", array(bigintval($_GET['mid'])), __FILE__, __LINE__); // Delete mail only once @@ -75,11 +75,11 @@ if (!empty($_GET['mid'])) { // Load email template and send the email away $msg_user = LOAD_EMAIL_TEMPLATE("order-deleted", array(), $sender); - SEND_EMAIL($sender, MEMBER_ORDER_DELETED, $msg_user); + SEND_EMAIL($sender, getMessage('MEMBER_ORDER_DELETED'), $msg_user); // Fetch right stats_id from pool - $result_pool = SQL_QUERY_ESC("SELECT s.id FROM `{!MYSQL_PREFIX!}_user_stats` AS s -LEFT JOIN `{!MYSQL_PREFIX!}_pool` AS p + $result_pool = SQL_QUERY_ESC("SELECT s.id FROM `{!_MYSQL_PREFIX!}_user_stats` AS s +LEFT JOIN `{!_MYSQL_PREFIX!}_pool` AS p ON s.pool_id=p.id WHERE s.pool_id=%s LIMIT 1", array(bigintval($_GET['mid'])), __FILE__, __LINE__); @@ -124,7 +124,7 @@ WHERE s.pool_id=%s LIMIT 1", } } else { // No points repayed! - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NO_POINTS_REPAYED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_NO_POINTS_REPAYED')); } } else { // Points shredded! @@ -132,19 +132,19 @@ WHERE s.pool_id=%s LIMIT 1", } // Remove links from DB - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_user_links` WHERE stats_id=%s", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_links` WHERE stats_id=%s", array(bigintval($stats_id)), __FILE__, __LINE__); $cnt += SQL_AFFECTEDROWS(); // Load template for link - LOAD_TEMPLATE("admin_settings_saved", false, "".ADMIN_REMOVE_STATS_ENTRY.""); + LOAD_TEMPLATE("admin_settings_saved", false, "".ADMIN_REMOVE_STATS_ENTRY.""); } // END - if // Free the result SQL_FREERESULT($result_pool); // Delete mail from queue - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_pool` WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_pool` WHERE id=%s LIMIT 1", array(bigintval($_GET['mid'])), __FILE__, __LINE__); $cnt += SQL_AFFECTEDROWS(); @@ -152,18 +152,18 @@ WHERE s.pool_id=%s LIMIT 1", OUTPUT_HTML(sprintf(ADMIN_DELETED_MAILS_COUNT, $cnt)); } else { // Mail already deleted! - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NORMAL_MAIL_ALREADY_DELETED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_NORMAL_MAIL_ALREADY_DELETED')); } } elseif (!empty($_GET['pid'])) { // Remove stats entries - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s LIMIT 1", array(bigintval($_GET['pid'])), __FILE__, __LINE__); // Output message - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_USER_STATS_REMOVED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_USER_STATS_REMOVED')); } elseif ((!empty($_GET['bid'])) && (EXT_IS_ACTIVE("bonus"))) { // Load data from bonus mail - $result = SQL_QUERY_ESC("SELECT id, subject, url, timestamp, mails_sent FROM `{!MYSQL_PREFIX!}_bonus` WHERE id=%s", + $result = SQL_QUERY_ESC("SELECT id, subject, url, timestamp, mails_sent FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s", array(bigintval($_GET['bid'])), __FILE__, __LINE__); // Delete mail only once @@ -178,10 +178,10 @@ WHERE s.pool_id=%s LIMIT 1", $cnt = 0; // Delete bonus mail entirely from database - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1", array(bigintval($_GET['bid'])), __FILE__, __LINE__); $cnt += SQL_AFFECTEDROWS(); - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s", array(bigintval($_GET['bid'])), __FILE__, __LINE__); $cnt += SQL_AFFECTEDROWS(); @@ -196,14 +196,14 @@ WHERE s.pool_id=%s LIMIT 1", LOAD_TEMPLATE("admin_del_email_bonus"); } else { // Mail already deleted! - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BONUS_MAIL_ALREADY_DELETED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_BONUS_MAIL_ALREADY_DELETED')); } // Free result SQL_FREERESULT($result); } elseif ((!empty($_GET['nid'])) && (GET_EXT_VERSION("bonus") >= "0.8.7")) { // Load data from bonus mail - $result = SQL_QUERY_ESC("SELECT id, subject, url, timestamp FROM `{!MYSQL_PREFIX!}_bonus` WHERE id=%s", + $result = SQL_QUERY_ESC("SELECT id, subject, url, timestamp FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s", array(bigintval($_GET['nid'])), __FILE__, __LINE__); // Delete mail only once @@ -216,10 +216,10 @@ WHERE s.pool_id=%s LIMIT 1", $cnt = 0; // Delete bonus mail entirely from database - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1", array(bigintval($_GET['nid'])), __FILE__, __LINE__); $cnt += SQL_AFFECTEDROWS(); - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s", array(bigintval($_GET['nid'])), __FILE__, __LINE__); $cnt += SQL_AFFECTEDROWS(); @@ -234,11 +234,11 @@ WHERE s.pool_id=%s LIMIT 1", LOAD_TEMPLATE("admin_del_email_notify"); } else { // Mail already deleted! - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NOTIFY_MAIL_ALREADY_DELETED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_NOTIFY_MAIL_ALREADY_DELETED')); } } else { // No mail orders fond - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_WRONG_CALL); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_WRONG_CALL')); } // diff --git a/inc/modules/admin/what-del_holiday.php b/inc/modules/admin/what-del_holiday.php index 3295a77753..2e4bc33e4a 100644 --- a/inc/modules/admin/what-del_holiday.php +++ b/inc/modules/admin/what-del_holiday.php @@ -53,7 +53,7 @@ if ($SUM > 0) { // Get the userid $result = SQL_QUERY_ESC("SELECT userid, holiday_start, holiday_end -FROM `{!MYSQL_PREFIX!}_user_holidays` +FROM `{!_MYSQL_PREFIX!}_user_holidays` WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { @@ -62,12 +62,12 @@ WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); SQL_FREERESULT($result); // Update user's account - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET holiday_active='N', holiday_activated='0' WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); // Remove holiday - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_user_holidays` + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_holidays` WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); // Prepare loaded data for the @@ -91,7 +91,7 @@ WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); // Fetch data $result_load = SQL_QUERY_ESC("SELECT holiday_start AS start, holiday_end AS end -FROM `{!MYSQL_PREFIX!}_user_holidays` +FROM `{!_MYSQL_PREFIX!}_user_holidays` WHERE userid=%s LIMIT 1", array(bigintval($_GET['u_id'])), __FILE__, __LINE__); if (SQL_NUMROWS($result_load) == 1) { @@ -103,7 +103,7 @@ WHERE userid=%s LIMIT 1", array(bigintval($_GET['u_id'])), __FILE__, __LINE__); unset($content[1]); // Delete one holiday request (for task) - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_user_holidays` + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_holidays` WHERE userid=%s LIMIT 1", array(bigintval($_GET['u_id'])), __FILE__, __LINE__); // Send email to user diff --git a/inc/modules/admin/what-del_sponsor.php b/inc/modules/admin/what-del_sponsor.php index 5f01a8358c..fb7df510b6 100644 --- a/inc/modules/admin/what-del_sponsor.php +++ b/inc/modules/admin/what-del_sponsor.php @@ -42,7 +42,7 @@ ADD_DESCR("admin", __FILE__); if (!empty($_GET['id'])) { // Check for selected sponsor - $result = SQL_QUERY_ESC("SELECT email, gender, surname, family FROM `{!MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT email, gender, surname, family FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' LIMIT 1", array(bigintval($_GET['id'])), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Remove sponsor @@ -60,14 +60,14 @@ if (!empty($_GET['id'])) { // Prepare message and send it away $msg = LOAD_EMAIL_TEMPLATE("del_sponsor", $_POST['reason'], bigintval($_GET['id'])); - SEND_EMAIL($email, SPONSOR_ADMIN_DEL_SUBJECT, $msg); + SEND_EMAIL($email, getMessage('SPONSOR_ADMIN_DEL_SUBJECT'), $msg); // Remove account - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' LIMIT 1", array(bigintval($_GET['id'])), __FILE__, __LINE__); // Remove orders - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_sponsor_orders` WHERE sponsorid='%s' LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_sponsor_orders` WHERE sponsorid='%s' LIMIT 1", array(bigintval($_GET['id'])), __FILE__, __LINE__); // Output message @@ -80,11 +80,11 @@ if (!empty($_GET['id'])) { list ($email, $gender, $sname, $fname) = SQL_FETCHROW($result); // Transfer data to constants for the template - define('__EMAIL', $email); - define('__SNAME', $sname); - define('__FNAME', $fname); + define('__EMAIL' , $email); + define('__SNAME' , $sname); + define('__FNAME' , $fname); define('__GENDER', TRANSLATE_GENDER($gender)); - define('__UID' , bigintval($_GET['id'])); + define('__UID' , bigintval($_GET['id'])); // Display form LOAD_TEMPLATE("admin_del_sponsor"); @@ -95,7 +95,7 @@ if (!empty($_GET['id'])) { } } else { // Not called by what-list_sponsor.php - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_CALL_NOT_DIRECTLY); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_CALL_NOT_DIRECTLY')); } // diff --git a/inc/modules/admin/what-del_transfer.php b/inc/modules/admin/what-del_transfer.php index 15d931d39f..8183fef0fc 100644 --- a/inc/modules/admin/what-del_transfer.php +++ b/inc/modules/admin/what-del_transfer.php @@ -50,22 +50,22 @@ if (isset($_POST['del'])) // Delete entries... foreach ($_POST['sel'] as $id => $sel) { - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_user_transfers_in` WHERE trans_id=%s LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_transfers_in` WHERE trans_id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_user_transfers_out` WHERE trans_id=%s LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_transfers_out` WHERE trans_id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); } } } // We only need outgoing transfers -$result = SQL_QUERY("SELECT userid, to_uid, trans_id, points, reason, time_trans FROM `{!MYSQL_PREFIX!}_user_transfers_out` ORDER BY trans_id", __FILE__, __LINE__); +$result = SQL_QUERY("SELECT userid, to_uid, trans_id, points, reason, time_trans FROM `{!_MYSQL_PREFIX!}_user_transfers_out` ORDER BY trans_id", __FILE__, __LINE__); $total = 0; if (SQL_NUMROWS($result) > 0) { // Output rows $OUT = ""; $SW = 2; - while(list($uid1, $uid2, $idx, $points, $reason, $stamp) = SQL_FETCHROW($result)) + while (list($uid1, $uid2, $idx, $points, $reason, $stamp) = SQL_FETCHROW($result)) { // Prepare data for the row template $content = array( diff --git a/inc/modules/admin/what-del_user.php b/inc/modules/admin/what-del_user.php index 732416e923..f3b27c75ff 100644 --- a/inc/modules/admin/what-del_user.php +++ b/inc/modules/admin/what-del_user.php @@ -43,7 +43,7 @@ ADD_DESCR("admin", __FILE__); // User exists.. if ((isset($_POST['ok'])) || ((isset($_POST['del'])) && (!empty($_POST['reason'])))) { // Delete users account - $result_user = SQL_QUERY_ESC("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result_user = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($_GET['u_id'])), __FILE__, __LINE__); if (SQL_NUMROWS($result_user) == 1) { // Free memory @@ -64,7 +64,7 @@ if ((isset($_POST['ok'])) || ((isset($_POST['del'])) && (!empty($_POST['reason'] ADD_MEMBER_SELECTION_BOX(); } else { // Realy want to delete? - $result = SQL_QUERY_ESC("SELECT email, surname, family FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT email, surname, family FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($_GET['u_id'])), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Load data diff --git a/inc/modules/admin/what-edit_emails.php b/inc/modules/admin/what-edit_emails.php index a31f7777cf..a02228e75a 100644 --- a/inc/modules/admin/what-edit_emails.php +++ b/inc/modules/admin/what-edit_emails.php @@ -44,11 +44,11 @@ if ((isset($_POST['ok'])) && (empty($_POST['id']))) { unset($_POST['ok']); } -$result = SQL_QUERY("SELECT id, sender, subject, payment_id, cat_id FROM `{!MYSQL_PREFIX!}_pool` ORDER BY timestamp", __FILE__, __LINE__); +$result = SQL_QUERY("SELECT id, sender, subject, payment_id, cat_id FROM `{!_MYSQL_PREFIX!}_pool` ORDER BY timestamp", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { if (isset($_POST['ok'])) { // Make mail editable... - $result = SQL_QUERY_ESC("SELECT subject, text, url FROM `{!MYSQL_PREFIX!}_pool` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT subject, text, url FROM `{!_MYSQL_PREFIX!}_pool` WHERE id=%s LIMIT 1", array(bigintval($_POST['id'])), __FILE__, __LINE__); list($subj, $text, $url) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -61,7 +61,7 @@ if (SQL_NUMROWS($result) > 0) { LOAD_TEMPLATE("admin_edit_email"); } elseif (!empty($_POST['save'])) { // Save changes - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_pool` SET + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET subject='%s', text='%s', url='%s' diff --git a/inc/modules/admin/what-edit_sponsor.php b/inc/modules/admin/what-edit_sponsor.php index 2d122ace48..73b5ab035f 100644 --- a/inc/modules/admin/what-edit_sponsor.php +++ b/inc/modules/admin/what-edit_sponsor.php @@ -42,7 +42,7 @@ ADD_DESCR("admin", __FILE__); if ((!empty($_GET['id'])) && (!empty($_GET['mode']))) { // Check for selected sponsor - $result = SQL_QUERY_ESC("SELECT company, position, gender, surname, family, street_nr1, street_nr2, zip, city, country, phone, fax, cell, email, url, tax_ident, receive_warnings, warning_interval FROM `{!MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT company, position, gender, surname, family, street_nr1, street_nr2, zip, city, country, phone, fax, cell, email, url, tax_ident, receive_warnings, warning_interval FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' LIMIT 1", array(bigintval($_GET['id'])), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Load sponsor details @@ -109,7 +109,7 @@ if ((!empty($_GET['id'])) && (!empty($_GET['mode']))) { $POINTS = strval(REVERT_COMMA($_POST['points'])); // Add points to account - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_sponsor_data` SET points_amount=points_amount+%s WHERE id='%s' LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET points_amount=points_amount+%s WHERE id='%s' LIMIT 1", array($POINTS, bigintval($_GET['id'])), __FILE__, __LINE__); // Remember points /reason for the template @@ -132,7 +132,7 @@ if ((!empty($_GET['id'])) && (!empty($_GET['mode']))) { $POINTS = strval(REVERT_COMMA($_POST['points'])); // Add points to account - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_sponsor_data` SET points_used=points_used+%s WHERE id='%s' LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET points_used=points_used+%s WHERE id='%s' LIMIT 1", array($POINTS, bigintval($_GET['id'])), __FILE__, __LINE__); // Remember points /reason for the template @@ -187,7 +187,7 @@ if ((!empty($_GET['id'])) && (!empty($_GET['mode']))) { } // END - if } elseif (FILE_READABLE(sprintf("%stemplates/%s/html/admin/%s.tpl", PATH, GET_LANGUAGE(), $TPL))) { // Create mailto link - define('__SPONSOR_VALUE', "".__SURNAME." ".__FAMILY.""); + define('__SPONSOR_VALUE', "{!__SURNAME!} {!__FAMILY!}"); // Load mode template LOAD_TEMPLATE($TPL); @@ -201,7 +201,7 @@ if ((!empty($_GET['id'])) && (!empty($_GET['mode']))) { } } else { // Not called by what-list_sponsor.php - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_CALL_NOT_DIRECTLY); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_CALL_NOT_DIRECTLY')); } // diff --git a/inc/modules/admin/what-edit_user.php b/inc/modules/admin/what-edit_user.php index 32d8a67535..f3d5863266 100644 --- a/inc/modules/admin/what-edit_user.php +++ b/inc/modules/admin/what-edit_user.php @@ -45,7 +45,7 @@ $result_main = false; if (isset($_GET['u_id'])) { // 0 1 2 3 4 5 6 7 8 9 10 11 $result_main = SQL_QUERY_ESC("SELECT gender, surname, family, street_nr, zip, city, country, email, birth_day, birth_month, birth_year, max_mails -FROM `{!MYSQL_PREFIX!}_user_data` +FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($_GET['u_id'])), __FILE__, __LINE__); @@ -77,7 +77,7 @@ if ((SQL_NUMROWS($result_main) == 1) || (empty($_GET['u_id']))) if ($PASS) { // We have to add the following things: birthday and max receive mails - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET gender='%s', surname='%s', family='%s', diff --git a/inc/modules/admin/what-email_archiv.php b/inc/modules/admin/what-email_archiv.php index 6f660da7ed..5aa4d53081 100644 --- a/inc/modules/admin/what-email_archiv.php +++ b/inc/modules/admin/what-email_archiv.php @@ -45,7 +45,7 @@ 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 - FROM `{!MYSQL_PREFIX!}_pool` + FROM `{!_MYSQL_PREFIX!}_pool` WHERE data_type='SEND' OR data_type='DELETED' ORDER BY timestamp DESC"; @@ -86,7 +86,7 @@ if (SQL_NUMROWS($result) > 0) while ($pool = SQL_FETCHROW($result)) { // Check sent mails and clicks - $result_mails = SQL_QUERY_ESC("SELECT max_rec, clicks FROM `{!MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s LIMIT 1", + $result_mails = SQL_QUERY_ESC("SELECT max_rec, clicks FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s LIMIT 1", array(bigintval($pool[0])), __FILE__, __LINE__); list($sent, $clicks) = SQL_FETCHROW($result_mails); SQL_FREERESULT($result_mails); @@ -96,7 +96,7 @@ if (SQL_NUMROWS($result) > 0) if ($unconfirmed > 0) { // Add link to list_unconfirmed what-file - $unconfirmed = "".$unconfirmed.""; + $unconfirmed = "".$unconfirmed.""; } // Prepare data for the row template @@ -131,7 +131,7 @@ if (SQL_NUMROWS($result) > 0) LOAD_TEMPLATE("admin_email_archiv"); } else { // No mail orders fond - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NO_MAILS_IN_POOL); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_NO_MAILS_IN_POOL')); } // ?> diff --git a/inc/modules/admin/what-email_details.php b/inc/modules/admin/what-email_details.php index 5f90d77c1d..a2193ec131 100644 --- a/inc/modules/admin/what-email_details.php +++ b/inc/modules/admin/what-email_details.php @@ -53,7 +53,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 -FROM `{!MYSQL_PREFIX!}_pool` +FROM `{!_MYSQL_PREFIX!}_pool` WHERE data_type IN('ADMIN','TEMP','NEW','ACTIVE') ORDER BY timestamp DESC"; @@ -64,7 +64,7 @@ if (!empty($_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 - FROM `{!MYSQL_PREFIX!}_pool` + FROM `{!_MYSQL_PREFIX!}_pool` WHERE id='".bigintval($_GET['mid'])."' LIMIT 1"; $WHO = MAIL_ID.": ".$_GET['mid']; @@ -72,7 +72,7 @@ if (!empty($_GET['mid'])) { // 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 -FROM `{!MYSQL_PREFIX!}_pool` +FROM `{!_MYSQL_PREFIX!}_pool` WHERE sender='".bigintval($_GET['u_id'])."' ORDER by timestamp DESC"; $WHO = USER_ID.": ".$_GET['u_id']; @@ -82,7 +82,7 @@ if ((EXT_IS_ACTIVE("bonus")) && ($WHO == _ALL)) { // Bonus mails sent by you // 0 1 2 3 4 5 6 7 8 9 10 11 12 $SQL2 = "SELECT id, subject, text, receivers, points, time, data_type, timestamp, url, cat_id, target_send, mails_sent, clicks -FROM `{!MYSQL_PREFIX!}_bonus` +FROM `{!_MYSQL_PREFIX!}_bonus` WHERE is_notify='N' ORDER BY timestamp DESC"; @@ -125,7 +125,7 @@ if (SQL_NUMROWS($result_list) > 0) { // Walk through all entries while ($pool = SQL_FETCHARRAY($result_list)) { // Unconfirmed mails and sent mails - $result_uncon = SQL_QUERY_ESC("SELECT max_rec, clicks FROM `{!MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s LIMIT 1", + $result_uncon = SQL_QUERY_ESC("SELECT max_rec, clicks FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s LIMIT 1", array(bigintval($pool['id'])), __FILE__, __LINE__); list($pool['sent_email'], $pool['clicks']) = SQL_FETCHROW($result_uncon); SQL_FREERESULT($result_uncon); @@ -134,7 +134,7 @@ if (SQL_NUMROWS($result_list) > 0) { $pool['unconfirmed'] = $pool['sent_email'] - $pool['clicks']; if ($pool['unconfirmed'] > 0) { // Add link to list_unconfirmed what-file - $pool['unconfirmed'] = "".$pool['unconfirmed'].""; + $pool['unconfirmed'] = "".$pool['unconfirmed'].""; } elseif ($pool['unconfirmed'] < 0) { // Sometimes rarely displayed minus values will be "fixed" to zero $pool['unconfirmed'] = 0; @@ -193,7 +193,7 @@ if ((EXT_IS_ACTIVE("bonus")) && ($WHO == _ALL)) { // Add link? if ($bonus['unconfirmed'] > 0) { // Add link to list_unconfirmed what-file - $bonus['unconfirmed'] = "".$bonus['unconfirmed'].""; + $bonus['unconfirmed'] = "".$bonus['unconfirmed'].""; } // END - if // Prepare content @@ -224,7 +224,7 @@ if ((EXT_IS_ACTIVE("bonus")) && ($WHO == _ALL)) { if (!$MAIL) { // No mail orders fond - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NO_MAILS_IN_POOL); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_NO_MAILS_IN_POOL')); } // END - if // diff --git a/inc/modules/admin/what-extensions.php b/inc/modules/admin/what-extensions.php index a321662297..494b122cc5 100644 --- a/inc/modules/admin/what-extensions.php +++ b/inc/modules/admin/what-extensions.php @@ -61,7 +61,7 @@ if (!empty($_GET['reg_ext'])) { // De/activate extension $ACT = "N"; $EXT_LOAD_MODE = "deactivate"; if ($active == "N") { $ACT = "Y"; $EXT_LOAD_MODE = "activate"; } - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_extensions` SET ext_active='".$ACT."' WHERE id=%s AND ext_active='%s' LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_active='".$ACT."' WHERE id=%s AND ext_active='%s' LIMIT 1", array(bigintval($ext_id), $active), __FILE__, __LINE__); // Run embeded SQL commands @@ -83,11 +83,11 @@ if (!empty($_GET['reg_ext'])) { $active = $_POST['active'][$ext_id]; if (GET_EXT_VERSION("sql_patches") >= "0.0.6") { // Update also CSS column when extensions sql_patches is newer or exact v0.0.6 - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_extensions` SET ext_has_css='%s', ext_active='%s' WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_has_css='%s', ext_active='%s' WHERE id=%s LIMIT 1", array($_POST['css'][$ext_id], $active, $ext_id), __FILE__, __LINE__); } else { // When extension is older than v0.0.6 there is no column for the CSS information - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_extensions` SET ext_active='%s' WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_active='%s' WHERE id=%s LIMIT 1", array($active, $ext_id), __FILE__, __LINE__); } @@ -103,9 +103,7 @@ if (!empty($_GET['reg_ext'])) { } // Extensions changed - OUTPUT_HTML("

    "); - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_EXT_CHANGED); - OUTPUT_HTML("

    "); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_EXT_CHANGED')); } else { // Edit selected entries $SW = "2"; $OUT = ""; @@ -114,12 +112,12 @@ if (!empty($_GET['reg_ext'])) { if (($sel == "Y") || ($sel == "N")) { // Load required data if (GET_EXT_VERSION("sql_patches") >= "0.0.6") { - $result = SQL_QUERY_ESC("SELECT ext_name, ext_has_css, ext_active FROM `{!MYSQL_PREFIX!}_extensions` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT ext_name, ext_has_css, ext_active FROM `{!_MYSQL_PREFIX!}_extensions` WHERE id=%s LIMIT 1", array(bigintval($ext_id)), __FILE__, __LINE__); list($name, $css, $active) = SQL_FETCHROW($result); SQL_FREERESULT($result); } else { - $result = SQL_QUERY_ESC("SELECT ext_name, ext_active FROM `{!MYSQL_PREFIX!}_extensions` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT ext_name, ext_active FROM `{!_MYSQL_PREFIX!}_extensions` WHERE id=%s LIMIT 1", array(bigintval($ext_id)), __FILE__, __LINE__); list($name, $active) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -225,13 +223,13 @@ case "overview": // List all registered extensions if (GET_EXT_VERSION("sql_patches") >= "0.0.6") { // Load extension data with CSS informations $result = SQL_QUERY("SELECT id AS ext_id, ext_name, ext_active, ext_has_css AS ext_css, ext_version -FROM `{!MYSQL_PREFIX!}_extensions` +FROM `{!_MYSQL_PREFIX!}_extensions` ".$where." ORDER BY ext_name", __FILE__, __LINE__); } else { // Load extension data without CSS informations $result = SQL_QUERY("SELECT id AS ext_id, ext_name, ext_active, id, ext_version -FROM `{!MYSQL_PREFIX!}_extensions` +FROM `{!_MYSQL_PREFIX!}_extensions` ".$where." ORDER BY ext_name", __FILE__, __LINE__); } @@ -270,12 +268,12 @@ ORDER BY ext_name", __FILE__, __LINE__); LOAD_TEMPLATE("admin_extensions"); } else { // No extensions are registered - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NO_EXTENSION_REGISTERED.""); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_NO_EXTENSION_REGISTERED')); } break; case "register": // Register new extension - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_task_system` WHERE assigned_admin=%s AND task_type='EXTENSION' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_task_system` WHERE assigned_admin=%s AND task_type='EXTENSION' LIMIT 1", array(GET_CURRENT_ADMIN_ID()), __FILE__, __LINE__); $task_found = SQL_NUMROWS($result); @@ -285,7 +283,7 @@ case "register": // Register new extension // Is the ID number valid and the task was found? if (($ext_id > 0) && ($task_found == 1)) { // ID is valid so begin with registration, we first want to it's real name from task management (subject column) - $result = SQL_QUERY_ESC("SELECT subject FROM `{!MYSQL_PREFIX!}_task_system` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT subject FROM `{!_MYSQL_PREFIX!}_task_system` WHERE id=%s LIMIT 1", array(bigintval($ext_id)), __FILE__, __LINE__); list($subj) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -306,7 +304,7 @@ case "register": // Register new extension $status = EXTENSION_REGISTER($ext_name, $ext_id); if ($status == true) { // Extension was found and successfully registered - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_EXTENSION_REGISTERED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_EXTENSION_REGISTERED')); // Do we need to update cache file? if ((EXT_IS_ACTIVE("cache")) && ($cacheMode != "no")) { @@ -317,30 +315,30 @@ case "register": // Register new extension } // END - if } elseif (GET_EXT_VERSION($ext_name) != "") { // Notify the admin that we have a problem here... - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_REG_FAILED_ALREADY); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_REG_FAILED_ALREADY')); } else { // Notify the admin that we have a problem here... - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_REG_FAILED_404); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_REG_FAILED_404')); } } else { // Motify the admin that we have a problem here... - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_REG_FAILED_DEPRECATED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_REG_FAILED_DEPRECATED')); } } else { // Extension was not found in task management - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_REG_FAILED_ID_404); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_REG_FAILED_ID_404')); } } elseif ($task_found == "0") { // No longer assigned or old task - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_REG_FAILED_ASSIGED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_REG_FAILED_ASSIGED')); } else { // ID is invalid - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_REG_FAILED_INVALID); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_REG_FAILED_INVALID')); } break; case "demo": - LOAD_TEMPLATE("admin_settings_saved", false, SETTINGS_NOT_SAVED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SETTINGS_NOT_SAVED')); break; } // diff --git a/inc/modules/admin/what-guest_add.php b/inc/modules/admin/what-guest_add.php index c32ed7b60c..8e063e7757 100644 --- a/inc/modules/admin/what-guest_add.php +++ b/inc/modules/admin/what-guest_add.php @@ -51,7 +51,7 @@ if (!isset($_POST['ok'])) { $menus = array(); $titles = array(); $below = array(); // Get all available main menus - $result = SQL_QUERY("SELECT action, title, sort FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE (what='' OR what IS NULL) ORDER BY sort", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT action, title, sort FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE (what='' OR `what` IS NULL) ORDER BY `sort`", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Read menu structure while (list($act, $title, $sort) = SQL_FETCHROW($result)) { @@ -88,8 +88,8 @@ if (!isset($_POST['ok'])) { // Load sub menus :) foreach ($menus as $key_main => $value_main) { $result = SQL_QUERY_ESC("SELECT what, title, sort -FROM `{!MYSQL_PREFIX!}_guest_menu` -WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort", +FROM `{!_MYSQL_PREFIX!}_guest_menu` +WHERE action='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`", array($value_main), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { @@ -172,7 +172,7 @@ WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort", // Insert new menu entry if (!empty($_POST['menu'])) { - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('%s','%s','%s','%s','%s','%s')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('%s','%s','%s','%s','%s','%s')", array( $_POST['menu'], $_POST['name'], @@ -184,7 +184,7 @@ WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort", } else { - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_guest_menu` (action, title, sort, visible, locked) VALUES ('%s','%s','%s','%s','%s')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (action, title, sort, visible, locked) VALUES ('%s','%s','%s','%s','%s')", array( $_POST['name'], $_POST['title'], @@ -193,12 +193,12 @@ WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort", $_POST['active'], ), __FILE__, __LINE__); } - LOAD_TEMPLATE("admin_settings_saved", false, SAVING_DONE); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SETTINGS_SAVED')); } else { // Demo mode! - LOAD_TEMPLATE("admin_settings_saved", false, SETTINGS_NOT_SAVED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SETTINGS_NOT_SAVED')); } // diff --git a/inc/modules/admin/what-guestedit.php b/inc/modules/admin/what-guestedit.php index 34d8a5b12e..79bad06414 100644 --- a/inc/modules/admin/what-guestedit.php +++ b/inc/modules/admin/what-guestedit.php @@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR("admin", __FILE__); // Do we edit/delete/change main menus or sub menus? -$AND = "(what = '' OR what IS NULL)"; $SUB = ""; +$AND = "(`what` = '' OR `what` IS NULL)"; $SUB = ""; if (!empty($_GET['sub'])) { - $AND = sprintf("action='%s' AND what IS NOT NULL", SQL_ESCAPE($_GET['sub'])); + $AND = sprintf("action='%s' AND `what` IS NOT NULL", SQL_ESCAPE($_GET['sub'])); $SUB = SQL_ESCAPE($_GET['sub']); } // END - if @@ -65,7 +65,7 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) if ($confirm == 1) { $cnt++; - $result = SQL_QUERY_ESC("SELECT title, action, what FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE ".$AND." AND id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT title, action, what FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE ".$AND." AND id=%s LIMIT 1", array(bigintval($sel)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { @@ -112,7 +112,7 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) if ($confirm == 1) { $cnt++; - $result = SQL_QUERY_ESC("SELECT title FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE ".$AND." AND id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE ".$AND." AND id=%s LIMIT 1", array(bigintval($sel)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { @@ -157,20 +157,20 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) $sel = bigintval($sel); // Update entry - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET title='%s', action='%s', what='%s' WHERE ".$AND." AND id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET title='%s', action='%s', what='%s' WHERE ".$AND." AND id=%s LIMIT 1", array($menu, $_POST['sel_action'][$sel], $_POST['sel_what'][$sel], $sel),__FILE__, __LINE__); } - LOAD_TEMPLATE("admin_settings_saved", false, SAVING_DONE); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SETTINGS_SAVED')); break; case "del": // Delete menu foreach ($_POST['sel'] as $sel => $menu) { // Delete enty - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE ".$AND." AND id=%s LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE ".$AND." AND id=%s LIMIT 1", array(bigintval($sel)), __FILE__, __LINE__); } - LOAD_TEMPLATE("admin_settings_saved", false, SAVING_DONE); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SETTINGS_SAVED')); break; case "status": // Change access levels @@ -180,10 +180,10 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) $sel = bigintval($sel); // Update entry - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET visible='%s', locked='%s' WHERE ".$AND." AND id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='%s', `locked`='%s' WHERE ".$AND." AND id=%s LIMIT 1", array($_POST['visible'][$sel], $_POST['locked'][$sel], $sel), __FILE__, __LINE__); } - LOAD_TEMPLATE("admin_settings_saved", false, SAVING_DONE); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SETTINGS_SAVED')); break; default: // Unexpected action @@ -206,7 +206,7 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) if ($confirm == 1) { $cnt++; - $result = SQL_QUERY_ESC("SELECT title, visible, locked FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE ".$AND." AND id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT title, visible, locked FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE ".$AND." AND id=%s LIMIT 1", array(bigintval($sel)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { @@ -247,21 +247,21 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) // Get IDs if (!empty($_GET['w'])) { // Sub menus selected - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE action='%s' AND sort='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE action='%s' AND sort='%s' LIMIT 1", array($_GET['act'], bigintval($_GET['tid'])), __FILE__, __LINE__); list($tid) = SQL_FETCHROW($result); SQL_FREERESULT($result); - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE action='%s' AND sort='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE action='%s' AND sort='%s' LIMIT 1", array($_GET['act'], bigintval($_GET['fid'])), __FILE__, __LINE__); list($fid) = SQL_FETCHROW($result); SQL_FREERESULT($result); } else { // Main menu selected - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE (what='' OR what IS NULL) AND sort='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE (what='' OR `what` IS NULL) AND sort='%s' LIMIT 1", array(bigintval($_GET['tid'])), __FILE__, __LINE__); list($tid) = SQL_FETCHROW($result); SQL_FREERESULT($result); - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE (what='' OR what IS NULL) AND sort='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE (what='' OR `what` IS NULL) AND sort='%s' LIMIT 1", array(bigintval($_GET['fid'])), __FILE__, __LINE__); list($fid) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -269,9 +269,9 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) if ((!empty($tid)) && (!empty($fid))) { // Sort menu - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET sort='%s' WHERE ".$AND." AND id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET sort='%s' WHERE ".$AND." AND id=%s LIMIT 1", array(bigintval($_GET['tid']), bigintval($fid)), __FILE__, __LINE__); - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET sort='%s' WHERE ".$AND." AND id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET sort='%s' WHERE ".$AND." AND id=%s LIMIT 1", array(bigintval($_GET['fid']), bigintval($tid)), __FILE__, __LINE__); } // END - if } // END - if @@ -279,10 +279,10 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) // By default list menus if (empty($SUB)) { // List only main menus - $result = SQL_QUERY("SELECT `id`, `action`, `what`, `title`, `sort` FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT `id`, `action`, `what`, `title`, `sort` FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC", __FILE__, __LINE__); } else { // List sub menus - $result = SQL_QUERY_ESC("SELECT `id`, `action`, `what`, `title`, `sort` FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC", + $result = SQL_QUERY_ESC("SELECT `id`, `action`, `what`, `title`, `sort` FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC", array($SUB), __FILE__, __LINE__); } @@ -297,21 +297,17 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) while (list($id, $act, $wht, $title, $sort) = SQL_FETCHROW($result)) { $cnt++; - if (($sort == 0) || (($sort == 1) && (!empty($SUB)))) - { + if (($sort == 0) || (($sort == 1) && (!empty($SUB)))) { // Is highest position - $NAVI = "".LOWER.""; - } - elseif ($cnt == $max) - { + $NAVI = "{!LOWER!}"; + } elseif ($cnt == $max) { // Is lowest position - $NAVI = "".HIGHER.""; - } - elseif ($sort > 0) - { + $NAVI = "{!HIGHER!}"; + } elseif ($sort > 0) { // Anything else between highest and lowest - $NAVI = "".HIGHER."/".LOWER.""; + $NAVI = "{!HIGHER!}/{!LOWER!}"; } + if (empty($act)) $act = " "; if (empty($wht)) $wht = " "; if (empty($title)) $title = " "; @@ -334,11 +330,9 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) // Load template LOAD_TEMPLATE("admin_gmenu_edit"); - } - else - { + } else { // Menu entries are missing... (???) - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NO_MENUS_FOUND); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_NO_MENUS_FOUND')); } } diff --git a/inc/modules/admin/what-list_autopurge.php b/inc/modules/admin/what-list_autopurge.php index 51fc477553..cafee4597d 100644 --- a/inc/modules/admin/what-list_autopurge.php +++ b/inc/modules/admin/what-list_autopurge.php @@ -54,7 +54,7 @@ if (GET_EXT_VERSION("holiday") >= "0.1.3") $EXCLUDE_LIST .= " AND d.holiday_acti // Check for all accounts $result = SQL_QUERY_ESC("SELECT DISTINCT d.userid, d.gender, d.surname, d.family, d.email, d.joined, d.last_online, d.ap_notified -FROM `{!MYSQL_PREFIX!}_user_data` AS d +FROM `{!_MYSQL_PREFIX!}_user_data` AS d WHERE d.status='CONFIRMED' AND d.joined < (UNIX_TIMESTAMP() - %s) AND d.last_online < (UNIX_TIMESTAMP() - %s) AND d.ap_notified < (UNIX_TIMESTAMP() - %s) ".$EXCLUDE_LIST." ORDER BY d.userid", array(getConfig('ap_inactive_since'), getConfig('ap_inactive_since'), getConfig('ap_inactive_since')), __FILE__, __LINE__); @@ -63,7 +63,7 @@ if (SQL_NUMROWS($result) > 0) { // Ok, we have found some inactive accounts $SW = 2; $OUT = ""; - while(list($uid, $gender, $sname, $fname, $email, $joined, $last, $notified) = SQL_FETCHROW($result)) + while (list($uid, $gender, $sname, $fname, $email, $joined, $last, $notified) = SQL_FETCHROW($result)) { // Prepare data for the row template $content = array( @@ -93,7 +93,7 @@ if (SQL_NUMROWS($result) > 0) else { // All members are active or you don't have any registered - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_AUTOPURGE_ALL_ACTIVE); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_AUTOPURGE_ALL_ACTIVE')); } // ?> diff --git a/inc/modules/admin/what-list_bank_package.php b/inc/modules/admin/what-list_bank_package.php index 1ca2d5a974..413c3cba79 100644 --- a/inc/modules/admin/what-list_bank_package.php +++ b/inc/modules/admin/what-list_bank_package.php @@ -75,8 +75,8 @@ if (!$show) return; // Load all banking packages from DB $result = SQL_QUERY("SELECT id, title, description, account_fee AS 'fee', package_active AS 'active', interest_plus AS 'plus', interest_minus AS 'minus' -FROM `{!MYSQL_PREFIX!}_bank_packages` -ORDER BY id", __FILE__, __LINE__); +FROM `{!_MYSQL_PREFIX!}_bank_packages` +ORDER BY `id`", __FILE__, __LINE__); // Is there at lease one package? if (SQL_NUMROWS($result) > 0) { @@ -102,7 +102,7 @@ if (SQL_NUMROWS($result) > 0) { LOAD_TEMPLATE("admin_list_bank_package"); } else { // No packages found! - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BANK_NO_PACKAGES_FOUND); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_BANK_NO_PACKAGES_FOUND')); } // Free the result diff --git a/inc/modules/admin/what-list_beg.php b/inc/modules/admin/what-list_beg.php index af0d7d96fb..8619711604 100644 --- a/inc/modules/admin/what-list_beg.php +++ b/inc/modules/admin/what-list_beg.php @@ -46,8 +46,7 @@ if (getConfig('beg_rallye') == "Y") { $curr = date("m", time()) - 1; if (strlen($curr) == 1) $curr = "0".$curr; UPDATE_CONFIG("last_month", $curr); - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BEG_WITHDRAW_PREPARED); - OUTPUT_HTML("
    "); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_BEG_WITHDRAW_PREPARED')); } // END - if // Autopurge installed? @@ -60,7 +59,7 @@ if (getConfig('beg_rallye') == "Y") { // Check if at least one is in the active rallye $result = SQL_QUERY_ESC("SELECT userid, email, gender, surname, family, beg_points, last_online -FROM `{!MYSQL_PREFIX!}_user_data` +FROM `{!_MYSQL_PREFIX!}_user_data` WHERE status='CONFIRMED' AND beg_points > 0".$LAST." ORDER BY beg_points DESC, last_online DESC, userid", array($ONLINE), __FILE__, __LINE__); @@ -68,7 +67,7 @@ ORDER BY beg_points DESC, last_online DESC, userid", if (SQL_NUMROWS($result) > 0) { // List users $OUT = "";$SW = 2; $cnt = 1; $total = 0; - while(list($uid, $email, $gender, $sname, $fname, $turbo, $last) = SQL_FETCHROW($result)) { + while (list($uid, $email, $gender, $sname, $fname, $turbo, $last) = SQL_FETCHROW($result)) { // Init variables $WIN1 = ""; $WIN2 = ""; if ($cnt <= getConfig('beg_ranks')) { @@ -105,7 +104,7 @@ ORDER BY beg_points DESC, last_online DESC, userid", define('__BEG_WITHDRAW_FORM', LOAD_TEMPLATE("admin_list_beg_form", true)); } else { // Display message "no manual withdraw possible" - define('__BEG_WITHDRAW_FORM', "
    ".ADMIN_BEG_ALREADY_WITHDRAW."
    "); + define('__BEG_WITHDRAW_FORM', "
    {!ADMIN_BEG_ALREADY_WITHDRAW!}
    "); } // Prepare constant for timemark @@ -119,11 +118,11 @@ ORDER BY beg_points DESC, last_online DESC, userid", LOAD_TEMPLATE("admin_list_beg"); } else { // No one has joined the begging rallye... - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BEG_NO_RALLYE); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_BEG_NO_RALLYE')); } } else { // Rallye deactivated - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BEG_RALLYE_DEACTIVATED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_BEG_RALLYE_DEACTIVATED')); } // diff --git a/inc/modules/admin/what-list_bonus.php b/inc/modules/admin/what-list_bonus.php index c99cb1b254..e170f50333 100644 --- a/inc/modules/admin/what-list_bonus.php +++ b/inc/modules/admin/what-list_bonus.php @@ -47,8 +47,7 @@ if (getConfig('bonus_active') == "Y") { $curr = date("m", time()) - 1; if (strlen($curr) == 1) $curr = "0".$curr; UPDATE_CONFIG("last_month", $curr); - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BONUS_WITHDRAW_PREPARED); - OUTPUT_HTML("
    "); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_BONUS_WITHDRAW_PREPARED')); } if (GET_EXT_VERSION("bonus") >= "0.6.9") { @@ -75,7 +74,7 @@ if (getConfig('bonus_active') == "Y") { // Check if at least one is in the active rallye $result = SQL_QUERY_ESC("SELECT userid AS uid, email, gender, surname, family, ".$USE." AS points, last_online AS last -FROM `{!MYSQL_PREFIX!}_user_data` +FROM `{!_MYSQL_PREFIX!}_user_data` WHERE status='CONFIRMED' AND ".$USE." > 0".$LAST." ORDER BY points DESC, last_online DESC, userid", array($ONLINE), __FILE__, __LINE__); @@ -119,25 +118,25 @@ ORDER BY points DESC, last_online DESC, userid", define('__BONUS_WITHDRAW_FORM', LOAD_TEMPLATE("admin_list_bonus_form", true)); } else { // Display message "no manual withdraw possible" - define('__BONUS_WITHDRAW_FORM', "
    ".ADMIN_BONUS_ALREADY_WITHDRAW."
    "); + define('__BONUS_WITHDRAW_FORM', "
    {!ADMIN_BONUS_ALREADY_WITHDRAW!}
    "); } // Prepare constant for timemark if (EXT_IS_ACTIVE("autopurge")) { define('__AUTOPURGE_TIMEOUT', MAKE_DATETIME(time() - getConfig('ap_inactive_since'), "2")); } else { - define('__AUTOPURGE_TIMEOUT', sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "autopurge")); + define('__AUTOPURGE_TIMEOUT', sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), "autopurge")); } // Load final template LOAD_TEMPLATE("admin_list_bonus"); } else { // No one has become an "activity bonus"... - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BONUS_NO_ACTIVE_RALLYE); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_BONUS_NO_ACTIVE_RALLYE')); } } else { // Aktive-Rallye not activated - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BONUS_RALLYE_DEACTIVATED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_BONUS_RALLYE_DEACTIVATED')); } // diff --git a/inc/modules/admin/what-list_cats.php b/inc/modules/admin/what-list_cats.php index 6575e66163..3307e2762f 100644 --- a/inc/modules/admin/what-list_cats.php +++ b/inc/modules/admin/what-list_cats.php @@ -43,7 +43,7 @@ ADD_DESCR("admin", __FILE__); if (!empty($_GET['u_id'])) { // Check if the user already exists - $result = SQL_QUERY_ESC("SELECT surname, family, email FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT surname, family, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($_GET['u_id'])), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Loads surname, family's name and the email address @@ -51,20 +51,20 @@ if (!empty($_GET['u_id'])) { SQL_FREERESULT($result); // Prepare constants - define('__CATS_BASE' , "".$sname." ".$fname.""); // Ok, list categories of this user - $result_cats = SQL_QUERY("SELECT id, cat FROM `{!MYSQL_PREFIX!}_cats` ORDER BY sort", __FILE__, __LINE__); + $result_cats = SQL_QUERY("SELECT id, cat FROM `{!_MYSQL_PREFIX!}_cats` ORDER BY `sort`", __FILE__, __LINE__); if (SQL_NUMROWS($result_cats) > 0) { // List categories $cnt = "1"; $SW = 2; $OUT = ""; while (list($cid, $cat) = SQL_FETCHROW($result_cats)) { // Check user's selection - $result_user = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_user_cats` WHERE userid=%s AND cat_id=%s LIMIT 1", + $result_user = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE userid=%s AND cat_id=%s LIMIT 1", array(bigintval($_GET['u_id']), bigintval($cid)), __FILE__, __LINE__); // Set selection diff --git a/inc/modules/admin/what-list_country.php b/inc/modules/admin/what-list_country.php index fc8fe7fbdb..8dbb524de2 100644 --- a/inc/modules/admin/what-list_country.php +++ b/inc/modules/admin/what-list_country.php @@ -43,11 +43,11 @@ ADD_DESCR("admin", __FILE__); // Add new code? if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr']))) { // Check if country code does already exist - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_countries` WHERE code='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_countries` WHERE code='%s' LIMIT 1", array(strtoupper($_POST['code'])), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 0) { // Save entry - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_countries` (code, descr, is_active) VALUES ('%s','%s','%s')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_countries` (code, descr, is_active) VALUES ('%s','%s','%s')", array(strtoupper(substr($_POST['code'], 0, 2)), $_POST['descr'], $_POST['is_active']), __FILE__, __LINE__); // Country added @@ -90,7 +90,7 @@ if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr' $OUT = ""; $SW = 2; foreach ($_POST['id'] as $id => $status) { // Load data from DB - $result = SQL_QUERY_ESC("SELECT code, descr FROM `{!MYSQL_PREFIX!}_countries` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT code, descr FROM `{!_MYSQL_PREFIX!}_countries` WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Load data @@ -134,7 +134,7 @@ if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr' if ((isset($_POST['modify'])) && (!empty($_POST['id']))) { // Modify foreach ($_POST['id'] as $id => $sel) { - $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_countries` SET code='".$_POST['code'][$id]."', descr='".$_POST['descr'][$id]."', is_active='".$_POST['is_active'][$id]."' WHERE id='".$id."' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_countries` SET code='".$_POST['code'][$id]."', descr='".$_POST['descr'][$id]."', is_active='".$_POST['is_active'][$id]."' WHERE id='".$id."' LIMIT 1"; } // Create message @@ -142,7 +142,7 @@ if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr' } elseif ((isset($_POST['remove'])) && (!empty($_POST['id']))) { // Remove $IDs = implode(",", array_keys($_POST['id'])); - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_countries` WHERE id IN (".$IDs.") LIMIT ".count($_POST['id']).""; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_countries` WHERE id IN (".$IDs.") LIMIT ".count($_POST['id']).""; // Create message $MSG = ADMIN_COUNTRIES_REMOVED; @@ -160,11 +160,11 @@ if ((isset($_POST['add'])) && (!empty($_POST['code'])) && (!empty($_POST['descr' } // Load currenty setup country codes to list - $result = SQL_QUERY("SELECT id, code, descr, is_active FROM `{!MYSQL_PREFIX!}_countries` ORDER BY code", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id, code, descr, is_active FROM `{!_MYSQL_PREFIX!}_countries` ORDER BY code", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // List all countries $OUT = ""; $SW = 2; - while(list($id, $code, $descr, $active) = SQL_FETCHROW($result)) { + while (list($id, $code, $descr, $active) = SQL_FETCHROW($result)) { // Prepare array for the template $content = array( 'id' => $id, diff --git a/inc/modules/admin/what-list_doubler.php b/inc/modules/admin/what-list_doubler.php index 867a408900..2ad42035d9 100644 --- a/inc/modules/admin/what-list_doubler.php +++ b/inc/modules/admin/what-list_doubler.php @@ -46,7 +46,7 @@ if (empty($_GET['mode'])) { } else { // Set table title automatically if (empty($_GET['select'])) $_GET['select'] = "all"; - $eval = "define('__ADMIN_DOUBLER_LIST_".strtoupper($_GET['mode'])."', ADMIN_DOUBLER_LIST_".strtoupper($_GET['mode'])."_".strtoupper($_GET['select']).");"; + $eval = "define('__ADMIN_DOUBLER_LIST_".strtoupper($_GET['mode'])."', getMessage('ADMIN_DOUBLER_LIST_".strtoupper($_GET['mode'])."_".strtoupper($_GET['select'])."'));"; eval($eval); } @@ -59,7 +59,7 @@ case "already": // Already payed out points case "overview": // General overview page $SUM_ALREADY = 0; $SUM_WAITING = 0; // Number of direct already payouts and referal - $result = SQL_QUERY("SELECT COUNT(id) FROM `{!MYSQL_PREFIX!}_doubler` WHERE completed='Y' AND is_ref='N'", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='Y' AND is_ref='N'", __FILE__, __LINE__); list($cnt) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -72,9 +72,9 @@ case "overview": // General overview page { // Something was payed out $SUM_ALREADY += $cnt; - define('__DOUBLER_ALREADY_DIRECT_LINK', "".$cnt.""); + define('__DOUBLER_ALREADY_DIRECT_LINK', "".$cnt.""); } - $result = SQL_QUERY("SELECT COUNT(id) FROM `{!MYSQL_PREFIX!}_doubler` WHERE completed='Y' AND is_ref='Y'", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='Y' AND is_ref='Y'", __FILE__, __LINE__); list($cnt) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -87,12 +87,12 @@ case "overview": // General overview page { // Something was payed out $SUM_ALREADY += $cnt; - define('__DOUBLER_ALREADY_REF_LINK', "".$cnt.""); + define('__DOUBLER_ALREADY_REF_LINK', "".$cnt.""); } - define('__DOUBLER_ALREADY_ALL_LINK', "".$SUM_ALREADY.""); + define('__DOUBLER_ALREADY_ALL_LINK', "".$SUM_ALREADY.""); // And the same for waiting pouts (direct and referal) - $result = SQL_QUERY("SELECT COUNT(id) FROM `{!MYSQL_PREFIX!}_doubler` WHERE completed='N' AND is_ref='N'", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='N' AND is_ref='N'", __FILE__, __LINE__); list($cnt) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -105,9 +105,9 @@ case "overview": // General overview page { // Something was payed out $SUM_WAITING += $cnt; - define('__DOUBLER_WAITING_DIRECT_LINK', "".$cnt.""); + define('__DOUBLER_WAITING_DIRECT_LINK', "".$cnt.""); } - $result = SQL_QUERY("SELECT COUNT(id) FROM `{!MYSQL_PREFIX!}_doubler` WHERE completed='N' AND is_ref='Y'", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='N' AND is_ref='Y'", __FILE__, __LINE__); list($cnt) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -120,9 +120,9 @@ case "overview": // General overview page { // Something was payed out $SUM_WAITING += $cnt; - define('__DOUBLER_WAITING_REF_LINK', "".$cnt.""); + define('__DOUBLER_WAITING_REF_LINK', "".$cnt.""); } - define('__DOUBLER_WAITING_ALL_LINK', "".$SUM_WAITING.""); + define('__DOUBLER_WAITING_ALL_LINK', "".$SUM_WAITING.""); // All data is loaded here... break; diff --git a/inc/modules/admin/what-list_holiday.php b/inc/modules/admin/what-list_holiday.php index 26907e3aea..4db1e7553f 100644 --- a/inc/modules/admin/what-list_holiday.php +++ b/inc/modules/admin/what-list_holiday.php @@ -42,8 +42,8 @@ ADD_DESCR("admin", __FILE__); // Start listing holiday requests $result = SQL_QUERY("SELECT h.id, h.userid, h.holiday_start, h.holiday_end, h.comments, d.status, d.last_online -FROM `{!MYSQL_PREFIX!}_user_holidays` AS h -LEFT JOIN `{!MYSQL_PREFIX!}_user_data` AS d +FROM `{!_MYSQL_PREFIX!}_user_holidays` AS h +LEFT JOIN `{!_MYSQL_PREFIX!}_user_data` AS d ON h.userid=d.userid ORDER BY h.userid", __FILE__, __LINE__); diff --git a/inc/modules/admin/what-list_links.php b/inc/modules/admin/what-list_links.php index 8f9831e34d..e082040a13 100644 --- a/inc/modules/admin/what-list_links.php +++ b/inc/modules/admin/what-list_links.php @@ -47,7 +47,7 @@ if (empty($_GET['del'])) $_GET['del'] = ""; if (!empty($_GET['u_id'])) { // Check if the user already exists - $result = SQL_QUERY_ESC("SELECT surname, family, email FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT surname, family, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($_GET['u_id'])), __FILE__, __LINE__); // Is there an entry? @@ -59,11 +59,11 @@ if (!empty($_GET['u_id'])) { // Grab user's all unconfirmed mails if (EXT_IS_ACTIVE("bonus")) { // Load bonus ID - $result = SQL_QUERY_ESC("SELECT stats_id, bonus_id, link_type FROM `{!MYSQL_PREFIX!}_user_links` WHERE userid=%s ORDER BY id", + $result = SQL_QUERY_ESC("SELECT stats_id, bonus_id, link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE userid=%s ORDER BY `id`", array(bigintval($_GET['u_id'])), __FILE__, __LINE__); } else { // Load stats ID (2nd will be ignored later! But it is needed for the same fetchrow command) - $result = SQL_QUERY_ESC("SELECT stats_id, stats_id, link_type FROM `{!MYSQL_PREFIX!}_user_links` WHERE userid=%s ORDER BY id", + $result = SQL_QUERY_ESC("SELECT stats_id, stats_id, link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE userid=%s ORDER BY `id`", array(bigintval($_GET['u_id'])), __FILE__, __LINE__); } @@ -74,15 +74,15 @@ if (!empty($_GET['u_id'])) { // Some unconfirmed mails left if ($_GET['del'] == "all") { // Delete all unconfirmed mails by this user - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_user_links` WHERE userid=%s LIMIT %s", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_links` WHERE userid=%s LIMIT %s", array(bigintval($_GET['u_id']), $nums), __FILE__, __LINE__); // Prepare mail and send it away $msg = LOAD_EMAIL_TEMPLATE("admin-del_links", $nums, bigintval($_GET['u_id'])); - SEND_EMAIL($email, ADMIN_DEL_LINK_SUBJ, $msg); + SEND_EMAIL($email, getMessage('ADMIN_DEL_LINK_SUBJ'), $msg); // Display message - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_LINKS_DELETED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_LINKS_DELETED')); } else { // List all unconfirmed mails $SW = 2; $OUT = ""; @@ -97,17 +97,17 @@ if (!empty($_GET['u_id'])) { switch ($type) { case "NORMAL": - $result_data = SQL_QUERY_ESC("SELECT subject, timestamp_ordered, cat_id FROM `{!MYSQL_PREFIX!}_user_stats` WHERE id=%s LIMIT 1", + $result_data = SQL_QUERY_ESC("SELECT subject, timestamp_ordered, cat_id FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); $type = "mailid"; $DATA = $id; $PROBLEM = NORMAL_MAIL_PROBLEM; - $LINK = "".$id.""; + $LINK = "".$id.""; break; case "BONUS": - $result_data = SQL_QUERY_ESC("SELECT subject, timestamp, cat_id FROM `{!MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1", + $result_data = SQL_QUERY_ESC("SELECT subject, timestamp, cat_id FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1", array(bigintval($id2)), __FILE__, __LINE__); $type = "bonusid"; $DATA = $id2; $PROBLEM = BONUS_MAIL_PROBLEM; - $LINK = "".$id2.""; + $LINK = "".$id2.""; break; default: // Problem in application detected! @@ -120,7 +120,7 @@ if (!empty($_GET['u_id'])) { // Mail was found! list($subject, $timestamp, $cat) = SQL_FETCHROW($result_data); SQL_FREERESULT($result_data); - if (empty($subject)) $subject = DEFAULT_SUBJECT_LINE; + if (empty($subject)) $subject = getMessage('DEFAULT_SUBJECT_LINE'); // Prepare data for the row template $content = array( diff --git a/inc/modules/admin/what-list_newsletter.php b/inc/modules/admin/what-list_newsletter.php index f073a6d4a5..201c52a67e 100644 --- a/inc/modules/admin/what-list_newsletter.php +++ b/inc/modules/admin/what-list_newsletter.php @@ -43,7 +43,7 @@ ADD_DESCR("admin", __FILE__); if ((!empty($_POST['uid'])) && (!empty($_POST['id']))) { // Update database... // First user's account - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET nl_until=(UNIX_TIMESTAMP() + nl_timespan), nl_receive='N', nl_timespan=0 WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET nl_until=(UNIX_TIMESTAMP() + nl_timespan), nl_receive='N', nl_timespan=0 WHERE userid=%s LIMIT 1", array(bigintval($_POST['uid'])), __FILE__, __LINE__); // Next the task system... @@ -54,10 +54,10 @@ if ((!empty($_POST['uid'])) && (!empty($_POST['id']))) { SEND_EMAIL(bigintval($_POST['uid']), NL_MEMBER_DONE_SUBJECT, $msg); // Output message to admin - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NL_MEMBER_DONE); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_NL_MEMBER_DONE')); } else { // @TODO Currently under construction! - LOAD_TEMPLATE("admin_settings_saved", false, UNDER_CONSTRUCTION); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('UNDER_CONSTRUCTION')); } // diff --git a/inc/modules/admin/what-list_notifications.php b/inc/modules/admin/what-list_notifications.php index f049c28509..253a8d647c 100644 --- a/inc/modules/admin/what-list_notifications.php +++ b/inc/modules/admin/what-list_notifications.php @@ -52,7 +52,7 @@ if ((EXT_IS_ACTIVE("bonus")) && ($WHO == _ALL)) { // Bonus mails sent by you // 0 1 2 3 4 5 6 7 8 9 10 11 12 $SQL2 = "SELECT id, subject, text, receivers, points, time, data_type, timestamp, url, cat_id, target_send, mails_sent, clicks -FROM `{!MYSQL_PREFIX!}_bonus` +FROM `{!_MYSQL_PREFIX!}_bonus` WHERE is_notify='Y' ORDER BY timestamp DESC"; @@ -86,7 +86,7 @@ if ((EXT_IS_ACTIVE("bonus")) && (SQL_NUMROWS($result_max) > 0) && (!empty($SQL2) // Add link? if ($bonus['unconfirmed'] > 0) { // Add link to list_unconfirmed what-file - $bonus['unconfirmed'] = "".$bonus['unconfirmed'].""; + $bonus['unconfirmed'] = "".$bonus['unconfirmed'].""; } // END - if // Prepare content diff --git a/inc/modules/admin/what-list_payouts.php b/inc/modules/admin/what-list_payouts.php index 40a7ec0f3c..c8a623047f 100644 --- a/inc/modules/admin/what-list_payouts.php +++ b/inc/modules/admin/what-list_payouts.php @@ -42,7 +42,7 @@ ADD_DESCR("admin", __FILE__); if (!empty($_GET['pid'])) { // First let's get the member's ID - $result = SQL_QUERY_ESC("SELECT userid, target_account, payout_total, payout_timestamp, password FROM `{!MYSQL_PREFIX!}_user_payouts` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT userid, target_account, payout_total, payout_timestamp, password FROM `{!_MYSQL_PREFIX!}_user_payouts` WHERE id=%s LIMIT 1", array($_GET['pid']), __FILE__, __LINE__); list($uid, $tuid, $points, $tstamp, $tpass) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -50,7 +50,7 @@ if (!empty($_GET['pid'])) { // Obtain some data if (empty($_GET['task']) && (!empty($uid)) && ($uid > 0)) { // Get task ID from database - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_task_system` WHERE userid=%s AND task_type='PAYOUT_REQUEST' AND task_created='".$tstamp."' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_task_system` WHERE userid=%s AND task_type='PAYOUT_REQUEST' AND task_created='".$tstamp."' LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); list($task) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -65,7 +65,7 @@ if (!empty($_GET['pid'])) { if ((!empty($task)) && (!empty($uid)) && ($uid > 0)) { // Load user's data - $result = SQL_QUERY_ESC("SELECT email, gender, surname, family FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT email, gender, surname, family FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); list($email, $gender, $surname, $family) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -77,14 +77,14 @@ if (!empty($_GET['pid'])) { // Ok, now we can output the form or execute accepting if (isset($_POST['ok'])) { // Obtain payout type and other data - $result = SQL_QUERY_ESC("SELECT payout_id FROM `{!MYSQL_PREFIX!}_user_payouts` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT payout_id FROM `{!_MYSQL_PREFIX!}_user_payouts` WHERE id=%s LIMIT 1", array(bigintval($_GET['pid'])), __FILE__, __LINE__); list($ptype) = SQL_FETCHROW($result); SQL_FREERESULT($result); if (!empty($ptype)) { // Obtain data from payout type - $result = SQL_QUERY_ESC("SELECT from_account, from_pass, engine_url, engine_ret_ok, engine_ret_failed, pass_enc, allow_url FROM `{!MYSQL_PREFIX!}_payout_types` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT from_account, from_pass, engine_url, engine_ret_ok, engine_ret_failed, pass_enc, allow_url FROM `{!_MYSQL_PREFIX!}_payout_types` WHERE id=%s LIMIT 1", array(bigintval($ptype)), __FILE__, __LINE__); list($fuid, $fpass, $eurl, $eok, $failed, $eenc, $allow) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -126,7 +126,7 @@ if (!empty($_GET['pid'])) { } // Clear payout request - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_payouts` SET status='ACCEPTED' WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_payouts` SET status='ACCEPTED' WHERE id=%s LIMIT 1", array(bigintval($_GET['pid'])), __FILE__, __LINE__); // Send out mail @@ -165,7 +165,7 @@ if (!empty($_GET['pid'])) { } // Clear payout request - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_payouts` SET status='REJECTED' WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_payouts` SET status='REJECTED' WHERE id=%s LIMIT 1", array(bigintval($_GET['pid'])), __FILE__, __LINE__); // Send out mail @@ -192,12 +192,12 @@ if (!empty($_GET['pid'])) { if (empty($_GET['do'])) $_GET['do'] = ""; if ($_GET['do'] == "delete") { // Delete all requests - $result = SQL_QUERY("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_user_payouts`", __FILE__, __LINE__); + $result = SQL_QUERY("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_payouts`", __FILE__, __LINE__); } // Search for payouts $result = SQL_QUERY("SELECT p.id, p.userid AS uid, p.payout_total, p.target_account, p.target_bank, t.type, p.payout_timestamp, p.status, t.allow_url AS allow, p.target_url AS url, p.link_text AS alt, p.banner_url AS banner -FROM `{!MYSQL_PREFIX!}_user_payouts` AS p, `{!MYSQL_PREFIX!}_payout_types` AS t +FROM `{!_MYSQL_PREFIX!}_user_payouts` AS p, `{!_MYSQL_PREFIX!}_payout_types` AS t WHERE p.payout_id=t.id ORDER BY p.payout_timestamp DESC", __FILE__, __LINE__); @@ -207,7 +207,7 @@ ORDER BY p.payout_timestamp DESC", __FILE__, __LINE__); while (list($pid, $uid, $total, $account, $bank, $type, $tstamp, $status, $allow, $url, $alt, $banner) = SQL_FETCHROW($result)) { if ($status == "NEW") { // Generate links for direct accepting and rejecting - $status = "".PAYOUT_ACCEPT_PAYOUT." | ".PAYOUT_REJECT_PAYOUT.""; + $status = "".PAYOUT_ACCEPT_PAYOUT." | ".PAYOUT_REJECT_PAYOUT.""; } else { // Translate status $status = constant('PAYOUT_STATUS_'.strtoupper($status).''); diff --git a/inc/modules/admin/what-list_primera.php b/inc/modules/admin/what-list_primera.php index a416d9ca89..93dd36b03c 100644 --- a/inc/modules/admin/what-list_primera.php +++ b/inc/modules/admin/what-list_primera.php @@ -41,7 +41,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR("admin", __FILE__); // Check for entries -$result = SQL_QUERY("SELECT id, userid, primera_account, primera_amount, primera_timestamp, primera_type, primera_api_message, primera_api_status FROM `{!MYSQL_PREFIX!}_user_primera` ORDER BY primera_timestamp DESC, id DESC", +$result = SQL_QUERY("SELECT id, userid, primera_account, primera_amount, primera_timestamp, primera_type, primera_api_message, primera_api_status FROM `{!_MYSQL_PREFIX!}_user_primera` ORDER BY primera_timestamp DESC, id DESC", __FILE__, __LINE__); // Are there some entries to display? diff --git a/inc/modules/admin/what-list_rallyes.php b/inc/modules/admin/what-list_rallyes.php index 18be1d8cc0..44b4be1d7a 100644 --- a/inc/modules/admin/what-list_rallyes.php +++ b/inc/modules/admin/what-list_rallyes.php @@ -53,11 +53,11 @@ if (isset($_GET['rallye'])) switch ($_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 (isset($_GET['rallye'])) switch ($_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,11 +83,11 @@ if (isset($_GET['rallye'])) switch ($_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; } } @@ -108,11 +108,11 @@ if (isset($_GET['rallye'])) foreach ($_POST['sel'] as $id => $sel) { // Remove selected rallye entirely... - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_rallye_data` WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s", array(bigintval($id)), __FILE__, __LINE__); - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s", array(bigintval($id)), __FILE__, __LINE__); } @@ -142,7 +142,7 @@ if (isset($_GET['rallye'])) $END = mktime($_POST['end_hour'][$id] , $_POST['end_min'][$id] , $_POST['end_sec'][$id] , $_POST['end_month'][$id] , $_POST['end_day'][$id] , $_POST['end_year'][$id] ); // Update entry - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_rallye_data` SET + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET title='%s', descr='%s', template='%s', @@ -171,7 +171,7 @@ if (isset($_POST['edit'])) foreach ($_POST['sel'] as $id => $sel) { // Load rallye basic data - $result = SQL_QUERY_ESC("SELECT title, descr, template, start_time, end_time, min_users, min_prices FROM `{!MYSQL_PREFIX!}_rallye_data` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT title, descr, template, start_time, end_time, min_users, min_prices FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); list($title, $descr, $templ, $start, $end, $min_users, $min_prices) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -220,7 +220,7 @@ if (isset($_POST['edit'])) } } elseif (($_GET['sub'] == "users") && ($_GET['rallye'] > 0)) { // List users and their refs before start and current - $result = SQL_QUERY_ESC("SELECT userid, refs, curr_points FROM `{!MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s ORDER BY userid", + $result = SQL_QUERY_ESC("SELECT userid, refs, curr_points FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s ORDER BY userid", array(bigintval($_GET['rallye'])), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { @@ -275,7 +275,7 @@ if (isset($_POST['edit'])) { // Start listing rallyes $result = SQL_QUERY("SELECT id, admin_id, title, descr, template, start_time, end_time, auto_add_new_user, is_active, send_notify, notified, min_users, min_prices -FROM `{!MYSQL_PREFIX!}_rallye_data` +FROM `{!_MYSQL_PREFIX!}_rallye_data` ORDER BY start_time DESC", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) @@ -288,11 +288,11 @@ ORDER BY start_time DESC", $alogin = GET_ADMIN_LOGIN($aid); // Count assigned prices - $result_prices = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s", + $result_prices = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s", array(bigintval($id)), __FILE__, __LINE__); // Count joined userids - $result_user = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s", + $result_user = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s", array($id), __FILE__, __LINE__); $joined = SQL_NUMROWS($result_user); @@ -300,7 +300,7 @@ ORDER BY start_time DESC", if ($joined > 0) { // List joined users - $joined = "".$joined.""; + $joined = "".$joined.""; } // Alter some variables diff --git a/inc/modules/admin/what-list_refs.php b/inc/modules/admin/what-list_refs.php index a1de804b17..02431f9d58 100644 --- a/inc/modules/admin/what-list_refs.php +++ b/inc/modules/admin/what-list_refs.php @@ -51,7 +51,7 @@ if (!empty($_GET['u_id'])) { $uid = bigintval($_GET['u_id']); // Check if the user already exists - $result_user = SQL_QUERY_ESC("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result_user = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($uid), __FILE__, __LINE__); // User found? @@ -60,14 +60,14 @@ if (!empty($_GET['u_id'])) { if (EXT_IS_ACTIVE("refback")) { // Load all referal levels $result_levels = SQL_QUERY("SELECT level, percents -FROM `{!MYSQL_PREFIX!}_refdepths` +FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE level > 0 ORDER BY level ASC", __FILE__, __LINE__); } else { // Loads surname, family's name and the email address - $result = SQL_QUERY_ESC("SELECT COUNT(*) FROM `{!MYSQL_PREFIX!}_user_data` WHERE refid=%s", + $result = SQL_QUERY_ESC("SELECT COUNT(*) FROM `{!_MYSQL_PREFIX!}_user_data` WHERE refid=%s", array($uid), __FILE__, __LINE__); - $result_lck = SQL_QUERY_ESC("SELECT COUNT(*) FROM `{!MYSQL_PREFIX!}_user_data` WHERE refid=%s AND status != 'CONFIRMED' ORDER BY userid", + $result_lck = SQL_QUERY_ESC("SELECT COUNT(*) FROM `{!_MYSQL_PREFIX!}_user_data` WHERE refid=%s AND status != 'CONFIRMED' ORDER BY userid", array($uid), __FILE__, __LINE__); $menge = SQL_RESULT($result , 0, 0); $menge_lck = SQL_RESULT($result_lck, 0, 0); @@ -77,7 +77,7 @@ ORDER BY level ASC", __FILE__, __LINE__); SQL_FREERESULT($result_lck); // Query for refs - $result_levels = SQL_QUERY_ESC("SELECT userid, gender, surname, family, email, status, joined FROM `{!MYSQL_PREFIX!}_user_data` WHERE refid=%s ORDER BY userid ASC", + $result_levels = SQL_QUERY_ESC("SELECT userid, gender, surname, family, email, status, joined FROM `{!_MYSQL_PREFIX!}_user_data` WHERE refid=%s ORDER BY userid ASC", array($uid), __FILE__, __LINE__); // Output info message @@ -95,16 +95,16 @@ ORDER BY level ASC", __FILE__, __LINE__); // Is the refback still active? ;-) if (EXT_IS_ACTIVE("refback")) { // Load all refs of this user - $result_refs = SQL_QUERY_ESC("SELECT refid FROM `{!MYSQL_PREFIX!}_user_refs` WHERE userid=%s AND level='%s' ORDER BY refid ASC", + $result_refs = SQL_QUERY_ESC("SELECT refid FROM `{!_MYSQL_PREFIX!}_user_refs` WHERE userid=%s AND level='%s' ORDER BY refid ASC", array($uid, $levels['level']), __FILE__, __LINE__); //* DEBUG: */ echo $uid."/".$levels['level']."/".SQL_NUMROWS($result_refs)."
    \n"; // Do we have levels? if (SQL_NUMROWS($result_refs) > 0) { // Loads surname, family's name and the email address - $result = SQL_QUERY_ESC("SELECT COUNT(*) FROM `{!MYSQL_PREFIX!}_user_data` WHERE refid=%s", + $result = SQL_QUERY_ESC("SELECT COUNT(*) FROM `{!_MYSQL_PREFIX!}_user_data` WHERE refid=%s", array($uid), __FILE__, __LINE__); - $result_lck = SQL_QUERY_ESC("SELECT COUNT(*) FROM `{!MYSQL_PREFIX!}_user_data` WHERE refid=%s AND status != 'CONFIRMED' ORDER BY userid", + $result_lck = SQL_QUERY_ESC("SELECT COUNT(*) FROM `{!_MYSQL_PREFIX!}_user_data` WHERE refid=%s AND status != 'CONFIRMED' ORDER BY userid", array($uid), __FILE__, __LINE__); $menge = SQL_RESULT($result , 0, 0); $menge_lck = SQL_RESULT($result_lck, 0, 0); @@ -120,7 +120,7 @@ ORDER BY level ASC", __FILE__, __LINE__); $OUT_REFS = ""; $SW = 2; while (list($refid) = SQL_FETCHROW($result_refs)) { // Query for data - $result_user = SQL_QUERY_ESC("SELECT userid, gender, surname, family, email, status, joined FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result_user = SQL_QUERY_ESC("SELECT userid, gender, surname, family, email, status, joined FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($refid), __FILE__, __LINE__); // Is the data there? @@ -129,7 +129,7 @@ ORDER BY level ASC", __FILE__, __LINE__); $data = SQL_FETCHARRAY($result_user); // Check for referals - $result_cnt = SQL_QUERY_ESC("SELECT COUNT(userid) FROM `{!MYSQL_PREFIX!}_user_data` WHERE refid=%s", + $result_cnt = SQL_QUERY_ESC("SELECT COUNT(userid) FROM `{!_MYSQL_PREFIX!}_user_data` WHERE refid=%s", array($refid), __FILE__, __LINE__); // Load refs @@ -185,7 +185,7 @@ ORDER BY level ASC", __FILE__, __LINE__); $OUT .= LOAD_TEMPLATE("admin_list_refs_level", true, $levels); } else { // Check for referals - $result_refs = SQL_QUERY_ESC("SELECT COUNT(userid) FROM `{!MYSQL_PREFIX!}_user_data` WHERE refid=%s", + $result_refs = SQL_QUERY_ESC("SELECT COUNT(userid) FROM `{!_MYSQL_PREFIX!}_user_data` WHERE refid=%s", array(bigintval($levels['userid'])), __FILE__, __LINE__); $refs_cnt = SQL_RESULT($result_refs, 0, 0); SQL_FREERESULT($result_refs); @@ -228,10 +228,10 @@ ORDER BY level ASC", __FILE__, __LINE__); } } elseif (EXT_IS_ACTIVE("refback")) { // No levels found, very bad! - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NO_REF_LEVELS); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_NO_REF_LEVELS')); } else { // No refs made so far - LOAD_TEMPLATE("admin_settings_saved", false, USER_REF_404); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('USER_REF_404')); } // Free result diff --git a/inc/modules/admin/what-list_sponsor.php b/inc/modules/admin/what-list_sponsor.php index 9d10f75b9a..55d8a954db 100644 --- a/inc/modules/admin/what-list_sponsor.php +++ b/inc/modules/admin/what-list_sponsor.php @@ -43,7 +43,7 @@ ADD_DESCR("admin", __FILE__); if (!empty($_GET['id'])) { // Show detailed informations to a sponsor $result = SQL_QUERY_ESC("SELECT company, position, gender, surname, family, street_nr1, street_nr2, zip, city, country, phone, fax, cell, email, url, tax_ident, status, sponsor_created, last_online, last_change, receive_warnings, points_amount, points_used, remote_addr, warning_interval, refid, ref_count -FROM `{!MYSQL_PREFIX!}_sponsor_data` +FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' LIMIT 1", array(bigintval($_GET['id'])), __FILE__, __LINE__); @@ -58,7 +58,7 @@ WHERE id='%s' LIMIT 1", } // Check for sponsor's orders (only count) - $result_orders = SQL_QUERY_ESC("SELECT COUNT(id) FROM `{!MYSQL_PREFIX!}_sponsor_orders` WHERE sponsorid='%s'", + $result_orders = SQL_QUERY_ESC("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_sponsor_orders` WHERE sponsorid='%s'", array(bigintval($_GET['id'])), __FILE__, __LINE__); list($orders) = SQL_FETCHROW($result_orders); SQL_FREERESULT($result_orders); @@ -113,7 +113,7 @@ WHERE id='%s' LIMIT 1", } } elseif (!empty($_GET['rid'])) { // Search for sponsor - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' LIMIT 1", array(bigintval($_GET['rid'])), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Free memory @@ -121,8 +121,8 @@ WHERE id='%s' LIMIT 1", // Sponsor found so let's list all his referals $result = SQL_QUERY_ESC("SELECT id, gender, surname, family, email, status, sponsor_created, last_online, points_amount, points_used, remote_addr, ref_count -FROM `{!MYSQL_PREFIX!}_sponsor_data` -WHERE refid='%s' ORDER BY id", +FROM `{!_MYSQL_PREFIX!}_sponsor_data` +WHERE refid='%s' ORDER BY `id`", array(bigintval($_GET['rid'])), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { @@ -131,7 +131,7 @@ WHERE refid='%s' ORDER BY id", SQL_FREERESULT($result); } else { // No refs made so far - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SPONSOR_REFS_404_1."".bigintval($_GET['rid'])."".ADMIN_SPONSOR_REFS_404_2); + LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SPONSOR_REFS_404_1."".bigintval($_GET['rid'])."".ADMIN_SPONSOR_REFS_404_2); } } else { // Sponsor not found @@ -140,11 +140,11 @@ WHERE refid='%s' ORDER BY id", } else { // List all sponsors $result_main = SQL_QUERY("SELECT id, gender, surname, family, email, status, sponsor_created, last_online, points_amount, points_used, remote_addr -FROM `{!MYSQL_PREFIX!}_sponsor_data` ORDER BY id", __FILE__, __LINE__); +FROM `{!_MYSQL_PREFIX!}_sponsor_data` ORDER BY `id`", __FILE__, __LINE__); if (SQL_NUMROWS($result_main) > 0) { // At least one sponsor found! $OUT = ""; $SW = 2; - while(list($id, $gender, $sname, $fname, $email, $status, $created, $last, $amount, $used, $ip) = SQL_FETCHROW($result_main)) { + while (list($id, $gender, $sname, $fname, $email, $status, $created, $last, $amount, $used, $ip) = SQL_FETCHROW($result_main)) { // Transfer data to array $content = array( 'id' => $id, @@ -173,7 +173,7 @@ FROM `{!MYSQL_PREFIX!}_sponsor_data` ORDER BY id", __FILE__, __LINE__); LOAD_TEMPLATE("admin_list_sponsor"); } else { // No sponsors registered so far - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SPONSOR_NONE_REGISTERED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_SPONSOR_NONE_REGISTERED')); } } diff --git a/inc/modules/admin/what-list_sponsor_pay.php b/inc/modules/admin/what-list_sponsor_pay.php index a274160dea..669457c5b2 100644 --- a/inc/modules/admin/what-list_sponsor_pay.php +++ b/inc/modules/admin/what-list_sponsor_pay.php @@ -64,7 +64,7 @@ if (isset($_POST['add'])) { $id = bigintval($id); // Save entry - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_sponsor_paytypes` + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_paytypes` SET pay_name='%s', pay_rate='%s', pay_min_count='%s', pay_currency='%s' WHERE id='%s' LIMIT 1", array($_POST['name'][$id], $_POST['rate'][$id], bigintval($_POST['min'][$id]), $_POST['curr'][$id], $id), __FILE__, __LINE__); @@ -76,7 +76,7 @@ SET pay_name='%s', pay_rate='%s', pay_min_count='%s', pay_currency='%s' WHERE id // Remove entries here... foreach ($_POST['id'] as $id => $sel) { // Remove entry - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_sponsor_paytypes` WHERE id='%s' LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes` WHERE id='%s' LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); } @@ -93,11 +93,11 @@ SET pay_name='%s', pay_rate='%s', pay_min_count='%s', pay_currency='%s' WHERE id if (isset($_POST['add'])) { // Check if entry with same name does exists - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_sponsor_paytypes` WHERE pay_name='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes` WHERE pay_name='%s' LIMIT 1", array($_POST['pay_name']), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 0) { // No entry found so add this line - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_sponsor_paytypes` (pay_name, pay_rate, pay_min_count, pay_currency) + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_paytypes` (pay_name, pay_rate, pay_min_count, pay_currency) VALUES ('%s','%s','%s','%s')", array(htmlspecialchars($_POST['pay_name']), REVERT_COMMA($_POST['pay_rate']), bigintval($_POST['pay_min_count']), htmlspecialchars($_POST['pay_currency'])), __FILE__, __LINE__); @@ -120,7 +120,7 @@ if (isset($_POST['add'])) { $OUT = ""; $SW = 2; foreach ($_POST['id'] as $id => $sel) { // Load entry - $result = SQL_QUERY_ESC("SELECT pay_name, pay_rate, pay_min_count, pay_currency FROM `{!MYSQL_PREFIX!}_sponsor_paytypes` WHERE id='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT pay_name, pay_rate, pay_min_count, pay_currency FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes` WHERE id='%s' LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Load data @@ -166,7 +166,7 @@ if (isset($_POST['add'])) { } } else { // Load all payment types - $result = SQL_QUERY("SELECT id, pay_name, pay_rate, pay_min_count, pay_currency FROM `{!MYSQL_PREFIX!}_sponsor_paytypes` ORDER BY pay_name", + $result = SQL_QUERY("SELECT id, pay_name, pay_rate, pay_min_count, pay_currency FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes` ORDER BY pay_name", __FILE__, __LINE__); // Do we have some paytypes setup? @@ -175,7 +175,7 @@ if (isset($_POST['add'])) { $SW = 2; $OUT = ""; // List alle found payment types - while(list($id, $name, $rate, $min, $currency) = SQL_FETCHROW($result)) { + while (list($id, $name, $rate, $min, $currency) = SQL_FETCHROW($result)) { // Remember data in array $content = array( 'sw' => $SW, diff --git a/inc/modules/admin/what-list_sponsor_pays.php b/inc/modules/admin/what-list_sponsor_pays.php index 56222cd12b..c5ff148753 100644 --- a/inc/modules/admin/what-list_sponsor_pays.php +++ b/inc/modules/admin/what-list_sponsor_pays.php @@ -42,7 +42,7 @@ ADD_DESCR("admin", __FILE__); if (!empty($_GET['id'])) { // Check for selected sponsor - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' LIMIT 1", array(bigintval($_GET['id'])), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // ... @@ -54,7 +54,7 @@ if (!empty($_GET['id'])) { } } else { // Not called by what-list_sponsor.php - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_CALL_NOT_DIRECTLY); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_CALL_NOT_DIRECTLY')); } // diff --git a/inc/modules/admin/what-list_surfbar_actions.php b/inc/modules/admin/what-list_surfbar_actions.php index 95d4d87a39..3790586d9f 100644 --- a/inc/modules/admin/what-list_surfbar_actions.php +++ b/inc/modules/admin/what-list_surfbar_actions.php @@ -42,7 +42,7 @@ ADD_DESCR("admin", __FILE__); // Load all actions $result = SQL_QUERY("SELECT `id`, `status`, `action`, `new_status` -FROM `{!MYSQL_PREFIX!}_surfbar_actions` +FROM `{!_MYSQL_PREFIX!}_surfbar_actions` ORDER BY `status` ASC, `action` ASC", __FILE__, __LINE__); // Entries found? @@ -77,7 +77,7 @@ if (SQL_NUMROWS($result) > 0) { LOAD_TEMPLATE("admin_list_surfbar_actions", false, $OUT); } else { // No entries found, very bad! - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SURFBAR_NO_ACTIONS); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_SURFBAR_NO_ACTIONS')); } // Free result diff --git a/inc/modules/admin/what-list_surfbar_urls.php b/inc/modules/admin/what-list_surfbar_urls.php index 73058d30cb..aabef21732 100644 --- a/inc/modules/admin/what-list_surfbar_urls.php +++ b/inc/modules/admin/what-list_surfbar_urls.php @@ -46,7 +46,7 @@ $show = true; // Check for 'id' element if ((count($_POST) > 0) && ((!isset($_POST['id'])) || (!is_array($_POST['id'])) || (count($_POST['id']) == 0))) { // Not found so output message - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SURFBAR_NO_SELECTIONS); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_SURFBAR_NO_SELECTIONS')); // Abort here return; @@ -135,8 +135,8 @@ if (!$show) return false; // List all URLs $result = SQL_QUERY("SELECT id, userid, url, views_total, status, UNIX_TIMESTAMP(registered) AS registered, UNIX_TIMESTAMP(last_locked) AS last_locked, lock_reason -FROM `{!MYSQL_PREFIX!}_surfbar_urls` -ORDER BY id ASC", __FILE__, __LINE__); +FROM `{!_MYSQL_PREFIX!}_surfbar_urls` +ORDER BY `id` ASC", __FILE__, __LINE__); // Do we have some URLs left? if (SQL_NUMROWS($result) > 0) { @@ -164,7 +164,7 @@ if (SQL_NUMROWS($result) > 0) { LOAD_TEMPLATE("admin_list_surfbar_urls", false, $OUT); } else { // No URLs in surfbar - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SURFBAR_NO_URLS_FOUND); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_SURFBAR_NO_URLS_FOUND')); } // Free result diff --git a/inc/modules/admin/what-list_task.php b/inc/modules/admin/what-list_task.php index ff48e0d633..d30d5072ec 100644 --- a/inc/modules/admin/what-list_task.php +++ b/inc/modules/admin/what-list_task.php @@ -90,7 +90,7 @@ if (!empty($whereStatement)) } else { // Start listing tasks matching selected filter $result_tasks = SQL_QUERY("SELECT id, assigned_admin, userid, task_type, subject, text, task_created -FROM `{!MYSQL_PREFIX!}_task_system` +FROM `{!_MYSQL_PREFIX!}_task_system` WHERE ".$whereStatement." ORDER BY userid DESC, task_type DESC, subject, task_created DESC", __FILE__, __LINE__); if (($SEL > 0) && (!IS_DEMO())) { @@ -98,7 +98,7 @@ ORDER BY userid DESC, task_type DESC, subject, task_created DESC", __FILE__, __L if (isset($_POST['unassign'])) { // Unassign from tasks foreach ($_POST['task'] as $id => $sel) { - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_task_system` SET assigned_admin=0 WHERE id=%s AND assigned_admin=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET assigned_admin=0 WHERE id=%s AND assigned_admin=%s LIMIT 1", array(bigintval($id), GET_CURRENT_ADMIN_ID()), __FILE__, __LINE__); } } elseif (isset($_POST['del'])) { @@ -106,7 +106,7 @@ ORDER BY userid DESC, task_type DESC, subject, task_created DESC", __FILE__, __L foreach ($_POST['task'] as $id => $sel) { if ($_GET['type'] == "deleted") { // Delete task immediately - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_task_system` WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_task_system` WHERE id=%s LIMIT 1", array(bigintval($id)),__FILE__, __LINE__); } else { // Mark task as to be deleted (purged by autppurge extension) @@ -116,7 +116,7 @@ ORDER BY userid DESC, task_type DESC, subject, task_created DESC", __FILE__, __L } // Update query - $result_tasks = SQL_QUERY("SELECT id, assigned_admin, userid, task_type, subject, text, task_created FROM `{!MYSQL_PREFIX!}_task_system` WHERE ".$whereStatement." ORDER BY subject, task_created DESC", __FILE__, __LINE__); + $result_tasks = SQL_QUERY("SELECT id, assigned_admin, userid, task_type, subject, text, task_created FROM `{!_MYSQL_PREFIX!}_task_system` WHERE ".$whereStatement." ORDER BY subject, task_created DESC", __FILE__, __LINE__); } // There are uncompleted jobs! @@ -132,7 +132,7 @@ ORDER BY userid DESC, task_type DESC, subject, task_created DESC", __FILE__, __L if ($admin == "0") { // No admin currently is assigned - $admin = "
    ".ADMIN_NO_ADMIN_ASSIGNED."
    "; + $admin = "
    {!ADMIN_NO_ADMIN_ASSIGNED!}
    "; } else { @@ -141,7 +141,7 @@ ORDER BY userid DESC, task_type DESC, subject, task_created DESC", __FILE__, __L if ($login != "***") { // Admin found - $admin = "".$login.""; + $admin = "".$login.""; } else { diff --git a/inc/modules/admin/what-list_transfer.php b/inc/modules/admin/what-list_transfer.php index ee8319497d..c2a1d56268 100644 --- a/inc/modules/admin/what-list_transfer.php +++ b/inc/modules/admin/what-list_transfer.php @@ -41,13 +41,13 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']) || (!IS_ADMIN())) { ADD_DESCR("admin", __FILE__); // We only need outgoing transfers -$result = SQL_QUERY("SELECT userid, to_uid, trans_id, points, reason, time_trans FROM `{!MYSQL_PREFIX!}_user_transfers_out` ORDER BY trans_id", __FILE__, __LINE__); +$result = SQL_QUERY("SELECT userid, to_uid, trans_id, points, reason, time_trans FROM `{!_MYSQL_PREFIX!}_user_transfers_out` ORDER BY trans_id", __FILE__, __LINE__); $total = 0; if (SQL_NUMROWS($result) > 0) { // Output rows $OUT = ""; $SW = 2; - while(list($uid1, $uid2, $idx, $points, $reason, $stamp) = SQL_FETCHROW($result)) + while (list($uid1, $uid2, $idx, $points, $reason, $stamp) = SQL_FETCHROW($result)) { // Prepare data for the row template $content = array( diff --git a/inc/modules/admin/what-list_unconfirmed.php b/inc/modules/admin/what-list_unconfirmed.php index fb32ef6874..60b67f7a80 100644 --- a/inc/modules/admin/what-list_unconfirmed.php +++ b/inc/modules/admin/what-list_unconfirmed.php @@ -46,14 +46,13 @@ ADD_DESCR("admin", __FILE__); // Don't load the admin_list_unconfirmed template by default $listed = false; -if (!empty($_GET['mid'])) -{ +if (!empty($_GET['mid'])) { // List confirmation links from your member's mail orders define('__LIST_UNCON_TITLE', 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 -LEFT JOIN `{!MYSQL_PREFIX!}_user_stats` AS s + $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='".$_GET['mid']."' LIMIT 1"; @@ -62,34 +61,28 @@ WHERE p.id='".$_GET['mid']."' LIMIT 1"; // Load admin_list_unconfirmed template $listed = true; $DATA = $_GET['mid']; $LINK = "mailid"; -} - elseif ((!empty($_GET['bid'])) && (EXT_IS_ACTIVE("bonus"))) -{ +} elseif ((!empty($_GET['bid'])) && (EXT_IS_ACTIVE("bonus"))) { // List confirmation links from bonus mails define('__LIST_UNCON_TITLE', 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='".$_GET['bid']."' LIMIT 1"; + $SQL = "SELECT id, id, subject, text, url, timestamp, mails_sent FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id='".$_GET['bid']."' LIMIT 1"; // Column, type and ID for member's mail $col = "bonus_id"; $type = "BONUS"; $ID = $_GET['bid']; // Load admin_list_unconfirmed template $listed = true; $DATA = $ID; $LINK = "bonusid"; -} - else -{ +} else { // "Please do not call me directly." - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_CALL_NOT_DIRECTLY); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_CALL_NOT_DIRECTLY')); } // Shall I display links or not? -if ($listed) -{ +if ($listed) { // Load mail data $result = SQL_QUERY($SQL, __FILE__, __LINE__); - if (SQL_NUMROWS($result) == 1) - { + if (SQL_NUMROWS($result) == 1) { // Mail order / bonus mail found! list($stats_id, $sender, $subj, $text, $url, $stamp, $max) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -108,21 +101,19 @@ if ($listed) // accounts. So if you have delete one you did not see those links // $result = SQL_QUERY_ESC("SELECT DISTINCT l.userid, u.status, u.surname, u.family, u.gender, u.email -FROM `{!MYSQL_PREFIX!}_user_links` AS l -LEFT JOIN `{!MYSQL_PREFIX!}_user_data` AS u +FROM `{!_MYSQL_PREFIX!}_user_links` AS l +LEFT JOIN `{!_MYSQL_PREFIX!}_user_data` AS u ON l.userid=u.userid WHERE l.%s='%s' ORDER BY l.userid LIMIT %s", array($col, $ID, bigintval($max)),__FILE__, __LINE__); $unconfirmed = SQL_NUMROWS($result); define('__LIST_UNCO_UNCONFIRMED', $unconfirmed); - if ($unconfirmed > 0) - { + if ($unconfirmed > 0) { // At least one link left to confirm $OUT = LOAD_TEMPLATE("admin_list_unconfirmed_header", true); $SW = 2; - while(list($uid, $status, $sname, $fname, $gender, $email) = SQL_FETCHROW($result)) - { + while (list($uid, $status, $sname, $fname, $gender, $email) = SQL_FETCHROW($result)) { // Prepare data for the row template $content = array( 'sw' => $SW, @@ -145,47 +136,36 @@ WHERE l.%s='%s' ORDER BY l.userid LIMIT %s", // Store table rows in a constant define('__LIST_UNCON_LISTING', $OUT); - } - else - { + } else { // All links are confirmed... strange, you shall normally not get a link to this place in this scenario... hmmm. - define('__LIST_UNCON_LISTING', LOAD_TEMPLATE("admin_settings_saved", true, ADMIN_UNCONFIRMED_NO_LINK_LEFT)); + define('__LIST_UNCON_LISTING', LOAD_TEMPLATE("admin_settings_saved", true, getMessage('ADMIN_UNCONFIRMED_NO_LINK_LEFT'))); } // Load final template LOAD_TEMPLATE("admin_list_unconfirmed"); - } - elseif ($_GET['mid'] > 0) - { + } elseif ($_GET['mid'] > 0) { // Data in pool or in user_stats not found, so let's find out where data is missing - $result1 = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_pool` WHERE id=%s LIMIT 1", + $result1 = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_pool` WHERE id=%s LIMIT 1", array(bigintval($ID)), __FILE__, __LINE__); - $result2 = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s LIMIT 1", + $result2 = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s LIMIT 1", array(bigintval($ID)), __FILE__, __LINE__); - if (SQL_NUMROWS($result1) == 1) - { + if (SQL_NUMROWS($result1) == 1) { // pool table LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_UNCONFIRMED_POOL_MISSING_1.$ID.ADMIN_UNCONFIRMED_POOL_MISSING_2); - } - elseif (SQL_NUMROWS($result2) == 1) - { + } elseif (SQL_NUMROWS($result2) == 1) { // user_stats table LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_UNCONFIRMED_STATS_MISSING_1.$ID.ADMIN_UNCONFIRMED_STATS_MISSING_2); - } - else - { + } else { // both or link is invalid - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_UNCONFIRMED_INVALID_LINK); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_UNCONFIRMED_INVALID_LINK')); } // Free memory SQL_FREERESULT($result1); SQL_FREERESULT($result2); - } - elseif (!empty($_GET['bid'])) - { + } elseif (!empty($_GET['bid'])) { // Data in bonus table not found - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_UNCONFIRMED_INVALID_LINK); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_UNCONFIRMED_INVALID_LINK')); } } // diff --git a/inc/modules/admin/what-list_user.php b/inc/modules/admin/what-list_user.php index 68399a678d..ca6a77dbd3 100644 --- a/inc/modules/admin/what-list_user.php +++ b/inc/modules/admin/what-list_user.php @@ -90,7 +90,7 @@ if (empty($_GET['sortby'])) { $_GET['sortby'] = "userid"; } if (empty($_GET['page'])) { $_GET['page'] = "1"; } // Set base URL -$BASE = "[= "0.3.5") { // Lock with reason - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET status='LOCKED',lock_reason='%s',lock_timestamp=NOW() WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET status='LOCKED',lock_reason='%s',lock_timestamp=NOW() WHERE userid=%s LIMIT 1", array($_POST['reason'], bigintval($_GET['u_id'])), __FILE__, __LINE__); } else { // Lock with no lock reason saved - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET status='LOCKED' WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET status='LOCKED' WHERE userid=%s LIMIT 1", array(bigintval($_GET['u_id'])), __FILE__, __LINE__); } @@ -82,11 +82,11 @@ if (!empty($_GET['u_id'])) { // Ok, unlock the account! if (GET_EXT_VERSION("user") >= "0.3.5") { // Reset lock reason as well - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET status='CONFIRMED',lock_reason='',lock_timestamp='0000-00-00 00:00' WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET status='CONFIRMED',lock_reason='',lock_timestamp='0000-00-00 00:00' WHERE userid=%s LIMIT 1", array(bigintval($_GET['u_id'])), __FILE__, __LINE__); } else { // No lock reason to reset - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET status='CONFIRMED' WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET status='CONFIRMED' WHERE userid=%s LIMIT 1", array(bigintval($_GET['u_id'])), __FILE__, __LINE__); } @@ -96,7 +96,7 @@ if (!empty($_GET['u_id'])) { $msg = LOAD_EMAIL_TEMPLATE("unlock-user", array('text' => $_POST['reason']), bigintval($_GET['u_id'])); // Send away... - SEND_EMAIL(bigintval($_GET['u_id']), ADMIN_UNLOCKED_SUBJ, $msg); + SEND_EMAIL(bigintval($_GET['u_id']), getMessage('ADMIN_UNLOCKED_SUBJ'), $msg); if (EXT_IS_ACTIVE("rallye")) { RALLYE_AUTOADD_USER($_GET['u_id']); } // END - if @@ -113,7 +113,7 @@ if (!empty($_GET['u_id'])) { // Do not lock him... $URL = "modules.php?module=admin&what=list_user&u_id=".bigintval($_GET['u_id']); } else { - $result = SQL_QUERY_ESC("SELECT email, surname, family FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT email, surname, family FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($_GET['u_id'])), __FILE__, __LINE__); // Entry found? @@ -169,7 +169,7 @@ if (!empty($_GET['u_id'])) { if (!empty($MSG)) { LOAD_TEMPLATE("admin_settings_saved", false, "
    ".$MSG."
    "); } else { - LOAD_TEMPLATE("admin_settings_saved", false, "
    ".ADMIN_USER_UPDATED."
    "); + LOAD_TEMPLATE("admin_settings_saved", false, "
    ".getMessage('ADMIN_USER_UPDATED')."
    "); } } } else { diff --git a/inc/modules/admin/what-logs.php b/inc/modules/admin/what-logs.php index b8d50bfbc7..a4ab2a1167 100644 --- a/inc/modules/admin/what-logs.php +++ b/inc/modules/admin/what-logs.php @@ -93,7 +93,7 @@ if (!empty($_GET['access'])) { // We currenly only like files with "access" as prefix, should be more flexible! if (substr($file, 0, 6) == "access") { // Okay, let us print it out - OUTPUT_HTML("
  1. ".$file."
  2. "); + OUTPUT_HTML("
  3. ".$file."
  4. "); } } closedir($handle); diff --git a/inc/modules/admin/what-maintenance.php b/inc/modules/admin/what-maintenance.php index 282e6c679e..6ae59ecbd9 100644 --- a/inc/modules/admin/what-maintenance.php +++ b/inc/modules/admin/what-maintenance.php @@ -40,19 +40,18 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { // Add description as navigation point ADD_DESCR("admin", __FILE__); -if (isset($_POST['ok'])) -{ +if (isset($_POST['ok'])) { // De- or activate maintenance mode switch (getConfig('maintenance')) { case "Y": $target_mode = "N"; - $out = ADMIN_MAINTENANCE_DEACTIVATED; + $out = getMessage('ADMIN_MAINTENANCE_DEACTIVATED'); break; case "N": $target_mode = "Y"; - $out = ADMIN_MAINTENANCE_ACTIVATED; + $out = getMessage('ADMIN_MAINTENANCE_ACTIVATED'); break; } @@ -65,11 +64,11 @@ if (isset($_POST['ok'])) switch (getConfig('maintenance')) { case "Y": // Maintenance mode is active - define('ADMIN_MAINTENANCE_MODE', ADMIN_MAINTENANCE_MODE_IS_ACTIVE); + define('ADMIN_MAINTENANCE_MODE', getMessage('ADMIN_MAINTENANCE_MODE_IS_ACTIVE')); break; case "N": // Maintenance mode is inactive - define('ADMIN_MAINTENANCE_MODE', ADMIN_MAINTENANCE_MODE_IS_INACTIVE); + define('ADMIN_MAINTENANCE_MODE', getMessage('ADMIN_MAINTENANCE_MODE_IS_INACTIVE')); break; } // Display form diff --git a/inc/modules/admin/what-mem_add.php b/inc/modules/admin/what-mem_add.php index 0e543a4f7e..c075449cb7 100644 --- a/inc/modules/admin/what-mem_add.php +++ b/inc/modules/admin/what-mem_add.php @@ -42,23 +42,19 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR("admin", __FILE__); // Check if the admin has entered title and what-php file name... -if ((empty($_POST['title'])) && (isset($_POST['ok']))) -{ +if ((empty($_POST['title'])) && (isset($_POST['ok']))) { unset($_POST['ok']); } -if (!isset($_POST['ok'])) -{ +if (!isset($_POST['ok'])) { // Create arrays $menus = array(); $titles = array(); $below = array(); // Get all available main menus - $result = SQL_QUERY("SELECT action, title, sort FROM `{!MYSQL_PREFIX!}_member_menu` WHERE (what='' OR what IS NULL) ORDER BY sort", __FILE__, __LINE__); - if (SQL_NUMROWS($result) > 0) - { + $result = SQL_QUERY("SELECT action, title, sort FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE (what='' OR `what` IS NULL) ORDER BY `sort`", __FILE__, __LINE__); + if (SQL_NUMROWS($result) > 0) { // Read menu structure - while (list($act, $title, $sort) = SQL_FETCHROW($result)) - { + while (list($act, $title, $sort) = SQL_FETCHROW($result)) { // Menu actions $menus[] = $act; @@ -74,36 +70,32 @@ if (!isset($_POST['ok'])) // Remove double eintries $prev = ""; $dmy = $menus; $dmy2 = $titles; $dmy3 = $below; - foreach ($menus as $key => $value) - { - if ($value == $prev) - { + foreach ($menus as $key => $value) { + if ($value == $prev) { // Remove entries unset($dmy[$key]); unset($dmy2[$key]); unset($dmy3[$key]); - } - else - { + } else { $prev = $value; } } + + // Prepare variables $menus = $dmy; $titles = $dmy2; $below = $dmy3; + // Load sub menus :) - foreach ($menus as $key_main => $value_main) - { - $result = SQL_QUERY_ESC("SELECT what, title, sort FROM `{!MYSQL_PREFIX!}_member_menu` WHERE action='%s' AND what != '' ORDER BY sort", - array($value_main), __FILE__, __LINE__); - if (SQL_NUMROWS($result) > 0) - { + foreach ($menus as $key_main => $value_main) { + $result = SQL_QUERY_ESC("SELECT what, title, sort FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE action='%s' AND `what` != '' ORDER BY `sort`", + array($value_main), __FILE__, __LINE__); + if (SQL_NUMROWS($result) > 0) { // Initialize arrays $menus[$value_main] = array(); $titles[$value_main] = array(); $below[$value_main] = array(); // Read menu structure - while (list($act, $title, $sort) = SQL_FETCHROW($result)) - { + while (list($act, $title, $sort) = SQL_FETCHROW($result)) { // Menu actions $menus[$value_main][] = $act; @@ -119,16 +111,12 @@ if (!isset($_POST['ok'])) // Remove double eintries $prev = ""; $dmy = $menus[$value_main]; $dmy2 = $titles[$value_main]; $dmy3 = $below[$value_main]; - foreach ($menus[$value_main] as $key => $value) - { - if ($value == $prev) - { + foreach ($menus[$value_main] as $key => $value) { + if ($value == $prev) { unset($dmy[$key]); unset($dmy2[$key]); unset($dmy3[$key]); - } - else - { + } else { $prev = $value; } } @@ -139,25 +127,18 @@ if (!isset($_POST['ok'])) $OUT = "\n"; } diff --git a/inc/modules/admin/what-theme_import.php b/inc/modules/admin/what-theme_import.php index cc1cc05f9e..d8ab90b5c8 100644 --- a/inc/modules/admin/what-theme_import.php +++ b/inc/modules/admin/what-theme_import.php @@ -57,7 +57,7 @@ if (!empty($_POST['theme'])) { require($file); // Register it ith the exchange - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_themes` (`theme_path`, `theme_active`, `theme_ver`, `theme_name`) + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_themes` (`theme_path`, `theme_active`, `theme_ver`, `theme_name`) VALUES ('%s','N','%s','%s')", array($_POST['theme'], $THEME_VERSION, $THEME_NAME), __FILE__, __LINE__); @@ -123,10 +123,10 @@ foreach ($THEMES['theme_unix'] as $key => $unix) { // Check if current theme is already imported or not if (THEME_CHECK_EXIST($unix)) { // Already installed - $FOUND = "
    ".ADMIN_THEME_ALREADY_INSTALLED."
    "; + $FOUND = "
    {!ADMIN_THEME_ALREADY_INSTALLED!}
    "; } else { // Theme not installed - $FOUND = " + $FOUND = ""; @@ -156,7 +156,7 @@ if (empty($OUT)) { // No themes found??? $OUT .= "\n"; } // END - if diff --git a/inc/modules/admin/what-unlock_emails.php b/inc/modules/admin/what-unlock_emails.php index 45ccd127ba..b47c51cf42 100644 --- a/inc/modules/admin/what-unlock_emails.php +++ b/inc/modules/admin/what-unlock_emails.php @@ -45,7 +45,7 @@ global $DATA; // Check for mails $result_main = SQL_QUERY("SELECT `id`, `sender`, `subject`, `payment_id` AS `payment`, `timestamp`, `url`, `target_send`, `cat_id` AS `category` -FROM `{!MYSQL_PREFIX!}_pool` +FROM `{!_MYSQL_PREFIX!}_pool` WHERE `data_type`='ADMIN' ORDER BY `timestamp` ASC", __FILE__, __LINE__); @@ -69,8 +69,8 @@ if ((SQL_NUMROWS($result_main) > 0) || (isset($_POST['lock']))) { // Order placed in queue... $result = SQL_QUERY_ESC("SELECT po.url, po.subject, po.sender, pay.payment, po.payment_id -FROM `{!MYSQL_PREFIX!}_pool` AS po -INNER JOIN `{!MYSQL_PREFIX!}_payments` AS pay +FROM `{!_MYSQL_PREFIX!}_pool` AS po +INNER JOIN `{!_MYSQL_PREFIX!}_payments` AS pay ON po.payment_id=pay.id WHERE po.id=%s LIMIT 1", @@ -93,7 +93,7 @@ LIMIT 1", // Check for bonus extension version >= 0.4.4 for the order bonus if ((GET_EXT_VERSION("bonus") >= "0.4.4") && (getConfig('bonus_active') == "Y")) { // Add points directly - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET bonus_order=bonus_order+".getConfig('bonus_order')." WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET bonus_order=bonus_order+".getConfig('bonus_order')." WHERE userid=%s LIMIT 1", array(bigintval($DATA['sender'])), __FILE__, __LINE__); // Subtract bonus points from system @@ -107,7 +107,7 @@ LIMIT 1", SEND_EMAIL($DATA['sender'], MEMBER_ORDER_ACCEPTED, $msg_user); // Unlock selected email - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_pool` SET data_type='NEW' WHERE id=%s AND data_type='ADMIN' LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET data_type='NEW' WHERE id=%s AND data_type='ADMIN' LIMIT 1", array($id), __FILE__, __LINE__); } // END - if } // END - foreach @@ -130,7 +130,7 @@ LIMIT 1", $id = bigintval($id); // Load URL and subject from pool - $result = SQL_QUERY_ESC("SELECT url, subject, sender FROM `{!MYSQL_PREFIX!}_pool` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT url, subject, sender FROM `{!_MYSQL_PREFIX!}_pool` WHERE id=%s LIMIT 1", array($id), __FILE__, __LINE__); // Load data @@ -144,10 +144,10 @@ LIMIT 1", SEND_EMAIL($DATA['sender'], MEMBER_ORDER_REJECTED, $msg_user); // If you do not enter an URL to redirect to, your URL will be set! - if ((empty($_POST['redirect'])) || ($_POST['redirect'] == "http://")) $_POST['redirect'] = URL; + if ((empty($_POST['redirect'])) || ($_POST['redirect'] == "http://")) $_POST['redirect'] = constant('URL'); // Redirect URL - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_pool` SET url='%s', data_type='NEW' WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET url='%s', data_type='NEW' WHERE id=%s LIMIT 1", array($_POST['redirect'], $id),__FILE__, __LINE__); // Prepare data for the row template @@ -167,7 +167,7 @@ LIMIT 1", LOAD_TEMPLATE("admin_unlock_emails_redir"); } else { // Nothing selected - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_MAILS_NOTHING_CHECKED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_MAILS_NOTHING_CHECKED')); } } elseif ((isset($_POST['lock'])) && ($SEL > 0) && (getConfig('url_blacklist') == "Y")) { // Lock URLs @@ -176,11 +176,11 @@ LIMIT 1", $id = bigintval($id); // Lookup in blacklist - $result = SQL_QUERY_ESC("SELECT `id` FROM `{!MYSQL_PREFIX!}_url_blacklist` WHERE `url`='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_url_blacklist` WHERE `url`='%s' LIMIT 1", array($url), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 0) { // Did not find a record so we can add it... :) - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_url_blacklist` (`url`,`pool_id`) VALUES ('%s',%s)", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_url_blacklist` (`url`,`pool_id`) VALUES ('%s',%s)", array($url, $id), __FILE__, __LINE__); } // END - if @@ -189,7 +189,7 @@ LIMIT 1", } // END - foreach // Output message - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_URLS_BLOCKED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_URLS_BLOCKED')); } elseif ((empty($_POST['lock'])) && (empty($_POST['accept'])) && (empty($_POST['reject'])) && (getConfig('url_blacklist') == "Y")) { // Mail orders are in pool so we can display them $SW = 2; $OUT = ""; @@ -229,14 +229,14 @@ LIMIT 1", LOAD_TEMPLATE("admin_unlock_emails"); } elseif ((isset($_POST['lock'])) && (getConfig('url_blacklist') == "N")) { // URL blacklist not activated - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_URL_BLACKLIST_DISABLED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_URL_BLACKLIST_DISABLED')); } else { // Wrong call! - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_WRONG_CALL); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_WRONG_CALL')); } } else { // No mail orders fond - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NO_MAILS_IN_POOL); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_NO_MAILS_IN_POOL')); } // diff --git a/inc/modules/admin/what-unlock_sponsor.php b/inc/modules/admin/what-unlock_sponsor.php index 76f9303867..ae866f7c9c 100644 --- a/inc/modules/admin/what-unlock_sponsor.php +++ b/inc/modules/admin/what-unlock_sponsor.php @@ -51,7 +51,7 @@ if (isset($_POST['ok'])) { // Load his personal data $result_main = SQL_QUERY_ESC("SELECT gender, surname, family, email, remote_addr, sponsor_created, points_amount, refid -FROM `{!MYSQL_PREFIX!}_sponsor_data` +FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE status='PENDING' AND id='%s' LIMIT 1", array($id), __FILE__, __LINE__); $refid = 0; @@ -62,15 +62,15 @@ WHERE status='PENDING' AND id='%s' LIMIT 1", // Check for open payments and close them $result = SQL_QUERY_ESC("SELECT DISTINCT so.aid, so.pay_count, so.pay_ordered, so.pay_status, sp.pay_name, sp.pay_rate, sp.pay_currency -FROM `{!MYSQL_PREFIX!}_sponsor_orders` AS so -LEFT JOIN `{!MYSQL_PREFIX!}_sponsor_paytypes` AS sp +FROM `{!_MYSQL_PREFIX!}_sponsor_orders` AS so +LEFT JOIN `{!_MYSQL_PREFIX!}_sponsor_paytypes` AS sp ON sp.id=so.payid WHERE so.sponsorid='%s' ORDER BY sp.pay_name", array($id), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Payment does exist - while(list($aid, $count, $ordered, $status, $pname, $prate, $pcurr) = SQL_FETCHROW($result)) + while (list($aid, $count, $ordered, $status, $pname, $prate, $pcurr) = SQL_FETCHROW($result)) { // Set default email $email = SPONSOR_NO_ADMIN; @@ -103,14 +103,14 @@ ORDER BY sp.pay_name", SQL_FREERESULT($result_main); // Unlock sponsor account - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_sponsor_data` SET status='CONFIRMED' + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET status='CONFIRMED' WHERE id='%s' AND status='PENDING' LIMIT 1", array($id), __FILE__, __LINE__); // Update, if applyable, referal count and points if (($refid > 0) && ($refid != $id)) { // Update referal account - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_sponsor_data` + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET points_amount=points_amount+%s, ref_count=ref_count+1 WHERE id='%s' LIMIT 1", array(getConfig('sponsor_ref_points'), bigintval($refid)), __FILE__, __LINE__); @@ -120,7 +120,7 @@ WHERE id='%s' LIMIT 1", // Load referal's data $result = SQL_QUERY_ESC("SELECT id, gender, surname, family, email, (points_amount - points_used) AS points, receive_warnings, ref_count AS refs -FROM `{!MYSQL_PREFIX!}_sponsor_data` +FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' LIMIT 1", array(bigintval($refid)), __FILE__, __LINE__); $REFERRAL = SQL_FETCHARRAY($result); @@ -155,7 +155,7 @@ WHERE id='%s' LIMIT 1", } } else { // Nothing selected - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SPONSOR_NONE_SELECTED_UNLOCK); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_SPONSOR_NONE_SELECTED_UNLOCK')); } // Add seperator @@ -164,13 +164,13 @@ WHERE id='%s' LIMIT 1", // Begin listing of all pending sponsor accounts $result = SQL_QUERY("SELECT id, gender, surname, family, email, remote_addr, sponsor_created -FROM `{!MYSQL_PREFIX!}_sponsor_data` -WHERE status='PENDING' ORDER BY id", __FILE__, __LINE__); +FROM `{!_MYSQL_PREFIX!}_sponsor_data` +WHERE status='PENDING' ORDER BY `id`", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Entries found so let's list them! $OUT = ""; $SW = 2; - while(list($id, $gender, $sname, $fname, $email, $ip, $created) = SQL_FETCHROW($result)) { + while (list($id, $gender, $sname, $fname, $email, $ip, $created) = SQL_FETCHROW($result)) { // Transfer data to array $content = array( 'sw' => $SW, @@ -193,7 +193,7 @@ if (SQL_NUMROWS($result) > 0) { LOAD_TEMPLATE("admin_unlock_sponsor"); } else { // No pending accounts found - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SPONSOR_NONE_PENDING); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_SPONSOR_NONE_PENDING')); } // Free memory diff --git a/inc/modules/admin/what-unlock_surfbar_urls.php b/inc/modules/admin/what-unlock_surfbar_urls.php index a01b3c8446..78af53c22b 100644 --- a/inc/modules/admin/what-unlock_surfbar_urls.php +++ b/inc/modules/admin/what-unlock_surfbar_urls.php @@ -45,27 +45,27 @@ if ((isset($_POST['unlock'])) && (is_array($_POST['id'])) && (count($_POST['id'] // Unlock selected URLs if (SURFBAR_ADMIN_UNLOCK_URL_IDS($_POST['id'])) { // Unlock done! :-) - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SURFBAR_UNLOCK_DONE); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_SURFBAR_UNLOCK_DONE')); } else { // Unlock failed! - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SURFBAR_UNLOCK_FAILED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_SURFBAR_UNLOCK_FAILED')); } } elseif ((isset($_POST['reject'])) && (is_array($_POST['id'])) && (count($_POST['id']) > 0)) { // Reject selected URLs if (SURFBAR_ADMIN_REJECT_URL_IDS($_POST['id'])) { // Unlock done! :-) - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SURFBAR_UNLOCK_DONE); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_SURFBAR_UNLOCK_DONE')); } else { // Unlock failed! - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SURFBAR_UNLOCK_FAILED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_SURFBAR_UNLOCK_FAILED')); } } // List all URLs $result = SQL_QUERY("SELECT id, userid, url, UNIX_TIMESTAMP(registered) AS registered -FROM `{!MYSQL_PREFIX!}_surfbar_urls` +FROM `{!_MYSQL_PREFIX!}_surfbar_urls` WHERE status='PENDING' -ORDER BY id ASC", __FILE__, __LINE__); +ORDER BY `id` ASC", __FILE__, __LINE__); // Do we have some URLs left? if (SQL_NUMROWS($result) > 0) { @@ -89,7 +89,7 @@ if (SQL_NUMROWS($result) > 0) { LOAD_TEMPLATE("admin_unlock_surfbar_urls", false, $OUT); } else { // No URLs in surfbar - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SURFBAR_NO_URLS_FOUND); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_SURFBAR_NO_URLS_FOUND')); } // Free result diff --git a/inc/modules/admin/what-usage.php b/inc/modules/admin/what-usage.php index fb3bd33282..e9d28dfe4e 100644 --- a/inc/modules/admin/what-usage.php +++ b/inc/modules/admin/what-usage.php @@ -82,14 +82,14 @@ if ((!empty($file)) && (FILE_READABLE($file) { // Until here... // Replace URLs - $content = str_replace("usage.png", URL."/modules.php?module=admin&what=".$GLOBALS['what']."&type=usage&image=usage", $content); - $content = str_replace("daily_usage_", URL."/modules.php?module=admin&what=".$GLOBALS['what']."&type=daily&image=", $content); - $content = str_replace("hourly_usage_", URL."/modules.php?module=admin&what=".$GLOBALS['what']."&type=hourly&image=", $content); - $content = str_replace("ctry_usage_", URL."/modules.php?module=admin&what=".$GLOBALS['what']."&type=ctry&image=", $content); - $content = str_replace("usage_", URL."/modules.php?module=admin&what=".$GLOBALS['what']."&usage=", str_replace(".html", "", $content)); + $content = str_replace("usage.png", "{!URL!}/modules.php?module=admin&what=".$GLOBALS['what']."&type=usage&image=usage", $content); + $content = str_replace("daily_usage_", "{!URL!}/modules.php?module=admin&what=".$GLOBALS['what']."&type=daily&image=", $content); + $content = str_replace("hourly_usage_", "{!URL!}/modules.php?module=admin&what=".$GLOBALS['what']."&type=hourly&image=", $content); + $content = str_replace("ctry_usage_", "{!URL!}/modules.php?module=admin&what=".$GLOBALS['what']."&type=ctry&image=", $content); + $content = str_replace("usage_", "{!URL!}/modules.php?module=admin&what=".$GLOBALS['what']."&usage=", str_replace(".html", "", $content)); // Disabled due to too much trouble - //$content = str_replace("HREF=\"http://", "href=\"".URL."/modules.php?module=loader&url=http://", $content); + //$content = str_replace("HREF=\"http://", "href=\"{!URL!}/modules.php?module=loader&url=http://", $content); $test = strtolower($content); // Do we need to strip out above and including plus trailing tag? diff --git a/inc/modules/admin/what-user_contct.php b/inc/modules/admin/what-user_contct.php index 33bdd57b24..99f50fc35f 100644 --- a/inc/modules/admin/what-user_contct.php +++ b/inc/modules/admin/what-user_contct.php @@ -43,7 +43,7 @@ ADD_DESCR("admin", __FILE__); // Is a user id given? if ((isset($_GET['u_id'])) && (bigintval($_GET['u_id']) > 0)) { // Load user data and display it - $result = SQL_QUERY_ESC("SELECT surname, family, email FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT surname, family, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($_GET['u_id'])), __FILE__, __LINE__); // Is a user account found? @@ -61,8 +61,8 @@ if ((isset($_GET['u_id'])) && (bigintval($_GET['u_id']) > 0)) { // Send contact form out $msg = LOAD_EMAIL_TEMPLATE("member_contct", $content); - SEND_EMAIL($content['email'], ADMIN_CONTACT_USER_SUBJECT, $msg); - LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_USER_CONTACTED); + SEND_EMAIL($content['email'], getMessage('ADMIN_CONTACT_USER_SUBJECT'), $msg); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_USER_CONTACTED')); } else { // Load contact form template LOAD_TEMPLATE("admin_contct_user_form", false, $content); diff --git a/inc/modules/admin/what-usr_online.php b/inc/modules/admin/what-usr_online.php index a548abdf12..d1a676b52e 100644 --- a/inc/modules/admin/what-usr_online.php +++ b/inc/modules/admin/what-usr_online.php @@ -43,9 +43,9 @@ ADD_DESCR("admin", __FILE__); if (EXT_IS_ACTIVE("online", true)) { // Count guests, members and admins - $result_guests = SQL_QUERY("SELECT id FROM `{!MYSQL_PREFIX!}_online` WHERE is_admin='N' AND is_member='N'", __FILE__, __LINE__); - $result_members = SQL_QUERY("SELECT id FROM `{!MYSQL_PREFIX!}_online` WHERE is_admin='N' AND is_member='Y'", __FILE__, __LINE__); - $result_admins = SQL_QUERY("SELECT id FROM `{!MYSQL_PREFIX!}_online` WHERE is_admin='Y'", __FILE__, __LINE__); + $result_guests = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_online` WHERE is_admin='N' AND is_member='N'", __FILE__, __LINE__); + $result_members = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_online` WHERE is_admin='N' AND is_member='Y'", __FILE__, __LINE__); + $result_admins = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_online` WHERE is_admin='Y'", __FILE__, __LINE__); // Remember values for the template define('_GUESTS_ONLINE' , SQL_NUMROWS($result_guests)); @@ -61,7 +61,7 @@ if (EXT_IS_ACTIVE("online", true)) LOAD_TEMPLATE("admin_mini_online"); // Check for online users - $result = SQL_QUERY("SELECT id, ip, userid, refid, module, action, what, is_member, is_admin, timestamp FROM `{!MYSQL_PREFIX!}_online` ORDER by timestamp DESC", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id, ip, userid, refid, module, action, what, is_member, is_admin, timestamp FROM `{!_MYSQL_PREFIX!}_online` ORDER by timestamp DESC", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Load header template diff --git a/inc/modules/chk_login.php b/inc/modules/chk_login.php index 2146f98385..25d6a4b8ff 100644 --- a/inc/modules/chk_login.php +++ b/inc/modules/chk_login.php @@ -50,7 +50,7 @@ if (!empty($GLOBALS['userid']) && (isSessionVariableSet('u_hash'))) { } // END - if // Get theme from profile - $result = SQL_QUERY_ESC("SELECT curr_theme".$ADD." FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT curr_theme".$ADD." FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); // Load data @@ -65,7 +65,7 @@ if (!empty($GLOBALS['userid']) && (isSessionVariableSet('u_hash'))) { // Remmeber login failures if available if (GET_EXT_VERSION("sql_patches") >= "0.6.1") { // Reset login failures - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET login_failures=0, last_failure='0000-00-00 00:00:00' WHERE userid=%s LIMIT 1", @@ -80,7 +80,7 @@ LIMIT 1", $bonus = false; if ((GET_EXT_VERSION("sql_patches") >= "0.2.8") && (GET_EXT_VERSION("bonus") >= "0.2.1") && (getConfig('bonus_login_yn') == "Y")) { // Update last login if far enougth away - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET last_login=UNIX_TIMESTAMP() WHERE userid=%s AND last_login < (UNIX_TIMESTAMP() - %s) LIMIT 1", diff --git a/inc/modules/frametester.php b/inc/modules/frametester.php index 3cbe638599..9a0dd6c95f 100644 --- a/inc/modules/frametester.php +++ b/inc/modules/frametester.php @@ -43,7 +43,7 @@ if (!empty($_GET['order'])) { // Order number placed, is he also logged in? if (IS_MEMBER()) { // Ok, test passed... :) - $result = SQL_QUERY_ESC("SELECT subject, url FROM `{!MYSQL_PREFIX!}_pool` WHERE id=%s AND sender=%s AND data_type='TEMP' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT subject, url FROM `{!_MYSQL_PREFIX!}_pool` WHERE id=%s AND sender=%s AND data_type='TEMP' LIMIT 1", array(bigintval($_GET['order']), $GLOBALS['userid']), __FILE__, __LINE__); // Finally is the entry valid? @@ -71,7 +71,7 @@ if (!empty($_GET['order'])) { if ((!empty($_POST['url'])) || (!empty($_GET['url'])) || (!empty($_GET['frame']))) { // Default URL is ours - $url = URL; + $url = constant('URL'); // Decode URL if set in GET parameters if (!empty($_GET['url'])) $url = gzuncompress(base64_decode(str_replace(" ", "+", COMPILE_CODE(urldecode($_GET['url']))))); diff --git a/inc/modules/guest/action-online.php b/inc/modules/guest/action-online.php index a1c0135b6e..3cc337bc61 100644 --- a/inc/modules/guest/action-online.php +++ b/inc/modules/guest/action-online.php @@ -43,9 +43,9 @@ if (!defined('__SECURITY')) { return; } -$result_guests = SQL_QUERY("SELECT id FROM `{!MYSQL_PREFIX!}_online` WHERE is_admin='N' AND is_member='N'", __FILE__, __LINE__); -$result_members = SQL_QUERY("SELECT id FROM `{!MYSQL_PREFIX!}_online` WHERE is_admin='N' AND is_member='Y'", __FILE__, __LINE__); -$result_admins = SQL_QUERY("SELECT id FROM `{!MYSQL_PREFIX!}_online` WHERE is_admin='Y'", __FILE__, __LINE__); +$result_guests = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_online` WHERE is_admin='N' AND is_member='N'", __FILE__, __LINE__); +$result_members = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_online` WHERE is_admin='N' AND is_member='Y'", __FILE__, __LINE__); +$result_admins = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_online` WHERE is_admin='Y'", __FILE__, __LINE__); // Total visitors online $total = SQL_NUMROWS($result_guests) + SQL_NUMROWS($result_members) + SQL_NUMROWS($result_admins); diff --git a/inc/modules/guest/action-themes.php b/inc/modules/guest/action-themes.php index ba848fad15..096a60bc6a 100644 --- a/inc/modules/guest/action-themes.php +++ b/inc/modules/guest/action-themes.php @@ -46,7 +46,7 @@ if (defined('__THEME_SELECTION_CONTENT')) return false; // Load all active designs (or all if admin) $whereStatement = ""; $OUT = ""; if (!IS_ADMIN()) $whereStatement = " WHERE theme_active='Y'"; -$result_themes = SQL_QUERY("SELECT theme_path FROM `{!MYSQL_PREFIX!}_themes`".$whereStatement, __FILE__, __LINE__); +$result_themes = SQL_QUERY("SELECT theme_path FROM `{!_MYSQL_PREFIX!}_themes`".$whereStatement, __FILE__, __LINE__); $num_themes = SQL_NUMROWS($result_themes); if ($num_themes > 1) { diff --git a/inc/modules/guest/what-active.php b/inc/modules/guest/what-active.php index 990a16b093..2a6845808d 100644 --- a/inc/modules/guest/what-active.php +++ b/inc/modules/guest/what-active.php @@ -51,7 +51,7 @@ if (EXT_IS_ACTIVE("nickname")) $ADD = "nickname"; // Check for members who were active only this day $result = SQL_QUERY_ESC("SELECT userid, ".$ADD.", last_online -FROM `{!MYSQL_PREFIX!}_user_data` +FROM `{!_MYSQL_PREFIX!}_user_data` WHERE last_online >= %s AND status='CONFIRMED' ORDER BY last_online DESC LIMIT %s", array(START_TDAY, getConfig('active_limit')), __FILE__, __LINE__); @@ -60,7 +60,7 @@ ORDER BY last_online DESC LIMIT %s", if (SQL_NUMROWS($result) > 0) { // At least one member was online so let's load them all $OUT = ""; $SW = 2; - while(list($uid, $nick, $last) = SQL_FETCHROW($result)) { + while (list($uid, $nick, $last) = SQL_FETCHROW($result)) { $nick2 = "---"; if (($nick != $uid) && (!empty($nick))) $nick2 = $nick; diff --git a/inc/modules/guest/what-admin.php b/inc/modules/guest/what-admin.php index f8a4af5769..266203e0f1 100644 --- a/inc/modules/guest/what-admin.php +++ b/inc/modules/guest/what-admin.php @@ -38,7 +38,7 @@ if (!defined('__SECURITY')) { } // Redirect... -LOAD_URL (URL."/modules.php?module=admin&action=login"); +LOAD_URL("modules.php?module=admin&action=login"); // ?> diff --git a/inc/modules/guest/what-confirm.php b/inc/modules/guest/what-confirm.php index 9f3120e749..33ebc71eb2 100644 --- a/inc/modules/guest/what-confirm.php +++ b/inc/modules/guest/what-confirm.php @@ -45,25 +45,25 @@ if (!empty($_GET['hash'])) { $uid = 0; // Search for an unconfirmed or confirmed account - $result = SQL_QUERY_ESC("SELECT userid, email, refid FROM `{!MYSQL_PREFIX!}_user_data` WHERE user_hash='%s' AND (status='UNCONFIRMED' OR status='CONFIRMED') LIMIT 1", + $result = SQL_QUERY_ESC("SELECT userid, email, refid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE user_hash='%s' AND (status='UNCONFIRMED' OR status='CONFIRMED') LIMIT 1", array($_GET['hash']), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Ok, he want's to confirm now so we load some data list ($uid, $email, $rid) = SQL_FETCHROW($result); // Unlock his account (but only when it is on UNCONFIRMED!) - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET status='CONFIRMED', ref_payout=%s, user_hash=NULL WHERE user_hash='%s' AND status='UNCONFIRMED' LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET status='CONFIRMED', ref_payout=%s, user_hash=NULL WHERE user_hash='%s' AND status='UNCONFIRMED' LIMIT 1", array(getConfig('ref_payout'), $_GET['hash']), __FILE__, __LINE__); if (SQL_AFFECTEDROWS() == 1) { $msg = LOAD_EMAIL_TEMPLATE("confirm-member", array('points' => getConfig('points_register')), bigintval($uid)); // And send him right away the confirmation mail - SEND_EMAIL($email, GUEST_THANX_CONFIRM, $msg); + SEND_EMAIL($email, getMessage('GUEST_THANX_CONFIRM'), $msg); // Maybe he got "referaled"? if (($rid > 0) && ($rid != $uid)) { // Select the referal userid - $result = SQL_QUERY_ESC("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($rid)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Update ref counter... @@ -84,7 +84,7 @@ if (!empty($_GET['hash'])) { // If version matches add ref bonus to refid's account if ((GET_EXT_VERSION("bonus") >= "0.4.4") && (getConfig('bonus_active') == "Y")) { // Add points (directly only!) - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET bonus_ref=bonus_ref+%s WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET bonus_ref=bonus_ref+%s WHERE userid=%s LIMIT 1", array(getConfig('bonus_ref'), bigintval($rid)), __FILE__, __LINE__); // Subtract points from system @@ -110,7 +110,7 @@ if (!empty($_GET['hash'])) { // Lead-Code mode enabled LOAD_URL("lead-confirm.php"); } else { - define('__CONFIRM_MSG', GUEST_CONFIRMED_DONE); + define('__CONFIRM_MSG', getMessage('GUEST_CONFIRMED_DONE')); define('__UID', bigintval($uid)); LOAD_TEMPLATE("guest_confirm_table"); } @@ -122,19 +122,19 @@ if (!empty($_GET['hash'])) { LOAD_URL("lead-confirm.php"); } else { // Nobody was found unter this hash key... or our new member want's to confirm twice? - define('__CONFIRM_MSG', GUEST_CONFIRMED_TWICE); + define('__CONFIRM_MSG', getMessage('GUEST_CONFIRMED_TWICE')); define('__UID', "0"); LOAD_TEMPLATE("guest_confirm_table"); } } else { // Nobody was found unter this hash key... or our new member want's to confirm twice? - define('__CONFIRM_MSG', GUEST_CONFIRMED_TWICE); + define('__CONFIRM_MSG', getMessage('GUEST_CONFIRMED_TWICE')); define('__UID', "0"); LOAD_TEMPLATE("guest_confirm_table"); } } elseif ((isset($_POST['ok'])) && (!empty($_POST['email']))) { // Confirmation link requested 0 1 2 - $result = SQL_QUERY_ESC("SELECT userid, status, user_hash FROM `{!MYSQL_PREFIX!}_user_data` WHERE email='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT userid, status, user_hash FROM `{!_MYSQL_PREFIX!}_user_data` WHERE email='%s' LIMIT 1", array($_POST['email']), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Email address found @@ -143,30 +143,26 @@ if (!empty($_GET['hash'])) { { case "UNCONFIRMED": // Account not confirmed $msg = LOAD_EMAIL_TEMPLATE("guest_request_confirm", array('hash' => $DATA[2]), $DATA[0]); - SEND_EMAIL($_POST['email'], REQUEST_CONFIRM_LINK_SUBJ, $msg); - $content = CONFIRM_LINK_SENT; + SEND_EMAIL($_POST['email'], getMessage('REQUEST_CONFIRM_LINK_SUBJ'), $msg); + $content = getMessage('CONFIRM_LINK_SENT'); break; case "CONFIRMED": // Account already confirmed - $content = LOGIN_ID_CONFIRMED; + $content = getMessage('LOGIN_ID_CONFIRMED'); break; case "LOCKED": // Account is locked - $content = LOGIN_ID_LOCKED; + $content = getMessage('LOGIN_ID_LOCKED'); break; } - } - else - { + } else { // Email address not registered - $content = EMAIL_ADDY_404; + $content = getMessage('EMAIL_ADDY_404'); } define('__CONFIRM_MSG', $content); LOAD_TEMPLATE("guest_confirm_table"); -} - else -{ +} else { // No hash found, the guest may want to enter his email address to re-get his confirmation link? LOAD_TEMPLATE("guest_confirm_link"); } diff --git a/inc/modules/guest/what-mediadata.php b/inc/modules/guest/what-mediadata.php index d4c813f489..5fa8585278 100644 --- a/inc/modules/guest/what-mediadata.php +++ b/inc/modules/guest/what-mediadata.php @@ -77,13 +77,13 @@ if ($TEST > time()) { } // User who can receive mails -$result_max = SQL_QUERY("SELECT COUNT(max_mails) FROM `{!MYSQL_PREFIX!}_user_data` WHERE status='CONFIRMED' AND max_mails > 0", __FILE__, __LINE__); +$result_max = SQL_QUERY("SELECT COUNT(max_mails) FROM `{!_MYSQL_PREFIX!}_user_data` WHERE status='CONFIRMED' AND max_mails > 0", __FILE__, __LINE__); list($dummy) = SQL_FETCHROW($result_max); SQL_FREERESULT($result_max); define('user_max_mails', $dummy); // Users who can receive mails today -$result_rec = SQL_QUERY("SELECT COUNT(receive_mails) FROM `{!MYSQL_PREFIX!}_user_data` WHERE status='CONFIRMED' AND receive_mails > 0", __FILE__, __LINE__); +$result_rec = SQL_QUERY("SELECT COUNT(receive_mails) FROM `{!_MYSQL_PREFIX!}_user_data` WHERE status='CONFIRMED' AND receive_mails > 0", __FILE__, __LINE__); list($dummy) = SQL_FETCHROW($result_rec); SQL_FREERESULT($result_rec); define('user_max_rec', $dummy); @@ -131,7 +131,7 @@ if ($sent > 0) $clr = $clicks / $sent * 100; define('_clr', TRANSLATE_COMMA($clr)."%"); // Load jackpot -$result = SQL_QUERY("SELECT points FROM `{!MYSQL_PREFIX!}_jackpot` WHERE ok='ok' LIMIT 1", __FILE__, __LINE__); +$result = SQL_QUERY("SELECT points FROM `{!_MYSQL_PREFIX!}_jackpot` WHERE ok='ok' LIMIT 1", __FILE__, __LINE__); list($jackpot) = SQL_FETCHROW($result); SQL_FREERESULT($result); if (empty($jackpot)) $jackpot = 0; @@ -139,7 +139,7 @@ define('jackpot', TRANSLATE_COMMA($jackpot)); // Total referal link clicks, total logins $result = SQL_QUERY("SELECT DISTINCT SUM(d.ref_clicks), SUM(d.total_logins) -FROM `{!MYSQL_PREFIX!}_user_data` AS d", __FILE__, __LINE__); +FROM `{!_MYSQL_PREFIX!}_user_data` AS d", __FILE__, __LINE__); list($ref, $logins) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -155,10 +155,10 @@ define('__TOTAL_REFCLICKS', $ref); define('__TOTAL_LOGINS' , $logins); // Referal banner -$result = SQL_QUERY("SELECT COUNT(id) FROM `{!MYSQL_PREFIX!}_refbanner` WHERE visible='Y'", __FILE__, __LINE__); +$result = SQL_QUERY("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_refbanner` WHERE `visible`='Y'", __FILE__, __LINE__); list($total) = SQL_FETCHROW($result); SQL_FREERESULT($result); -$result = SQL_QUERY("SELECT SUM(counter), SUM(clicks) FROM `{!MYSQL_PREFIX!}_refbanner` WHERE visible='Y'", __FILE__, __LINE__); +$result = SQL_QUERY("SELECT SUM(counter), SUM(clicks) FROM `{!_MYSQL_PREFIX!}_refbanner` WHERE `visible`='Y'", __FILE__, __LINE__); list($views, $clicks) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -182,7 +182,7 @@ $OUT_SPECIAL = ""; // We don't need row count here if (EXT_IS_ACTIVE("beg")) { // Clicks on beg links - $result = SQL_QUERY("SELECT SUM(beg_clicks) FROM `{!MYSQL_PREFIX!}_user_data` WHERE beg_clicks>0", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT SUM(beg_clicks) FROM `{!_MYSQL_PREFIX!}_user_data` WHERE beg_clicks>0", __FILE__, __LINE__); list($extra) = SQL_FETCHROW($result); SQL_FREERESULT($result); if (empty($extra)) $extra = 0; @@ -196,10 +196,10 @@ if (EXT_IS_ACTIVE("beg")) { if (EXT_IS_ACTIVE("doubler")) { // Total payed points - $result = SQL_QUERY("SELECT COUNT(id), SUM(points) FROM `{!MYSQL_PREFIX!}_doubler` WHERE completed='Y' AND points > 0", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT COUNT(id), SUM(points) FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='Y' AND points > 0", __FILE__, __LINE__); list($count1, $points1) = SQL_FETCHROW($result); SQL_FREERESULT($result); - $result = SQL_QUERY("SELECT COUNT(id), SUM(points) FROM `{!MYSQL_PREFIX!}_doubler` WHERE completed='N' AND points > 0", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT COUNT(id), SUM(points) FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='N' AND points > 0", __FILE__, __LINE__); list($count2, $points2) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -239,8 +239,8 @@ if (EXT_IS_ACTIVE("doubler")) { if (EXT_IS_ACTIVE("holiday")) { // Total holiday requests $result = SQL_QUERY("SELECT DISTINCT COUNT(h.userid) -FROM `{!MYSQL_PREFIX!}_user_holidays` AS h -LEFT JOIN `{!MYSQL_PREFIX!}_user_data` AS d +FROM `{!_MYSQL_PREFIX!}_user_holidays` AS h +LEFT JOIN `{!_MYSQL_PREFIX!}_user_data` AS d ON h.userid=d.userid WHERE d.holiday_active='Y'", __FILE__, __LINE__); @@ -257,8 +257,8 @@ WHERE d.holiday_active='Y'", if (EXT_IS_ACTIVE("transfer")) { // Statistics for points transfers $result = SQL_QUERY("SELECT DISTINCT COUNT(t.id), SUM(t.points) -FROM `{!MYSQL_PREFIX!}_user_transfers_in` AS t -LEFT JOIN `{!MYSQL_PREFIX!}_user_data` AS d +FROM `{!_MYSQL_PREFIX!}_user_transfers_in` AS t +LEFT JOIN `{!_MYSQL_PREFIX!}_user_data` AS d ON t.userid=d.userid", __FILE__, __LINE__); list($count_in, $points_in) = SQL_FETCHROW($result); @@ -266,8 +266,8 @@ ON t.userid=d.userid", if (empty($points_in)) $points_in = 0; $result = SQL_QUERY("SELECT DISTINCT COUNT(t.id), SUM(t.points) -FROM `{!MYSQL_PREFIX!}_user_transfers_out` AS t -LEFT JOIN `{!MYSQL_PREFIX!}_user_data` AS d +FROM `{!_MYSQL_PREFIX!}_user_transfers_out` AS t +LEFT JOIN `{!_MYSQL_PREFIX!}_user_data` AS d ON t.userid=d.userid", __FILE__, __LINE__); list($count_out, $points_out) = SQL_FETCHROW($result); diff --git a/inc/modules/guest/what-rallyes.php b/inc/modules/guest/what-rallyes.php index 7186f388e7..64f76c5881 100644 --- a/inc/modules/guest/what-rallyes.php +++ b/inc/modules/guest/what-rallyes.php @@ -50,7 +50,7 @@ $ADMIN = " AND d.is_active='Y'"; if (IS_ADMIN()) $ADMIN = ""; $result = SQL_QUERY("SELECT DISTINCT d.id, d.admin_id, a.login, d.title, d.descr, d.template, d.start_time, d.end_time, d.min_users, d.min_prices -FROM `{!MYSQL_PREFIX!}_rallye_data` AS d, `{!MYSQL_PREFIX!}_admins` AS a +FROM `{!_MYSQL_PREFIX!}_rallye_data` AS d, `{!_MYSQL_PREFIX!}_admins` AS a WHERE d.admin_id=a.id".$ADMIN." AND d.notified='Y' ORDER BY d.end_time LIMIT 1", __FILE__, __LINE__); @@ -73,10 +73,10 @@ if (SQL_NUMROWS($result) == 1) } else { - define('__RALLYE_EXTRAS', "".RALLYE_REGISTER_NOW.""); + define('__RALLYE_EXTRAS', "".RALLYE_REGISTER_NOW.""); } // Set admin line (currently set to impressum, later to contact form) - define('__RALLYE_ADMIN', "".$login.""); + define('__RALLYE_ADMIN', "".$login.""); // Set title define('__RALLYE_TITLE', COMPILE_CODE($title)); diff --git a/inc/modules/guest/what-register.php b/inc/modules/guest/what-register.php index 56c347f2d1..07be03e56d 100644 --- a/inc/modules/guest/what-register.php +++ b/inc/modules/guest/what-register.php @@ -72,7 +72,7 @@ if (empty($_POST['country_code'])) $_POST['country_code'] = "1"; $_POST['refid'] = 0; if ($GLOBALS['refid'] > 0) { // Test if the refid is valid - $result = SQL_QUERY_ESC("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($GLOBALS['refid'])), __FILE__, __LINE__); // Userid found? @@ -156,7 +156,7 @@ if (isset($_POST['ok'])) { // Check for IP timeout? if (getConfig('ip_timeout') > 0) { // Check his IP number - $result = SQL_QUERY_ESC("SELECT joined, last_update FROM `{!MYSQL_PREFIX!}_user_data` WHERE REMOTE_ADDR='%s' AND (joined > (UNIX_TIMESTAMP() - %s) OR last_update > (UNIX_TIMESTAMP() - %s)) LIMIT 1", + $result = SQL_QUERY_ESC("SELECT joined, last_update FROM `{!_MYSQL_PREFIX!}_user_data` WHERE REMOTE_ADDR='%s' AND (joined > (UNIX_TIMESTAMP() - %s) OR last_update > (UNIX_TIMESTAMP() - %s)) LIMIT 1", array(GET_REMOTE_ADDR(), getConfig('ip_timeout'), getConfig('ip_timeout')), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Same IP in timeout range and different email address entered... Eat this, faker! ;-) @@ -229,7 +229,7 @@ if ((isset($_POST['ok'])) && ((!$FAILED) || (IS_ADMIN()))) { // Create user's account... // ////////////////////////////// // - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_user_data` (gender, surname, family, street_nr,%s, zip, city, email, birth_day, birth_month, birth_year, password, max_mails, receive_mails, refid, status, user_hash, REMOTE_ADDR, joined, last_update".$ADD1.") + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_data` (gender, surname, family, street_nr,%s, zip, city, email, birth_day, birth_month, birth_year, password, max_mails, receive_mails, refid, status, user_hash, REMOTE_ADDR, joined, last_update".$ADD1.") VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONFIRMED','%s','%s', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()".$ADD2.")", array( $countryRow, @@ -269,13 +269,13 @@ VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONF } // END - if // Write his welcome-points - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_user_points` WHERE userid=%s AND ref_depth=0 LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_points` WHERE userid=%s AND ref_depth=0 LIMIT 1", array(bigintval($userid)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 0) { // Add only when the line was not found (maybe some more secure?) $locked = "points"; if (getConfig('ref_payout') > 0) $locked = "locked_points"; // Pay him later. First he has to confirm some mails! - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_user_points` (userid, ref_depth, ".$locked.") VALUES (%s,0,'%s')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_points` (userid, ref_depth, ".$locked.") VALUES (%s,0,'%s')", array(bigintval($userid), getConfig('points_register')), __FILE__, __LINE__); // Update mediadata as well @@ -290,7 +290,7 @@ VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONF foreach ($_POST['cat'] as $cat => $joined) { if ($joined == "Y") { // Insert category entry - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_user_cats` (userid, cat_id) VALUES (%s, %s)", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_cats` (userid, cat_id) VALUES (%s, %s)", array(bigintval($userid), bigintval($cat)), __FILE__, __LINE__); } // END - if } // END - foreach @@ -355,11 +355,11 @@ VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONF // Send mail to user (confirmation link!) $EMAIL = $DATA['email']; - SEND_EMAIL ($DATA['email'], GUEST_CONFIRM_LINK, $msg_guest); + SEND_EMAIL ($DATA['email'], getMessage('GUEST_CONFIRM_LINK'), $msg_guest); $DATA['email'] = $EMAIL; // Send mail to admin - SEND_ADMIN_NOTIFICATION(ADMIN_NEW_ACCOUNT, "register-admin", $DATA, $userid); + SEND_ADMIN_NOTIFICATION(getMessage('ADMIN_NEW_ACCOUNT'), "register-admin", $DATA, $userid); // Output success registration LOAD_TEMPLATE("admin_settings_saved", false, REGISTRATION_DONE); @@ -395,15 +395,15 @@ VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONF } if ($SHORT_PASS) { - OUTPUT_HTML("
    ".SHORT_PASS.": ".getConfig('pass_len')."
    "); + OUTPUT_HTML("
    {!SHORT_PASS!}: ".getConfig('pass_len')."
    "); } // END - if if ($IP_TIMEOUT) { - OUTPUT_HTML("
    ".REMOTE_ADDR_TIMEOUT."
    "); + OUTPUT_HTML("
    {!REMOTE_ADDR_TIMEOUT!}
    "); } // END - if if ((!empty($cats)) && ($cats < getConfig('least_cats'))) { - OUTPUT_HTML("
    ".CATS_LEAST.": ".getConfig('least_cats')."
    "); + OUTPUT_HTML("
    {!CATS_LEAST!}: ".getConfig('least_cats')."
    "); } // END - if // Generate birthday selection diff --git a/inc/modules/guest/what-sponsor_infos.php b/inc/modules/guest/what-sponsor_infos.php index 2fd1cc4d8e..c51e462205 100644 --- a/inc/modules/guest/what-sponsor_infos.php +++ b/inc/modules/guest/what-sponsor_infos.php @@ -51,9 +51,9 @@ unset($result_act); // Load all sponsor actions $result_act = SQL_QUERY("SELECT DISTINCT m.title, c.conv_rate, c.conv_name -FROM `{!MYSQL_PREFIX!}_sponsor_menu` AS m -LEFT JOIN `{!MYSQL_PREFIX!}_sponsor_action_convert` AS c ON m.what=c.ext_name -LEFT JOIN `{!MYSQL_PREFIX!}_sponsor_registry` AS r ON m.what=r.ext_name +FROM `{!_MYSQL_PREFIX!}_sponsor_menu` AS m +LEFT JOIN `{!_MYSQL_PREFIX!}_sponsor_action_convert` AS c ON m.what=c.ext_name +LEFT JOIN `{!_MYSQL_PREFIX!}_sponsor_registry` AS r ON m.what=r.ext_name WHERE m.action='actions' AND r.is_active='Y' ORDER BY m.sort ASC", __FILE__, __LINE__); $num_act = SQL_NUMROWS($result_act); @@ -76,7 +76,7 @@ if ($num_act > 0) { } // END - while // Check for pay types - $result_pay = SQL_QUERY("SELECT pay_name, pay_rate, pay_min_count, pay_currency FROM `{!MYSQL_PREFIX!}_sponsor_paytypes` ORDER BY pay_name", __FILE__, __LINE__); + $result_pay = SQL_QUERY("SELECT pay_name, pay_rate, pay_min_count, pay_currency FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes` ORDER BY pay_name", __FILE__, __LINE__); if (SQL_NUMROWS($result_pay) > 0) { // Load all pay types $OUT_PAY = ""; $SW = 2; diff --git a/inc/modules/guest/what-sponsor_login.php b/inc/modules/guest/what-sponsor_login.php index 6b4b5a9341..87f1adfd7e 100644 --- a/inc/modules/guest/what-sponsor_login.php +++ b/inc/modules/guest/what-sponsor_login.php @@ -63,7 +63,7 @@ if (!empty($_GET['hash'])) { company, position, tax_ident, street_nr1, street_nr2, country, zip, city, email, phone, fax, cell, points_amount AS points, last_pay AS pay, last_curr AS curr -FROM `{!MYSQL_PREFIX!}_sponsor_data` +FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE hash='%s' AND (status='UNCONFIRMED' OR status='EMAIL') LIMIT 1", array($_GET['hash']), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { @@ -78,7 +78,7 @@ LIMIT 1", array($_GET['hash']), __FILE__, __LINE__); // Unconfirmed account or changed email address? if ($SPONSOR['status'] == "UNCONFIRMED") { // Set account to pending - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_sponsor_data` SET status='PENDING' + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET status='PENDING' WHERE id='%s' AND hash='%s' AND status='UNCONFIRMED' LIMIT 1", array(bigintval($SPONSOR['id']), $_GET['hash']), __FILE__, __LINE__); @@ -99,7 +99,7 @@ WHERE id='%s' AND hash='%s' AND status='UNCONFIRMED' LIMIT 1", } } elseif ($SPONSOR['status'] == "EMAIL") { // Changed email adress need to be confirmed - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_sponsor_data` SET status='CONFIRMED' + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET status='CONFIRMED' WHERE id='%s' AND hash='%s' AND status='EMAIL' LIMIT 1", array(bigintval($SPONSOR['id']), $_GET['hash']), __FILE__, __LINE__); @@ -132,7 +132,7 @@ WHERE id='%s' AND hash='%s' AND status='EMAIL' LIMIT 1", if (isset($_POST['ok'])) { // Check email $result = SQL_QUERY_ESC("SELECT id, hash, status, remote_addr, gender, surname, family, sponsor_created -FROM `{!MYSQL_PREFIX!}_sponsor_data` +FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE email='%s' AND (status='UNCONFIRMED' OR status='EMAIL') LIMIT 1", array($_POST['email']), __FILE__, __LINE__); @@ -178,7 +178,7 @@ WHERE email='%s' AND (status='UNCONFIRMED' OR status='EMAIL') LIMIT 1", if (isset($_POST['ok'])) { // Check email $result = SQL_QUERY_ESC("SELECT id, hash, remote_addr, gender, surname, family, sponsor_created -FROM `{!MYSQL_PREFIX!}_sponsor_data` +FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE email='%s' AND id='%s' AND status='CONFIRMED' LIMIT 1", array($_POST['email'], bigintval($_POST['id'])), __FILE__, __LINE__); // Entry found? @@ -198,7 +198,7 @@ WHERE email='%s' AND id='%s' AND status='CONFIRMED' LIMIT 1", SEND_EMAIL($_POST['email'], SPONSOR_LOST_PASSWORD_SUBJ, $msg_sponsor); // Update password - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_sponsor_data` SET password='%s' + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET password='%s' WHERE id='%s' LIMIT 1", array(md5($SPONSOR['password']), bigintval($SPONSOR['id'])), __FILE__, __LINE__); @@ -217,7 +217,7 @@ WHERE id='%s' LIMIT 1", } } elseif (isset($_POST['ok'])) { // Check status and login data ... - $result = SQL_QUERY_ESC("SELECT status FROM `{!MYSQL_PREFIX!}_sponsor_data` + $result = SQL_QUERY_ESC("SELECT status FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' AND password='%s' LIMIT 1", array(bigintval($_POST['sponsorid']), md5($_POST['pass'])), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { diff --git a/inc/modules/guest/what-sponsor_reg.php b/inc/modules/guest/what-sponsor_reg.php index acce2dacdf..268962da75 100644 --- a/inc/modules/guest/what-sponsor_reg.php +++ b/inc/modules/guest/what-sponsor_reg.php @@ -211,7 +211,7 @@ if ((isset($_POST['ok'])) && (count($FORM_ERRORS) == 0)) { // Calulate points $result = SQL_QUERY_ESC("SELECT (pay_rate * pay_min_count) AS points, pay_min_count AS pay, pay_currency AS curr -FROM `{!MYSQL_PREFIX!}_sponsor_paytypes` +FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes` WHERE id='%s' LIMIT 1", array($_POST['pay_type']), __FILE__, __LINE__); list($points, $pay, $curr) = SQL_FETCHROW($result); @@ -232,7 +232,7 @@ WHERE id='%s' LIMIT 1", array($_POST['pay_type']), __FILE__, __LINE__); { case "added": // Sponsor successfully added with account status = UNCONFIRMED! // Check for his ID number - $result = SQL_QUERY_ESC("SELECT id, hash FROM `{!MYSQL_PREFIX!}_sponsor_data` WHERE email='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id, hash FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE email='%s' LIMIT 1", array($_POST['email']), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { @@ -286,13 +286,13 @@ WHERE id='%s' LIMIT 1", array($_POST['pay_type']), __FILE__, __LINE__); } else { // Check for payment types $result = SQL_QUERY("SELECT id, pay_name, pay_rate, pay_currency, pay_min_count -FROM `{!MYSQL_PREFIX!}_sponsor_paytypes` +FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes` ORDER BY pay_name", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Load all types... $OUT = "
    - ".LOAD_TEMPLATE("admin_settings_saved", true, ADMIN_NO_THEMES_FOUND)." + ".LOAD_TEMPLATE("admin_settings_saved", true, getMessage('ADMIN_NO_THEMES_FOUND'))."
    - ".LOAD_TEMPLATE("admin_settings_saved", true, ADMIN_NO_THEMES_FOUND)." + ".LOAD_TEMPLATE("admin_settings_saved", true, getMessage('ADMIN_NO_THEMES_FOUND'))."
    \n"; $SW = 2; - while(list($id, $name, $rate, $curr, $min) = SQL_FETCHROW($result)) + while (list($id, $name, $rate, $curr, $min) = SQL_FETCHROW($result)) { $OUT .= "\n"; } diff --git a/inc/modules/member/what-transfer.php b/inc/modules/member/what-transfer.php index b40a8b3300..8c9abb01db 100644 --- a/inc/modules/member/what-transfer.php +++ b/inc/modules/member/what-transfer.php @@ -46,7 +46,7 @@ if (!defined('__SECURITY')) { ADD_DESCR("member", __FILE__); // Load data -$result = SQL_QUERY_ESC("SELECT opt_in FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", +$result = SQL_QUERY_ESC("SELECT opt_in FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); list($opt_in) = SQL_FETCHROW($result); @@ -99,7 +99,7 @@ case "new": // Start new transfer } // Re-check receivers and own personal data - $result = SQL_QUERY_ESC("SELECT userid, gender, surname, family, email".$ADD." FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid IN ('%s','%s') AND status='CONFIRMED' ORDER BY userid LIMIT 2", + $result = SQL_QUERY_ESC("SELECT userid, gender, surname, family, email".$ADD." FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid IN ('%s','%s') AND status='CONFIRMED' ORDER BY userid LIMIT 2", array($GLOBALS['userid'], bigintval($_POST['to_uid'])), __FILE__, __LINE__); $valid_data = (SQL_NUMROWS($result) == 2); @@ -168,10 +168,10 @@ case "new": // Start new transfer define('__TRANS_ID', bigintval(GEN_RANDOM_CODE("10", mt_rand(0, 99999), $GLOBALS['userid'], $_POST['reason']))); // Add entries to both tables - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_user_transfers_in` (userid, from_uid, points, reason, time_trans, trans_id) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP(),'%s')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_transfers_in` (userid, from_uid, points, reason, time_trans, trans_id) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP(),'%s')", array(bigintval($_POST['to_uid']), $GLOBALS['userid'], bigintval($_POST['points']), $_POST['reason'], __TRANS_ID), __FILE__, __LINE__); - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_user_transfers_out` (userid, to_uid, points, reason, time_trans, trans_id) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP(),'%s')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_transfers_out` (userid, to_uid, points, reason, time_trans, trans_id) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP(),'%s')", array($GLOBALS['userid'], bigintval($_POST['to_uid']), bigintval($_POST['points']), $_POST['reason'], __TRANS_ID), __FILE__, __LINE__); @@ -194,7 +194,7 @@ case "new": // Start new transfer SEND_ADMIN_NOTIFICATION($ADMIN_SUBJ, "admin_transfer_points"); // Transfer is completed - LOAD_TEMPLATE("admin_settings_saved", false, TRANSFER_COMPLETED."
    ".TRANSFER_CONTINUE_OVERVIEW.""); + LOAD_TEMPLATE("admin_settings_saved", false, TRANSFER_COMPLETED."
    ".TRANSFER_CONTINUE_OVERVIEW.""); } elseif (!$valid_code) { // Invalid Touring code! LOAD_TEMPLATE("admin_settings_saved", false, "
    ".TRANSFER_INVALID_CODE."
    "); @@ -226,11 +226,11 @@ case "new": // Start new transfer // Load member list if (EXT_IS_ACTIVE("nickname")) { // Load userid and nickname - $result = SQL_QUERY_ESC("SELECT userid, nickname FROM `{!MYSQL_PREFIX!}_user_data` WHERE status='CONFIRMED' AND opt_in='Y' AND userid != '%s' ORDER BY userid", + $result = SQL_QUERY_ESC("SELECT userid, nickname FROM `{!_MYSQL_PREFIX!}_user_data` WHERE status='CONFIRMED' AND opt_in='Y' AND userid != '%s' ORDER BY userid", array($GLOBALS['userid']), __FILE__, __LINE__); } else { // Load only userid - $result = SQL_QUERY_ESC("SELECT userid, userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE status='CONFIRMED' AND opt_in='Y' AND userid != '%s' ORDER BY userid", + $result = SQL_QUERY_ESC("SELECT userid, userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE status='CONFIRMED' AND opt_in='Y' AND userid != '%s' ORDER BY userid", array($GLOBALS['userid']), __FILE__, __LINE__); } @@ -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); @@ -367,7 +367,7 @@ case "list_all": // List all transactions // fastest way but it shall be fine for now. // // First of all create the temporary table - $result = SQL_QUERY("CREATE TEMPORARY TABLE `{!MYSQL_PREFIX!}_transfers_tmp` ( + $result = SQL_QUERY("CREATE TEMPORARY TABLE `{!_MYSQL_PREFIX!}_transfers_tmp` ( trans_id VARCHAR(12) NOT NULL DEFAULT '', party_uid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0', points BIGINT(20) UNSIGNED NOT NULL DEFAULT '0', @@ -378,24 +378,24 @@ KEY(party_uid) ) TYPE=HEAP", __FILE__, __LINE__); // Let's begin with the incoming list - $result = SQL_QUERY_ESC("SELECT trans_id, from_uid, points, reason, time_trans FROM `{!MYSQL_PREFIX!}_user_transfers_in` WHERE userid=%s ORDER BY id LIMIT %s", + $result = SQL_QUERY_ESC("SELECT trans_id, from_uid, points, reason, time_trans FROM `{!_MYSQL_PREFIX!}_user_transfers_in` WHERE userid=%s ORDER BY `id` LIMIT %s", array($GLOBALS['userid'], getConfig('transfer_max')), __FILE__, __LINE__); while ($DATA = SQL_FETCHROW($result)) { $DATA[] = "IN"; $DATA = implode("','", $DATA); - $res_temp = SQL_QUERY("INSERT INTO `{!MYSQL_PREFIX!}_transfers_tmp` (trans_id, party_uid, points, reason, time_trans, trans_type) VALUES ('".$DATA."')", __FILE__, __LINE__); + $res_temp = SQL_QUERY("INSERT INTO `{!_MYSQL_PREFIX!}_transfers_tmp` (trans_id, party_uid, points, reason, time_trans, trans_type) VALUES ('".$DATA."')", __FILE__, __LINE__); } // Free memory SQL_FREERESULT($result); // As the last table transfer data from outgoing table to temporary - $result = SQL_QUERY_ESC("SELECT trans_id, to_uid, points, reason, time_trans FROM `{!MYSQL_PREFIX!}_user_transfers_out` WHERE userid=%s ORDER BY id LIMIT %s", + $result = SQL_QUERY_ESC("SELECT trans_id, to_uid, points, reason, time_trans FROM `{!_MYSQL_PREFIX!}_user_transfers_out` WHERE userid=%s ORDER BY `id` LIMIT %s", array($GLOBALS['userid'], getConfig('transfer_max')), __FILE__, __LINE__); while ($DATA = SQL_FETCHROW($result)) { $DATA[] = "OUT"; $DATA = implode("','", $DATA); - $res_temp = SQL_QUERY("INSERT INTO `{!MYSQL_PREFIX!}_transfers_tmp` (trans_id, party_uid, points, reason, time_trans, trans_type) VALUES ('".$DATA."')", __FILE__, __LINE__); + $res_temp = SQL_QUERY("INSERT INTO `{!_MYSQL_PREFIX!}_transfers_tmp` (trans_id, party_uid, points, reason, time_trans, trans_type) VALUES ('".$DATA."')", __FILE__, __LINE__); } // Free memory @@ -405,8 +405,8 @@ array($GLOBALS['userid'], getConfig('transfer_max')), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Output rows $OUT = ""; $SW = 2; - $result = SQL_QUERY("SELECT party_uid, trans_id, points, reason, time_trans, trans_type FROM `{!MYSQL_PREFIX!}_transfers_tmp` ORDER BY time_trans DESC", __FILE__, __LINE__); - while(list($uid, $idx, $points, $reason, $stamp, $type) = SQL_FETCHROW($result)) { + $result = SQL_QUERY("SELECT party_uid, trans_id, points, reason, time_trans, trans_type FROM `{!_MYSQL_PREFIX!}_transfers_tmp` ORDER BY time_trans DESC", __FILE__, __LINE__); + while (list($uid, $idx, $points, $reason, $stamp, $type) = SQL_FETCHROW($result)) { if ($type == "OUT") $points = "-$points"; $OUT .= "
    diff --git a/inc/modules/guest/what-stats.php b/inc/modules/guest/what-stats.php index 9628f98de0..7fa594a0df 100644 --- a/inc/modules/guest/what-stats.php +++ b/inc/modules/guest/what-stats.php @@ -52,19 +52,19 @@ switch (getConfig('guest_stats')) { case "MEMBERS": // Statistics about your members // Members yesterday / today online - $ymem = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE last_online >= ".START_YDAY." AND last_online < ".START_TDAY." AND status='CONFIRMED'", __FILE__, __LINE__)); - $tmem = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE last_online >= ".START_TDAY." AND status='CONFIRMED'", __FILE__, __LINE__)); + $ymem = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE last_online >= ".START_YDAY." AND last_online < ".START_TDAY." AND status='CONFIRMED'", __FILE__, __LINE__)); + $tmem = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE last_online >= ".START_TDAY." AND status='CONFIRMED'", __FILE__, __LINE__)); // Yesterday / today registered - $yreg = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE joined >= ".START_YDAY." AND joined < ".START_TDAY, __FILE__, __LINE__)); - $treg = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE joined >= ".START_TDAY, __FILE__, __LINE__)); + $yreg = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE joined >= ".START_YDAY." AND joined < ".START_TDAY, __FILE__, __LINE__)); + $treg = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE joined >= ".START_TDAY, __FILE__, __LINE__)); // Only males / females - $male = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE gender='M' AND status='CONFIRMED'", __FILE__, __LINE__)); - $female = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE gender='F' AND status='CONFIRMED'", __FILE__, __LINE__)); + $male = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE gender='M' AND status='CONFIRMED'", __FILE__, __LINE__)); + $female = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE gender='F' AND status='CONFIRMED'", __FILE__, __LINE__)); // Unconfirmed accounts - $unconfirmed = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE status != 'CONFIRMED'", __FILE__, __LINE__)); + $unconfirmed = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE status != 'CONFIRMED'", __FILE__, __LINE__)); // Total members $total = $male + $female; @@ -74,12 +74,12 @@ case "MEMBERS": // Statistics about your members for ($idx = 1; $idx < 13; $idx++) { $month = $idx; if ($idx < 10) $month = "0".$idx; - $months[$month] = SQL_NUMROWS(SQL_QUERY_ESC("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE birth_month=%s AND status='CONFIRMED'", + $months[$month] = SQL_NUMROWS(SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE birth_month=%s AND status='CONFIRMED'", array(bigintval($month)), __FILE__, __LINE__)); } // Members in categories - $result = SQL_QUERY("SELECT id, cat FROM `{!MYSQL_PREFIX!}_cats` WHERE visible='Y' ORDER BY id", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id, cat FROM `{!_MYSQL_PREFIX!}_cats` WHERE `visible`='Y' ORDER BY `id`", __FILE__, __LINE__); // Load categories first $cats = array(); $cat_cnt = array(); @@ -91,7 +91,7 @@ case "MEMBERS": // Statistics about your members // Now we have all categories loaded, count members foreach ($cats as $id => $dummy) { // We only need id and nothing more to count... - $cat_cnt[$id] = SQL_NUMROWS(SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_user_cats` WHERE cat_id=%s", + $cat_cnt[$id] = SQL_NUMROWS(SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE cat_id=%s", array(bigintval($id)), __FILE__, __LINE__)); } @@ -163,27 +163,24 @@ case "MEMBERS": // Statistics about your members case "MODULES": // TOP10 module clicks $AND = ""; - if (!IS_ADMIN()) $AND = " AND locked='N' AND visible='Y'"; - $guest_t10 = SQL_QUERY("SELECT counter, title FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE counter > 0".$AND." ORDER BY counter DESC LIMIT 0,10", __FILE__, __LINE__); - $mem_t10 = SQL_QUERY("SELECT counter, title FROM `{!MYSQL_PREFIX!}_member_menu` WHERE counter > 0".$AND." ORDER BY counter DESC LIMIT 0,10", __FILE__, __LINE__); - if ((SQL_NUMROWS($guest_t10) > 0) || (SQL_NUMROWS($mem_t10) > 0)) - { + if (!IS_ADMIN()) $AND = " AND `locked`='N' AND `visible`='Y'"; + $guest_t10 = SQL_QUERY("SELECT counter, title FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE counter > 0".$AND." ORDER BY counter DESC LIMIT 0,10", __FILE__, __LINE__); + $mem_t10 = SQL_QUERY("SELECT counter, title FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE counter > 0".$AND." ORDER BY counter DESC LIMIT 0,10", __FILE__, __LINE__); + if ((SQL_NUMROWS($guest_t10) > 0) || (SQL_NUMROWS($mem_t10) > 0)) { // Output header OUTPUT_HTML(" - + "); } - if (SQL_NUMROWS($guest_t10) > 0) - { + if (SQL_NUMROWS($guest_t10) > 0) { // Guest clicks OUTPUT_HTML(""); $SW = 2; - while (list($clicks, $title) = SQL_FETCHROW($guest_t10)) - { + while (list($clicks, $title) = SQL_FETCHROW($guest_t10)) { OUTPUT_HTML(" @@ -191,15 +188,14 @@ case "MODULES": // TOP10 module clicks $SW = 3 - $SW; } } - if (SQL_NUMROWS($guest_t10) > 0) - { + + if (SQL_NUMROWS($guest_t10) > 0) { // Guest clicks OUTPUT_HTML(""); $SW = 2; - while (list($clicks, $title) = SQL_FETCHROW($mem_t10)) - { + while (list($clicks, $title) = SQL_FETCHROW($mem_t10)) { OUTPUT_HTML(" @@ -207,11 +203,11 @@ case "MODULES": // TOP10 module clicks $SW = 3 - $SW; } } - if ((SQL_NUMROWS($guest_t10) > 0) || (SQL_NUMROWS($mem_t10) > 0)) - { + + if ((SQL_NUMROWS($guest_t10) > 0) || (SQL_NUMROWS($mem_t10) > 0)) { // Output footer OUTPUT_HTML(" - +
    ".GUEST_TOPTEN_STATS."{!GUEST_TOPTEN_STATS!}
    ".GUEST_TOP_GUEST_STATS."
    ".$title."   ".$clicks."
    ".GUEST_TOP_MEMBER_STATS."
    ".$title."   ".$clicks."
    ".$ltitle."".$ltitle."
    "); } diff --git a/inc/modules/guest/what-top10.php b/inc/modules/guest/what-top10.php index 151f60057f..f6bc1f06a1 100644 --- a/inc/modules/guest/what-top10.php +++ b/inc/modules/guest/what-top10.php @@ -48,7 +48,7 @@ $result = SQL_QUERY_ESC(" SELECT userid, total_logins, last_online FROM - "._MYSQL_PREFIX."_user_data + {!_MYSQL_PREFIX!}_user_data WHERE total_logins > 0 AND status='CONFIRMED' @@ -108,7 +108,7 @@ SELECT DISTINCT (SUM(p.points) - d.used_points) AS tpoints, d.last_online FROM - `{!MYSQL_PREFIX!}_user_data` AS d + `{!_MYSQL_PREFIX!}_user_data` AS d LEFT JOIN {!MYSQL_PREFIX!}_user_points AS p ON @@ -174,7 +174,7 @@ SELECT DISTINCT SUM(r.counter) AS refs, d.last_online FROM - `{!MYSQL_PREFIX!}_user_data` AS d + `{!_MYSQL_PREFIX!}_user_data` AS d LEFT JOIN {!MYSQL_PREFIX!}_refsystem AS r ON diff --git a/inc/modules/guest/what-welcome.php b/inc/modules/guest/what-welcome.php index 99c81229dd..c4a5c2fe2c 100644 --- a/inc/modules/guest/what-welcome.php +++ b/inc/modules/guest/what-welcome.php @@ -41,7 +41,7 @@ if (!defined('__SECURITY')) { ADD_DESCR("guest", __FILE__); // Count referal levels -$result = SQL_QUERY("SELECT COUNT(id) FROM `{!MYSQL_PREFIX!}_refdepths` WHERE level>0", __FILE__, __LINE__); +$result = SQL_QUERY("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE level>0", __FILE__, __LINE__); // Fetch rows list($cnt) = SQL_FETCHROW($result); diff --git a/inc/modules/member/action-themes.php b/inc/modules/member/action-themes.php index 0eecb59927..4c2dcb6b92 100644 --- a/inc/modules/member/action-themes.php +++ b/inc/modules/member/action-themes.php @@ -48,7 +48,7 @@ if (defined('__THEME_SELECTION_CONTENT')) return false; // Load all active designs (or all if admin) $whereStatement = ""; $OUT = ""; if (!IS_ADMIN()) $whereStatement = " WHERE theme_active='Y'"; -$result_themes = SQL_QUERY("SELECT theme_path FROM `{!MYSQL_PREFIX!}_themes`".$whereStatement, __FILE__, __LINE__); +$result_themes = SQL_QUERY("SELECT theme_path FROM `{!_MYSQL_PREFIX!}_themes`".$whereStatement, __FILE__, __LINE__); $num_themes = SQL_NUMROWS($result_themes); if ($num_themes > 1) { diff --git a/inc/modules/member/what-beg.php b/inc/modules/member/what-beg.php index 16df22b6d3..c2cfac4d09 100644 --- a/inc/modules/member/what-beg.php +++ b/inc/modules/member/what-beg.php @@ -59,7 +59,7 @@ if (EXT_IS_ACTIVE("nickname")) // Run SQL command $result = SQL_QUERY_ESC("SELECT ".$data.", beg_clicks -FROM `{!MYSQL_PREFIX!}_user_data` +FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($uid), __FILE__, __LINE__); list($uid, $clicks) = SQL_FETCHROW($result); diff --git a/inc/modules/member/what-beg2.php b/inc/modules/member/what-beg2.php index d1da6a6af2..81237f37b7 100644 --- a/inc/modules/member/what-beg2.php +++ b/inc/modules/member/what-beg2.php @@ -54,7 +54,7 @@ if (EXT_IS_ACTIVE("autopurge")) { } // Let's check if there are some points left we can "pay"... -$result = SQL_QUERY_ESC("SELECT userid, beg_points AS beg, last_online FROM `{!MYSQL_PREFIX!}_user_data` +$result = SQL_QUERY_ESC("SELECT userid, beg_points AS beg, last_online FROM `{!_MYSQL_PREFIX!}_user_data` WHERE beg_points > 0 AND status='CONFIRMED'".$LAST." ORDER BY beg_points DESC, last_online DESC, userid LIMIT %s", array($ONLINE, getConfig('beg_ranks')), __FILE__, __LINE__); @@ -64,7 +64,7 @@ $OUT = ""; if (SQL_NUMROWS($result) > 0) { // Load our winners... $SW = 2; $cnt = 1; - while(list($uid, $turbo, $last) = SQL_FETCHROW($result)) { + while (list($uid, $turbo, $last) = SQL_FETCHROW($result)) { // Prepare data for the template $content = array( 'sw' => $SW, diff --git a/inc/modules/member/what-bonus.php b/inc/modules/member/what-bonus.php index 2b133c5ebc..3b01a6f210 100644 --- a/inc/modules/member/what-bonus.php +++ b/inc/modules/member/what-bonus.php @@ -71,7 +71,7 @@ if (EXT_IS_ACTIVE("autopurge")) { } // Let's check if there are some points left we can "pay"... -$result = SQL_QUERY_ESC("SELECT userid, ".$USE." AS points, last_online FROM `{!MYSQL_PREFIX!}_user_data` +$result = SQL_QUERY_ESC("SELECT userid, ".$USE." AS points, last_online FROM `{!_MYSQL_PREFIX!}_user_data` WHERE ".$USE." > 0 AND status='CONFIRMED'".$LAST." ORDER BY points DESC, last_online DESC, userid LIMIT %s", diff --git a/inc/modules/member/what-categories.php b/inc/modules/member/what-categories.php index e62396e54b..ab5fc444b6 100644 --- a/inc/modules/member/what-categories.php +++ b/inc/modules/member/what-categories.php @@ -43,10 +43,10 @@ if (!defined('__SECURITY')) { ADD_DESCR("member", __FILE__); $UID = $GLOBALS['userid']; -$whereStatement = " WHERE visible='Y'"; +$whereStatement = " WHERE `visible`='Y'"; if (IS_ADMIN()) $whereStatement = ""; -$result = SQL_QUERY("SELECT id, cat FROM `{!MYSQL_PREFIX!}_cats`".$whereStatement." ORDER BY sort", __FILE__, __LINE__); +$result = SQL_QUERY("SELECT id, cat FROM `{!_MYSQL_PREFIX!}_cats`".$whereStatement." ORDER BY `sort`", __FILE__, __LINE__); $cats = SQL_NUMROWS($result); if ($cats > 0) @@ -73,12 +73,12 @@ if ($cats > 0) { case "Y": $sql = ""; - $result_user = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_user_cats` WHERE userid=%s AND cat_id=%s LIMIT 1", + $result_user = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE userid=%s AND cat_id=%s LIMIT 1", array($UID, bigintval($cat)), __FILE__, __LINE__); if (SQL_NUMROWS($result_user) == 0) { - $sql = "INSERT INTO `{!MYSQL_PREFIX!}_user_cats` (userid, cat_id) VALUES ('%s','%s')"; + $sql = "INSERT INTO `{!_MYSQL_PREFIX!}_user_cats` (userid, cat_id) VALUES ('%s','%s')"; } else { @@ -88,7 +88,7 @@ if ($cats > 0) break; case "N": - $sql = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_user_cats` WHERE userid=%s AND cat_id=%s LIMIT 1"; + $sql = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE userid=%s AND cat_id=%s LIMIT 1"; break; } if (!empty($sql)) @@ -98,7 +98,7 @@ if ($cats > 0) } } // Categories saved... - LOAD_TEMPLATE("admin_settings_saved", true, MEMBER_CATS_SAVED); + LOAD_TEMPLATE("admin_settings_saved", true, getMessage('MEMBER_CATS_SAVED')); } else { @@ -121,7 +121,7 @@ if ($cats > 0) $JOINED_N = " checked=\"checked\""; $JOINED_Y = ""; // Check category selection - $result_user = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_user_cats` WHERE userid=%s AND cat_id=%s LIMIT 1", + $result_user = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE userid=%s AND cat_id=%s LIMIT 1", array($UID, bigintval($id)), __FILE__, __LINE__); // When we found an entry don't read it, just change the JOINED_x variables @@ -161,7 +161,7 @@ if ($cats > 0) else { // No cateogries are defined yet - LOAD_TEMPLATE("admin_settings_saved", true, MEMBER_NO_CATS); + LOAD_TEMPLATE("admin_settings_saved", true, getMessage('MEMBER_NO_CATS')); } SQL_FREERESULT($result); diff --git a/inc/modules/member/what-guest.php b/inc/modules/member/what-guest.php index adbb1e5d3f..f8be32e85b 100644 --- a/inc/modules/member/what-guest.php +++ b/inc/modules/member/what-guest.php @@ -43,6 +43,6 @@ if (!defined('__SECURITY')) { ADD_DESCR("member", __FILE__); // Simply redirect... -LOAD_URL (URL."/modules.php?module=index"); +LOAD_URL("modules.php?module=index"); // ?> diff --git a/inc/modules/member/what-holiday.php b/inc/modules/member/what-holiday.php index d616a78fde..c6ef6c2e9f 100644 --- a/inc/modules/member/what-holiday.php +++ b/inc/modules/member/what-holiday.php @@ -46,11 +46,11 @@ if (!defined('__SECURITY')) { ADD_DESCR("member", __FILE__); // Check for running mail orders in pool -$result1 = SQL_QUERY_ESC("SELECT timestamp FROM `{!MYSQL_PREFIX!}_pool` +$result1 = SQL_QUERY_ESC("SELECT timestamp FROM `{!_MYSQL_PREFIX!}_pool` WHERE sender=%s ORDER BY timestamp DESC LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); // Check for sent mail orders in stats -$result2 = SQL_QUERY_ESC("SELECT timestamp_ordered FROM `{!MYSQL_PREFIX!}_user_stats` +$result2 = SQL_QUERY_ESC("SELECT timestamp_ordered FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE userid=%s ORDER BY timestamp_ordered DESC LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); if ((SQL_NUMROWS($result1) == 1) || (SQL_NUMROWS($result2) == 1)) @@ -104,11 +104,11 @@ if (isset($_POST['ok'])) else { // Everything went okay so let's store his request and send mails - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_user_holidays` (userid, holiday_start, holiday_end, comments) VALUES ('%s','%s','%s','%s')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_holidays` (userid, holiday_start, holiday_end, comments) VALUES ('%s','%s','%s','%s')", array($GLOBALS['userid'], $START, $END, $_POST['comments']), __FILE__, __LINE__); // Activate holiday system - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET holiday_active='N', holiday_activated=UNIX_TIMESTAMP() WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); @@ -129,7 +129,7 @@ WHERE userid=%s LIMIT 1", SEND_ADMIN_NOTIFICATION(HOLIDAY_ADMIN_SUBJECT, "admin_holiday_request", $_POST['comments'], $GLOBALS['userid']); // Create task - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_task_system` (userid, assigned_admin, status, task_type, subject, text, task_created) VALUES ('%s','0','NEW','HOLIDAY_REQUEST','%s','%s', UNIX_TIMESTAMP())", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_task_system` (userid, assigned_admin, status, task_type, subject, text, task_created) VALUES ('%s','0','NEW','HOLIDAY_REQUEST','%s','%s', UNIX_TIMESTAMP())", array($GLOBALS['userid'], HOLIDAY_ADMIN_SUBJECT, $msg), __FILE__, __LINE__); // Display message @@ -141,7 +141,7 @@ WHERE userid=%s LIMIT 1", if (isset($_POST['stop'])) { // Okay, end the holiday here... - $result = SQL_QUERY_ESC("SELECT holiday_active, holiday_activated FROM `{!MYSQL_PREFIX!}_user_data` + $result = SQL_QUERY_ESC("SELECT holiday_active, holiday_activated FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); list($active, $locked) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -149,7 +149,7 @@ WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); if (($active == "Y") && (($locked + getConfig('holiday_lock')) < time())) { // Load data - $result = SQL_QUERY_ESC("SELECT holiday_start, holiday_end FROM `{!MYSQL_PREFIX!}_user_holidays` + $result = SQL_QUERY_ESC("SELECT holiday_start, holiday_end FROM `{!_MYSQL_PREFIX!}_user_holidays` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { @@ -162,12 +162,12 @@ WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); define('__HOLIDAY_END' , MAKE_DATETIME($end , "3")); // Deactivate it now - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET holiday_active='N', holiday_activated='0' WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); // Remove entry - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_user_holidays` + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_holidays` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); // Send email to admin @@ -193,7 +193,7 @@ WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); if ((!isset($_POST['ok'])) && (!isset($_POST['stop']))) { // Check if user is in holiday... - $result = SQL_QUERY_ESC("SELECT holiday_active, holiday_activated FROM `{!MYSQL_PREFIX!}_user_data` + $result = SQL_QUERY_ESC("SELECT holiday_active, holiday_activated FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); list($active, $locked) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -206,7 +206,7 @@ WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); { case "Y": // Display deactivation form // Load starting and ending date - $result = SQL_QUERY_ESC("SELECT holiday_start, holiday_end FROM `{!MYSQL_PREFIX!}_user_holidays` + $result = SQL_QUERY_ESC("SELECT holiday_start, holiday_end FROM `{!_MYSQL_PREFIX!}_user_holidays` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { @@ -228,7 +228,7 @@ WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); SQL_FREERESULT($result); // Remove entry and reload URL - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET holiday_active='N' WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); LOAD_URL("modules.php?module=login&what=holiday"); diff --git a/inc/modules/member/what-html_mail.php b/inc/modules/member/what-html_mail.php index e82f71705e..8343af91d0 100644 --- a/inc/modules/member/what-html_mail.php +++ b/inc/modules/member/what-html_mail.php @@ -49,14 +49,14 @@ ADD_DESCR("member", __FILE__); if (isset($_POST['ok'])) { // Save settings - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET html='%s' WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET html='%s' WHERE userid=%s LIMIT 1", array($_POST['html'], $GLOBALS['userid']), __FILE__, __LINE__); - LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_SETTINGS_SAVED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_SETTINGS_SAVED')); } else { // Load template for changing settings - $result = SQL_QUERY_ESC("SELECT html FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT html FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); list($mode) = SQL_FETCHROW($result); SQL_FREERESULT($result); diff --git a/inc/modules/member/what-mydata.php b/inc/modules/member/what-mydata.php index 64d7f85679..35ff349b5e 100644 --- a/inc/modules/member/what-mydata.php +++ b/inc/modules/member/what-mydata.php @@ -59,13 +59,13 @@ case "show": // Show his data if (EXT_IS_ACTIVE("country", true)) { // New way 0 1 2 3 4 5 6 7 8 9 10 11 12 13 - $result = SQL_QUERY_ESC("SELECT surname, family, street_nr, country_code, zip, city, email, birth_day, birth_month, birth_year, gender, max_mails, receive_mails, last_update FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT surname, family, street_nr, country_code, zip, city, email, birth_day, birth_month, birth_year, gender, max_mails, receive_mails, last_update FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(UID_VALUE), __FILE__, __LINE__); } else { // Old way 0 1 2 3 4 5 6 7 8 9 10 11 12 13 - $result = SQL_QUERY_ESC("SELECT surname, family, street_nr, country, zip, city, email, birth_day, birth_month, birth_year, gender, max_mails, receive_mails, last_update FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT surname, family, street_nr, country, zip, city, email, birth_day, birth_month, birth_year, gender, max_mails, receive_mails, last_update FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(UID_VALUE), __FILE__, __LINE__); } $DATA = SQL_FETCHROW($result); @@ -108,12 +108,12 @@ case "edit": // Edit data if (EXT_IS_ACTIVE("country", true)) { // New way 0 1 2 3 4 5 6 7 8 9 10 11 12 13 $result = SQL_QUERY_ESC("SELECT surname, family, street_nr, country_code, zip, city, email, birth_day, birth_month, birth_year, gender, max_mails, receive_mails, last_update -FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", +FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(UID_VALUE), __FILE__, __LINE__); } else { // Old way 0 1 2 3 4 5 6 7 8 9 10 11 12 13 $result = SQL_QUERY_ESC("SELECT surname, family, street_nr, country, zip, city, email, birth_day, birth_month, birth_year, gender, max_mails, receive_mails, last_update -FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", +FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(UID_VALUE), __FILE__, __LINE__); } @@ -192,7 +192,7 @@ FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", case "save": // Save entered data // Load old email / password: 0 1 2 - $result = SQL_QUERY_ESC("SELECT email, password, last_update FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT email, password, last_update FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(UID_VALUE), __FILE__, __LINE__); $DATA = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -229,7 +229,7 @@ case "save": // Save entered data if (EXT_IS_ACTIVE("country")) { // New way - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET gender='%s', surname='%s', family='%s', street_nr='%s', country_code=%s, zip=%s, city='%s', @@ -260,7 +260,7 @@ array( else { // Old way - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET gender='%s', surname='%s', family='%s', street_nr='%s', country='%s', zip=%s, city='%s', @@ -304,7 +304,7 @@ array( break; case "notify": // Switch off notfication - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET notified='N', last_update=UNIX_TIMESTAMP() WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET notified='N', last_update=UNIX_TIMESTAMP() WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); $URL = "modules.php?module=login&what=welcome&msg=".urlencode(PROFILE_UPDATED); break; diff --git a/inc/modules/member/what-newsletter.php b/inc/modules/member/what-newsletter.php index 7789941813..1b31672422 100644 --- a/inc/modules/member/what-newsletter.php +++ b/inc/modules/member/what-newsletter.php @@ -46,7 +46,7 @@ if (!defined('__SECURITY')) { ADD_DESCR("member", __FILE__); // Load status -$result = SQL_QUERY_ESC("SELECT nl_receive, nl_until, nl_timespan FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", +$result = SQL_QUERY_ESC("SELECT nl_receive, nl_until, nl_timespan FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); list($status, $until, $span) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -57,14 +57,14 @@ define('__CHARGE_VALUE', TRANSLATE_COMMA(getConfig('nl_charge'))); if ((isset($_POST['ok'])) && ($status == "Y") && ($span == "0")) { // Save request - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET nl_timespan='".(getConfig('one_day') * 30)."' WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET nl_timespan='".(getConfig('one_day') * 30)."' WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); // Load admin message $admin_msg = LOAD_EMAIL_TEMPLATE("admin_newsletter_request", array(), $GLOBALS['userid']); // Add task - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_task_system` (assigned_admin, status, task_type, subject, text, task_created, userid) + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_task_system` (assigned_admin, status, task_type, subject, text, task_created, userid) VALUES ('0','NEW','NL_UNSUBSCRIBE','".ADMIN_NL_SUBJECT."','".$admin_msg."', UNIX_TIMESTAMP(),'%s')", array($GLOBALS['userid']), __FILE__, __LINE__); // Send mail to member diff --git a/inc/modules/member/what-nickname.php b/inc/modules/member/what-nickname.php index 5297de5ad1..6fee3818c2 100644 --- a/inc/modules/member/what-nickname.php +++ b/inc/modules/member/what-nickname.php @@ -60,11 +60,11 @@ if (isset($_POST['ok'])) { if ($VALID) { // Look for nickname in database (we only need just one entry so don't worry about the "LIMIT 1" ! - $result = SQL_QUERY_ESC("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE nickname='%s' AND userid != '%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' AND userid != '%s' LIMIT 1", array($_POST['nickname'], $GLOBALS['userid']), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 0) { // Nickname not in use, so set it now - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET nickname='%s' WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET nickname='%s' WHERE userid=%s LIMIT 1", array($_POST['nickname'], $GLOBALS['userid']), __FILE__, __LINE__); $content = NICKNAME_SAVED; } else { diff --git a/inc/modules/member/what-order.php b/inc/modules/member/what-order.php index 5cf3a25bec..f1627a9584 100644 --- a/inc/modules/member/what-order.php +++ b/inc/modules/member/what-order.php @@ -46,7 +46,7 @@ if (!defined('__SECURITY')) { ADD_DESCR("member", __FILE__); $URL = ""; $id = 0; -$whereStatement = " WHERE visible='Y'"; +$whereStatement = " WHERE `visible`='Y'"; // Set undefined array elements if (empty($_GET['msg'])) $_GET['msg'] = ""; @@ -69,7 +69,7 @@ if (GET_EXT_VERSION("holiday") >= "0.1.3") { } // END - if $result_mmails = SQL_QUERY_ESC("SELECT userid, receive_mails, mail_orders, ".$HOLIDAY." -FROM `{!MYSQL_PREFIX!}_user_data` +FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND max_mails > 0 LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); @@ -92,7 +92,7 @@ if (($HOLIDAY == "Y") && (GET_EXT_VERSION("holiday") >= "0.1.3")) { // // First we would like to store the data and get it's pool position back... $result = SQL_QUERY_ESC("SELECT id, data_type -FROM `{!MYSQL_PREFIX!}_pool` +FROM `{!_MYSQL_PREFIX!}_pool` WHERE sender=%s AND url='%s' AND timestamp > (UNIX_TIMESTAMP() - %s) LIMIT 1", array($GLOBALS['userid'], $_POST['url'], getConfig('url_tlock')), __FILE__, __LINE__); @@ -139,7 +139,7 @@ WHERE sender=%s AND url='%s' AND timestamp > (UNIX_TIMESTAMP() - %s) LIMIT 1", // And shall I check that his URL is not in the black list? if (getConfig('url_blacklist') == "Y") { // Ok, I do that for you know... - $result = SQL_QUERY_ESC("SELECT UNIX_TIMESTAMP(`timestamp`) AS tstamp FROM `{!MYSQL_PREFIX!}_url_blacklist` WHERE `url`='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT UNIX_TIMESTAMP(`timestamp`) AS tstamp FROM `{!_MYSQL_PREFIX!}_url_blacklist` WHERE `url`='%s' LIMIT 1", array($_POST['url']), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { @@ -195,8 +195,8 @@ WHERE sender=%s AND url='%s' AND timestamp > (UNIX_TIMESTAMP() - %s) LIMIT 1", } // END - if // Check for userids - $result = SQL_QUERY_ESC("SELECT DISTINCT c.userid FROM `{!MYSQL_PREFIX!}_user_cats` AS c -LEFT JOIN `{!MYSQL_PREFIX!}_user_data` AS d + $result = SQL_QUERY_ESC("SELECT DISTINCT c.userid FROM `{!_MYSQL_PREFIX!}_user_cats` AS c +LEFT JOIN `{!_MYSQL_PREFIX!}_user_data` AS d ON c.userid=d.userid WHERE c.cat_id=%s AND c.userid != '%s' AND d.status='CONFIRMED' AND d.receive_mails > 0".$ADD." ORDER BY d.%s %s", @@ -221,7 +221,7 @@ ORDER BY d.%s %s", while (list($REC) = SQL_FETCHROW($result)) { if ($HOLIDAY) { // Check for his holiday status - $result_holiday = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_user_holidays` + $result_holiday = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_holidays` WHERE userid=%s AND holiday_start < UNIX_TIMESTAMP() AND holiday_end > UNIX_TIMESTAMP() LIMIT 1", array(bigintval($REC)), __FILE__, __LINE__); if (SQL_NUMROWS($result_holiday) == 1) $REC = 0; // Exclude user who are in holiday @@ -247,7 +247,7 @@ WHERE userid=%s AND holiday_start < UNIX_TIMESTAMP() AND holiday_end > UNIX_TIME $MAX_SEND = count($TEST); // Update receiver list - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET receive_mails=receive_mails-1 WHERE userid IN (%s) LIMIT %s", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET receive_mails=receive_mails-1 WHERE userid IN (%s) LIMIT %s", array(str_replace(";", ", ", $RECEIVER), $MAX_SEND), __FILE__, __LINE__); // Is calculated max receivers larger than wanted receivers then reset it @@ -268,7 +268,7 @@ WHERE userid=%s AND holiday_start < UNIX_TIMESTAMP() AND holiday_end > UNIX_TIME $id = 0; if (EXT_IS_ACTIVE("html_mail")) { // HTML extension is active - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_pool` (sender, subject, text, receivers, payment_id, data_type, timestamp, url, cat_id, target_send, zip, html_msg) + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_pool` (sender, subject, text, receivers, payment_id, data_type, timestamp, url, cat_id, target_send, zip, html_msg) VALUES ('%s','%s','%s','%s','%s','TEMP','%s','%s','%s','%s','%s','%s')", array( $GLOBALS['userid'], @@ -285,7 +285,7 @@ array( ), __FILE__, __LINE__); } else { // No HTML extension is active - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_pool` (sender, subject, text, receivers, payment_id, data_type, timestamp, url, cat_id, target_send, zip) + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_pool` (sender, subject, text, receivers, payment_id, data_type, timestamp, url, cat_id, target_send, zip) VALUES ('%s','%s','%s','%s','%s','TEMP','%s','%s','%s','%s','%s')", array( $GLOBALS['userid'], @@ -304,7 +304,7 @@ array( // Change current order if (EXT_IS_ACTIVE("html_mail")) { // HTML extension is active - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_pool` SET + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET subject='%s', text='%s', receivers='%s', @@ -330,7 +330,7 @@ array( ), __FILE__, __LINE__); } else { // No HTML extension is active - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_pool` SET + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET subject='%s', text='%s', receivers='%s', @@ -358,7 +358,7 @@ array( // Do we need to get the ID number? if ($id == 0) { // Order is placed as temporary. We need to get it's id for the frametester - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_pool` WHERE sender=%s AND subject='%s' AND payment_id=%s AND data_type='TEMP' AND timestamp=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_pool` WHERE sender=%s AND subject='%s' AND payment_id=%s AND data_type='TEMP' AND timestamp=%s LIMIT 1", array( $GLOBALS['userid'], $_POST['subject'], @@ -389,10 +389,10 @@ array( $URL = "modules.php?module=login&what=order&msg=".CODE_MORE_RECEIVERS1; } elseif (($ALLOWED == 0) && (getConfig('order_max_full') == "ORDER")) { // No more mail orders allowed - LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_ORDER_ALLOWED_EXHAUSTED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_ORDER_ALLOWED_EXHAUSTED')); } elseif (($links < getConfig('unconfirmed')) && ($mmails == "1")) { // Display order form - $result_cats = SQL_QUERY("SELECT id, cat FROM `{!MYSQL_PREFIX!}_cats`".$whereStatement." ORDER BY sort", __FILE__, __LINE__); + $result_cats = SQL_QUERY("SELECT id, cat FROM `{!_MYSQL_PREFIX!}_cats`".$whereStatement." ORDER BY `sort`", __FILE__, __LINE__); if (SQL_NUMROWS($result_cats) > 0) { if ($TOTAL > 0) { // Initialize array... @@ -416,7 +416,7 @@ array( $CATS['name'][] = $cat; // Select users in current category - $result_uids = SQL_QUERY_ESC("SELECT userid FROM `{!MYSQL_PREFIX!}_user_cats` WHERE cat_id=%s AND userid != '%s' ORDER BY userid", + $result_uids = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE cat_id=%s AND userid != '%s' ORDER BY userid", array(bigintval($id), $GLOBALS['userid']), __FILE__, __LINE__); $uid_cnt = 0; @@ -425,8 +425,8 @@ array( $HOL_ACTIVE = false; if ($HOLIDAY) { // Check user's holiday status - $result_holiday = SQL_QUERY_ESC("SELECT DISTINCT d.userid FROM `{!MYSQL_PREFIX!}_user_data` AS d -LEFT JOIN `{!MYSQL_PREFIX!}_user_holidays` AS h + $result_holiday = SQL_QUERY_ESC("SELECT DISTINCT d.userid FROM `{!_MYSQL_PREFIX!}_user_data` AS d +LEFT JOIN `{!_MYSQL_PREFIX!}_user_holidays` AS h ON d.userid=h.userid WHERE d.userid=%s AND d.receive_mails > 0 AND d.status='CONFIRMED' AND d.holiday_active='Y' AND h.holiday_start < UNIX_TIMESTAMP() AND h.holiday_end > UNIX_TIMESTAMP() @@ -442,8 +442,8 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); if (!$HOL_ACTIVE) { // Check if the user want's to receive mails? - $result_ver = SQL_QUERY_ESC("SELECT zip FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s".$HTML." AND receive_mails > 0 AND status='CONFIRMED' LIMIT 1", - array(bigintval($ucat)), __FILE__, __LINE__); + $result_ver = SQL_QUERY_ESC("SELECT zip FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s".$HTML." AND receive_mails > 0 AND status='CONFIRMED' LIMIT 1", + array(bigintval($ucat)), __FILE__, __LINE__); if ((SQL_NUMROWS($result_ver) == 1) && (!empty($_POST['zip'])) && (getConfig('order_multi_page') == "Y")) { list($zip) = SQL_FETCHROW($result_ver); @@ -468,7 +468,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); SQL_FREERESULT($result_cats); // Now we need to load the mail types... - $result = SQL_QUERY("SELECT id, price, payment, mail_title FROM `{!MYSQL_PREFIX!}_payments` ORDER BY payment", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id, price, payment, mail_title FROM `{!_MYSQL_PREFIX!}_payments` ORDER BY payment", __FILE__, __LINE__); $typeS = array(); if (SQL_NUMROWS($result) > 0) { @@ -477,7 +477,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); switch ($_GET['msg']) { case CODE_URL_TLOCK: - $result = SQL_QUERY_ESC("SELECT timestamp FROM `{!MYSQL_PREFIX!}_pool` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT timestamp FROM `{!_MYSQL_PREFIX!}_pool` WHERE id=%s LIMIT 1", array(bigintval($_GET['id'])), __FILE__, __LINE__); // Load timestamp from last order @@ -595,7 +595,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); $OLD_ORDER = false; $subject = ""; $text = ""; $target = ""; // Check if we already have an order placed and make it editable - $result = SQL_QUERY_ESC("SELECT subject, text, payment_id, timestamp, url, target_send, cat_id, zip FROM `{!MYSQL_PREFIX!}_pool` WHERE sender=%s AND data_type='TEMP' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT subject, text, payment_id, timestamp, url, target_send, cat_id, zip FROM `{!_MYSQL_PREFIX!}_pool` WHERE sender=%s AND data_type='TEMP' LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { @@ -700,19 +700,19 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); } } else { // No mail types defined - LOAD_TEMPLATE("admin_settings_saved", false, "".MEMBER_NO_PAYMENTS.""); + LOAD_TEMPLATE("admin_settings_saved", false, "{!MEMBER_NO_PAYMENTS!}"); } } else { // No points left! - LOAD_TEMPLATE("admin_settings_saved", false, "".MEMBER_NO_POINTS.""); + LOAD_TEMPLATE("admin_settings_saved", false, "{!MEMBER_NO_POINTS!}"); } } else { // No cateogries are defined yet - LOAD_TEMPLATE("admin_settings_saved", false, "".MEMBER_NO_CATS.""); + LOAD_TEMPLATE("admin_settings_saved", false, "{!MEMBER_NO_CATS!}"); } } elseif ($mmails == "0") { // Please set more than 0 mails per day! - LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_HAS_ZERO_MMAILS); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_HAS_ZERO_MMAILS')); } else { // Please confirm some mails first! LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_LINKS_LEFT_1.$links.MEMBER_LINKS_LEFT_2.getConfig('unconfirmed').MEMBER_LINKS_LEFT_3); diff --git a/inc/modules/member/what-payout.php b/inc/modules/member/what-payout.php index d8d9af5369..451ab74901 100644 --- a/inc/modules/member/what-payout.php +++ b/inc/modules/member/what-payout.php @@ -47,7 +47,7 @@ if (!defined('__SECURITY')) { // Add description as navigation point ADD_DESCR("member", __FILE__); -$result_depths = SQL_QUERY("SELECT level, percents FROM `{!MYSQL_PREFIX!}_refdepths` ORDER BY level", __FILE__, __LINE__); +$result_depths = SQL_QUERY("SELECT level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` ORDER BY level", __FILE__, __LINE__); $TPTS = 0; while (list($lvl, $per) = SQL_FETCHROW($result_depths)) { // Load referal points @@ -83,7 +83,7 @@ if (empty($_GET['payout'])) { // Load payout types $result = SQL_QUERY_ESC("SELECT id, type, rate, min_points, allow_url -FROM `{!MYSQL_PREFIX!}_payout_types` +FROM `{!_MYSQL_PREFIX!}_payout_types` WHERE %s >= min_points ORDER BY type", array(REVERT_COMMA($TPTS)), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) @@ -93,8 +93,8 @@ ORDER BY type", array(REVERT_COMMA($TPTS)), __FILE__, __LINE__); // Check for his payouts $result_payouts = SQL_QUERY_ESC("SELECT DISTINCT p.id, p.payout_total, p.target_account, p.target_bank, t.type, p.payout_timestamp, p.status, t.allow_url AS allow, p.target_url AS url, p.link_text AS alt, p.banner_url AS bannerm -FROM `{!MYSQL_PREFIX!}_user_payouts` AS p -LEFT JOIN `{!MYSQL_PREFIX!}_payout_types` AS t +FROM `{!_MYSQL_PREFIX!}_user_payouts` AS p +LEFT JOIN `{!_MYSQL_PREFIX!}_payout_types` AS t ON p.payout_id = t.id WHERE p.userid = %s ORDER BY p.payout_timestamp DESC", @@ -163,7 +163,7 @@ ORDER BY p.payout_timestamp DESC", else { // Chedk if he can get paid by selected type - $result = SQL_QUERY_ESC("SELECT type, rate, min_points, allow_url FROM `{!MYSQL_PREFIX!}_payout_types` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT type, rate, min_points, allow_url FROM `{!_MYSQL_PREFIX!}_payout_types` WHERE id=%s LIMIT 1", array(bigintval($_GET['payout'])), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) @@ -202,7 +202,7 @@ ORDER BY p.payout_timestamp DESC", if ($allow == "Y") { // Banner/textlink ordered - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_user_payouts` (userid, payout_total, payout_id, payout_timestamp, status, target_url, link_text, banner_url) + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_payouts` (userid, payout_total, payout_id, payout_timestamp, status, target_url, link_text, banner_url) VALUES (%s,%s,%s, UNIX_TIMESTAMP(), 'NEW','%s','%s','%s')", array( $GLOBALS['userid'], @@ -227,7 +227,7 @@ VALUES (%s,%s,%s, UNIX_TIMESTAMP(), 'NEW','%s','%s','%s')", else { // e-currency payout requested - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_user_payouts` (userid, payout_total, target_account, target_bank, payout_id, payout_timestamp, status, password) + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_payouts` (userid, payout_total, target_account, target_bank, payout_id, payout_timestamp, status, password) VALUES (%s,%s,%s,'%s',%s, UNIX_TIMESTAMP(), 'NEW','%s')", array( $GLOBALS['userid'], @@ -249,7 +249,7 @@ VALUES (%s,%s,%s,'%s',%s, UNIX_TIMESTAMP(), 'NEW','%s')", } // Generate task - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_task_system` (assigned_admin, status, task_type, subject, text, task_created, userid) + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_task_system` (assigned_admin, status, task_type, subject, text, task_created, userid) VALUES (0, 'NEW','PAYOUT_REQUEST','[payout:] ".PAYOUT_REQUEST_ADMIN."','%s', UNIX_TIMESTAMP(), %s)", array( $msg_adm, diff --git a/inc/modules/member/what-points.php b/inc/modules/member/what-points.php index 648116e4db..8480ee81b9 100644 --- a/inc/modules/member/what-points.php +++ b/inc/modules/member/what-points.php @@ -42,7 +42,7 @@ if (!defined('__SECURITY')) { // Add description as navigation point ADD_DESCR("member", __FILE__); -$result_depths = SQL_QUERY("SELECT level, percents FROM `{!MYSQL_PREFIX!}_refdepths` ORDER BY level", __FILE__, __LINE__); +$result_depths = SQL_QUERY("SELECT level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` ORDER BY level", __FILE__, __LINE__); $depths = SQL_NUMROWS($result_depths); // Add many more rows for the login/turbo/ref/order bonus @@ -62,7 +62,7 @@ while (list($lvl, $per) = SQL_FETCHROW($result_depths)) { $REFS = 0; // Load referal points - $result_points = SQL_QUERY_ESC("SELECT points, locked_points FROM `{!MYSQL_PREFIX!}_user_points` WHERE userid=%s AND ref_depth=%d LIMIT 1", array($GLOBALS['userid'], bigintval($lvl)), __FILE__, __LINE__); + $result_points = SQL_QUERY_ESC("SELECT points, locked_points FROM `{!_MYSQL_PREFIX!}_user_points` WHERE userid=%s AND ref_depth=%d LIMIT 1", array($GLOBALS['userid'], bigintval($lvl)), __FILE__, __LINE__); if (SQL_NUMROWS($result_points) == 1) { list($points, $locked) = SQL_FETCHROW($result_points); SQL_FREERESULT($result_points); @@ -73,7 +73,7 @@ while (list($lvl, $per) = SQL_FETCHROW($result_depths)) { } // Load referal 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); @@ -101,7 +101,7 @@ SQL_FREERESULT($result_depths); // Put rows to constant for the main template define('__REF_LEVEL_ROWS', $OUT); -$result = SQL_QUERY_ESC("SELECT used_points, ref_payout FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", +$result = SQL_QUERY_ESC("SELECT used_points, ref_payout FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); list($USED, $PAY) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -115,7 +115,7 @@ if (GET_EXT_VERSION("user") >= "0.1.2") { if (GET_EXT_VERSION("user") >= "0.1.4") { $ADD = ", emails_sent, emails_received"; } - $result = SQL_QUERY_ESC("SELECT mails_confirmed".$ADD." FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); + $result = SQL_QUERY_ESC("SELECT mails_confirmed".$ADD." FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); list($CONFIRMED, $SENT, $RECEIVED) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -145,7 +145,7 @@ if ((GET_EXT_VERSION("bonus") >= "0.2.2") && (EXT_IS_ACTIVE("bonus")) && (getCon if (GET_EXT_VERSION("bonus") >= "0.4.4") $ADD = ", bonus_ref, bonus_order, bonus_stats"; // Load data - $result = SQL_QUERY_ESC("SELECT login_bonus, turbo_bonus".$ADD." FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT login_bonus, turbo_bonus".$ADD." FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); // We don't add this points now. This will be done after each month diff --git a/inc/modules/member/what-primera.php b/inc/modules/member/what-primera.php index 38c4e95ba7..4219cca7ff 100644 --- a/inc/modules/member/what-primera.php +++ b/inc/modules/member/what-primera.php @@ -63,7 +63,7 @@ if (!isset($_GET['mode'])) { $content['refid'] = bigintval(getConfig('primera_refid')); // Get Primus id - $result = SQL_QUERY_ESC("SELECT primera_userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT primera_userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); // Are there some entries? @@ -81,7 +81,7 @@ if (!isset($_GET['mode'])) { $_GET['mode'] = "list"; // And load all rows! - $result = SQL_QUERY_ESC("SELECT `id`, `primera_account`, `primera_amount`, `primera_timestamp`, `primera_type` FROM `{!MYSQL_PREFIX!}_user_primera` WHERE `userid` = %s ORDER BY `primera_timestamp` DESC", + $result = SQL_QUERY_ESC("SELECT `id`, `primera_account`, `primera_amount`, `primera_timestamp`, `primera_type` FROM `{!_MYSQL_PREFIX!}_user_primera` WHERE `userid` = %s ORDER BY `primera_timestamp` DESC", array($GLOBALS['userid']), __FILE__, __LINE__); // Load all rows @@ -133,7 +133,7 @@ if ($_GET['mode'] == "pay") { // Get Primera id $content['primera_nickname'] = ""; - $result = SQL_QUERY_ESC("SELECT primera_userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT primera_userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); // Are there some entries? @@ -197,7 +197,7 @@ if ((isset($_POST['ok'])) && (isset($_GET['mode']))) { SUB_POINTS("primera_payout", $GLOBALS['userid'], $_POST['amount']); // Update primera nickname - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET `primera_userid`=%s WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `primera_userid`=%s WHERE userid=%s LIMIT 1", array($_POST['primera_nickname'], $GLOBALS['userid']), __FILE__, __LINE__); // All done! diff --git a/inc/modules/member/what-rallyes.php b/inc/modules/member/what-rallyes.php index 47f67fc61f..4968328952 100644 --- a/inc/modules/member/what-rallyes.php +++ b/inc/modules/member/what-rallyes.php @@ -51,7 +51,7 @@ OUTPUT_HTML("
    "); $ADMIN = " AND d.is_active='Y'"; if (IS_ADMIN()) $ADMIN = ""; $result = SQL_QUERY("SELECT DISTINCT d.id, d.admin_id, a.login, d.title, d.descr, d.template, d.start_time, d.end_time, d.min_users, d.min_prices - FROM `{!MYSQL_PREFIX!}_rallye_data` AS d, `{!MYSQL_PREFIX!}_admins` AS a + FROM `{!_MYSQL_PREFIX!}_rallye_data` AS d, `{!_MYSQL_PREFIX!}_admins` AS a WHERE d.admin_id=a.id".$ADMIN." AND d.notified='Y' ORDER BY d.end_time LIMIT 1", __FILE__, __LINE__); @@ -75,10 +75,10 @@ if (SQL_NUMROWS($result) == 1) } else { - define('__RALLYE_EXTRAS', "".RALLYE_GET_REFLINK.""); + define('__RALLYE_EXTRAS', "".RALLYE_GET_REFLINK.""); } // Set admin line (currently set to impressum, later to contact form) - define('__RALLYE_ADMIN', "".$login.""); + define('__RALLYE_ADMIN', "".$login.""); // Set title define('__RALLYE_TITLE', COMPILE_CODE($title)); diff --git a/inc/modules/member/what-refback.php b/inc/modules/member/what-refback.php index 014e8f5f0f..7bd83a4acd 100644 --- a/inc/modules/member/what-refback.php +++ b/inc/modules/member/what-refback.php @@ -46,7 +46,7 @@ if (!defined('__SECURITY')) { // Is the refback system enabled? if (getConfig('refback_enabled') == "N") { // Output message - LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_DISABLED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_REFBACK_DISABLED')); // Abort here return false; } // END - if @@ -69,13 +69,13 @@ if ((isset($_POST['edit'])) && (isset($_POST['id']))) { // Check status if (isset($status['ok'])) { // No message found - LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_DONE); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_REFBACK_DONE')); } elseif (isset($status['message'])) { // Something went wrong with error message LOAD_TEMPLATE("admin_settings_saved", false, sprintf(MEMBER_REFBACK_ERROR_MESSAGE, $status['message'])); } else { // No message found - LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_ERROR_EMPTY_MESSAGE); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_REFBACK_ERROR_EMPTY_MESSAGE); } } else { // Percents out-of-bounds ;-) @@ -100,7 +100,7 @@ if ((isset($_POST['edit'])) && (isset($_POST['id']))) { // Load all referal levels $result = SQL_QUERY_ESC("SELECT r.level, r.percents -FROM `{!MYSQL_PREFIX!}_refdepths` AS r +FROM `{!_MYSQL_PREFIX!}_refdepths` AS r WHERE r.level > 0 ORDER BY r.level ASC", array($GLOBALS['userid']), __FILE__, __LINE__); @@ -153,7 +153,7 @@ if (SQL_NUMROWS($result) > 0) { LOAD_TEMPLATE("member_refback_list", false, $OUT); } else { // No entries - LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_NO_ENTRIES); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_REFBACK_NO_ENTRIES')); } // Free result diff --git a/inc/modules/member/what-reflinks.php b/inc/modules/member/what-reflinks.php index f597c457fd..8b400c254c 100644 --- a/inc/modules/member/what-reflinks.php +++ b/inc/modules/member/what-reflinks.php @@ -43,13 +43,13 @@ if (!defined('__SECURITY')) { ADD_DESCR("member", __FILE__); // Load current referal clicks -$result = SQL_QUERY_ESC("SELECT ref_clicks FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", +$result = SQL_QUERY_ESC("SELECT ref_clicks FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); list($c) = SQL_FETCHROW($result); SQL_FREERESULT($result); OUTPUT_HTML("
    ".YOUR_PERSONAL_REFLINK.":
    -".URL."/ref.php?ref=".$GLOBALS['userid']."
    +{!URL!}/ref.php?ref=".$GLOBALS['userid']."

    "); if (EXT_IS_ACTIVE("nickname")) { @@ -59,20 +59,20 @@ if (EXT_IS_ACTIVE("nickname")) { if (!empty($nick)) { // Display nickname link OUTPUT_HTML(NICKNAME_YOUR_REFLINK.":
    -".URL."/ref.php?ref=".$nick."
    +{!URL!}/ref.php?ref=".$nick."

    "); } else { // Display link to nickname form OUTPUT_HTML("
    ".NO_NICKNAME_SET."
    -".PLEASE_CLICK_NICKNAME_FORM.""); +".PLEASE_CLICK_NICKNAME_FORM.""); } } // Clicks on your reflink OUTPUT_HTML(YOUR_REFCLICKS.": ".$c." ".CLICKS."


    "); -$whereStatement = " WHERE visible='Y'"; +$whereStatement = " WHERE `visible`='Y'"; if (IS_ADMIN()) $whereStatement = ""; -$result = SQL_QUERY("SELECT id, url, alternate, counter, clicks FROM `{!MYSQL_PREFIX!}_refbanner`", __FILE__, __LINE__); +$result = SQL_QUERY("SELECT id, url, alternate, counter, clicks FROM `{!_MYSQL_PREFIX!}_refbanner`", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // List available ref banners @@ -119,7 +119,7 @@ if (SQL_NUMROWS($result) > 0) { LOAD_TEMPLATE("member_reflinks_table", false, $GLOBALS['userid']); } else { // No refbanner found! - LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_NO_REFBANNER_FOUND); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_NO_REFBANNER_FOUND')); } // Free result diff --git a/inc/modules/member/what-reflist.php b/inc/modules/member/what-reflist.php index dbede43df8..adec5a282a 100644 --- a/inc/modules/member/what-reflist.php +++ b/inc/modules/member/what-reflist.php @@ -45,7 +45,7 @@ ADD_DESCR("member", __FILE__); // Load all referal levels $result = SQL_QUERY_ESC("SELECT r.level, r.percents -FROM `{!MYSQL_PREFIX!}_refdepths` AS r +FROM `{!_MYSQL_PREFIX!}_refdepths` AS r WHERE r.level > 0 ORDER BY r.level ASC", array($GLOBALS['userid']), __FILE__, __LINE__); @@ -91,7 +91,7 @@ if (SQL_NUMROWS($result) > 0) { LOAD_TEMPLATE("member_ref_list", false, $OUT); } else { // No entries - LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_NO_ENTRIES); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_REFBACK_NO_ENTRIES')); } // Free result diff --git a/inc/modules/member/what-stats.php b/inc/modules/member/what-stats.php index 1b76b8fd27..2c000bc979 100644 --- a/inc/modules/member/what-stats.php +++ b/inc/modules/member/what-stats.php @@ -47,7 +47,7 @@ $main_content = array(); // Load waiting/pending orders $result = SQL_QUERY_ESC("SELECT id, cat_id, payment_id, subject, url, timestamp, target_send, data_type, zip -FROM `{!MYSQL_PREFIX!}_pool` +FROM `{!_MYSQL_PREFIX!}_pool` WHERE sender=%s AND data_type != 'SEND' ORDER BY timestamp DESC", array($GLOBALS['userid']), __FILE__, __LINE__); @@ -85,7 +85,7 @@ if (SQL_NUMROWS($result) > 0) { $main_content['pool'] = LOAD_TEMPLATE("member_pool_table", true, $OUT); } else { // No mails in pool! - $main_content['pool'] = LOAD_TEMPLATE("admin_settings_saved", true, MEMBER_NO_MAILS_IN_POOL); + $main_content['pool'] = LOAD_TEMPLATE("admin_settings_saved", true, getMessage('MEMBER_NO_MAILS_IN_POOL')); } // Free result @@ -94,7 +94,7 @@ SQL_FREERESULT($result); // Load sent orders // 0 1 2 3 4 5 6 7 8 $result = SQL_QUERY_ESC("SELECT id, cat_id, payment_id, subject, url, timestamp_ordered, max_rec, timestamp_send, clicks -FROM `{!MYSQL_PREFIX!}_user_stats` +FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE userid=%s ORDER BY timestamp_ordered DESC", array($GLOBALS['userid']), __FILE__, __LINE__); @@ -126,7 +126,7 @@ if (SQL_NUMROWS($result) > 0) { $main_content['stats'] = LOAD_TEMPLATE("member_stats_table", true, $OUT); } else { // No mail orders fond - $main_content['stats'] = LOAD_TEMPLATE("admin_settings_saved", true, MEMBER_NO_MAILS_IN_STATS); + $main_content['stats'] = LOAD_TEMPLATE("admin_settings_saved", true, getMessage('MEMBER_NO_MAILS_IN_STATS')); } // Free result diff --git a/inc/modules/member/what-support.php b/inc/modules/member/what-support.php index f4bb2318f0..0e977d5bb9 100644 --- a/inc/modules/member/what-support.php +++ b/inc/modules/member/what-support.php @@ -71,7 +71,7 @@ if ((!isset($_POST['ok'])) || (empty($_POST['qsummary']))) { SEND_EMAIL($GLOBALS['userid'], $subj_m, $msg_m); // Drop a message in the admin's area - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_task_system` (userid, assigned_admin, status, task_type, subject, text, task_created) VALUES ('%s','0','NEW','SUPPORT_MEMBER','%s','%s', UNIX_TIMESTAMP())", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_task_system` (userid, assigned_admin, status, task_type, subject, text, task_created) VALUES ('%s','0','NEW','SUPPORT_MEMBER','%s','%s', UNIX_TIMESTAMP())", array($GLOBALS['userid'], $subj_a, $_POST['qsummary'].":".array('text' => $_POST['qdetails'])), __FILE__, __LINE__); // Form sent diff --git a/inc/modules/member/what-surfbar_book.php b/inc/modules/member/what-surfbar_book.php index c1d861aeca..e44abfdbf6 100644 --- a/inc/modules/member/what-surfbar_book.php +++ b/inc/modules/member/what-surfbar_book.php @@ -49,7 +49,7 @@ ADD_DESCR("member", __FILE__); // Still allowed to book more URLs? if (!SURFBAR_IF_USER_BOOK_MORE_URLS()) { // No more URLs allowed to book! - LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_SURFBAR_NO_MORE_ALLOWED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_SURFBAR_NO_MORE_ALLOWED')); } elseif ((isset($_POST['ok'])) && (isset($_POST['limited']))) { // Is limitation "no" and "limit" is > 0? if (($_POST['limited'] == "N") && ((isset($_POST['limit'])) && ($_POST['limit'] > 0)) || (!isset($_POST['limit']))) { diff --git a/inc/modules/member/what-surfbar_list.php b/inc/modules/member/what-surfbar_list.php index d3754e6c13..5385162763 100644 --- a/inc/modules/member/what-surfbar_list.php +++ b/inc/modules/member/what-surfbar_list.php @@ -55,11 +55,11 @@ if ((isset($_POST['ok'])) && (isset($_POST['action'])) && (isset($_POST['id']))) // Action performed but shall we display it? if ((($_POST['action'] != "edit") && ($_POST['action'] != "delete")) || (isset($_POST['execute']))) { // Display "action done" message if action is wether 'edit' nor 'delete' or has been executed - LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_SURFBAR_ACTION_DONE); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_SURFBAR_ACTION_DONE')); } // END - if } else { // Something went wrong - LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_SURFBAR_ACTION_FAILED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_SURFBAR_ACTION_FAILED')); } } elseif (count($URLs) > 0) { // List all URLs @@ -70,7 +70,7 @@ if ((isset($_POST['ok'])) && (isset($_POST['action'])) && (isset($_POST['id']))) $content['url'] = DEREFERER($content['url']); if ($content['views_total'] > 0) { // Include link to stats - $content['views_total'] = "[".TRANSLATE_COMMA($content['views_total'])."]"; + $content['views_total'] = "[".TRANSLATE_COMMA($content['views_total'])."]"; } // END - if $content['registered'] = MAKE_DATETIME($content['registered'], "2"); $content['last_locked'] = MAKE_DATETIME($content['last_locked'], "2"); @@ -92,7 +92,7 @@ if ((isset($_POST['ok'])) && (isset($_POST['action'])) && (isset($_POST['id']))) LOAD_TEMPLATE("member_surfbar_list", false, $OUT); } else { // No URLs booked so far - LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_SURFBAR_NO_URLS_FOUND); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_SURFBAR_NO_URLS_FOUND')); } // diff --git a/inc/modules/member/what-themes.php b/inc/modules/member/what-themes.php index 6abebb41fd..2034e6e63b 100644 --- a/inc/modules/member/what-themes.php +++ b/inc/modules/member/what-themes.php @@ -47,7 +47,7 @@ ADD_DESCR("member", __FILE__); if (!empty($_POST['member_theme'])) { // Save theme to member's profile - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET curr_theme='%s' WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET curr_theme='%s' WHERE userid=%s LIMIT 1", array($_POST['member_theme'], $GLOBALS['userid']), __FILE__, __LINE__); // Set new theme for guests @@ -57,7 +57,7 @@ if (!empty($_POST['member_theme'])) { set_session('mxchange_theme', $newTheme); // Theme saved! - LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_THEME_SAVED); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_THEME_SAVED')); } // Initialize array @@ -123,7 +123,7 @@ if (empty($OUT)) { // No themes found??? $OUT = "
    - ".LOAD_TEMPLATE("admin_settings_saved", true, MEMBER_NO_THEMES_FOUND)." + ".LOAD_TEMPLATE("admin_settings_saved", true, getMessage('MEMBER_NO_THEMES_FOUND'))."
    @@ -456,7 +456,7 @@ array($GLOBALS['userid'], getConfig('transfer_max')), __FILE__, __LINE__); LOAD_TEMPLATE("member_transfer_list"); // At the end we don't need a temporary table in memory - $result = SQL_QUERY("DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_transfers_tmp`", __FILE__, __LINE__); + $result = SQL_QUERY("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_transfers_tmp`", __FILE__, __LINE__); // Free some memory... SQL_FREERESULT($result); @@ -464,39 +464,39 @@ array($GLOBALS['userid'], getConfig('transfer_max')), __FILE__, __LINE__); case "": // Overview page // Check incoming transfers - $result = SQL_QUERY_ESC("SELECT COUNT(id) FROM `{!MYSQL_PREFIX!}_user_transfers_in` WHERE userid=%s", array($GLOBALS['userid']), __FILE__, __LINE__); + $result = SQL_QUERY_ESC("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_user_transfers_in` WHERE userid=%s", array($GLOBALS['userid']), __FILE__, __LINE__); list($dmy) = SQL_FETCHROW($result); SQL_FREERESULT($result); $total=$dmy; if ($dmy > 0) { - define('__TRANSFER_IN_LINK', "".$dmy.""); + define('__TRANSFER_IN_LINK', "".$dmy.""); } else { define('__TRANSFER_IN_LINK', $dmy); } // Check outgoing transfers - $result = SQL_QUERY_ESC("SELECT COUNT(id) FROM `{!MYSQL_PREFIX!}_user_transfers_out` WHERE userid=%s", array($GLOBALS['userid']), __FILE__, __LINE__); + $result = SQL_QUERY_ESC("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_user_transfers_out` WHERE userid=%s", array($GLOBALS['userid']), __FILE__, __LINE__); list($dmy) = SQL_FETCHROW($result); SQL_FREERESULT($result); $total+=$dmy; if ($dmy > 0) { - define('__TRANSFER_OUT_LINK', "".$dmy.""); + define('__TRANSFER_OUT_LINK', "".$dmy.""); } else { define('__TRANSFER_OUT_LINK', $dmy); } // Total transactions if ($total > 0) { - define('__TRANSFER_ALL_LINK', "".$total.""); + define('__TRANSFER_ALL_LINK', "".$total.""); } else { define('__TRANSFER_ALL_LINK', $total); } if (isset($_POST['ok'])) { // Save settings - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET opt_in='%s' WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET opt_in='%s' WHERE userid=%s LIMIT 1", array($_POST['opt_in'], $GLOBALS['userid']), __FILE__, __LINE__); // Rember for next switch() command @@ -511,7 +511,7 @@ case "": // Overview page case "Y": define('__TRANSFER_ALLOW_Y', " checked=\"checked\""); define('__TRANSFER_ALLOW_N', ""); - define('__TRANSFER_NEW_LINK', "".TRANSFER_NOW_LINK.""); + define('__TRANSFER_NEW_LINK', "".TRANSFER_NOW_LINK.""); break; case "N": @@ -523,7 +523,7 @@ case "": // Overview page // Check for latest out-transfers $result = SQL_QUERY_ESC("SELECT time_trans -FROM `{!MYSQL_PREFIX!}_user_transfers_out` +FROM `{!_MYSQL_PREFIX!}_user_transfers_out` WHERE time_trans > (UNIX_TIMESTAMP() - %s) AND userid=%s ORDER BY time_trans DESC LIMIT 1", array(getConfig('transfer_timeout'), $GLOBALS['userid']), __FILE__, __LINE__); diff --git a/inc/modules/member/what-unconfirmed.php b/inc/modules/member/what-unconfirmed.php index 3728a410aa..2ea5c6d34a 100644 --- a/inc/modules/member/what-unconfirmed.php +++ b/inc/modules/member/what-unconfirmed.php @@ -48,7 +48,7 @@ ADD_DESCR("member", __FILE__); if ((isset($_GET['bonusid'])) && (EXT_IS_ACTIVE("bonus"))) { // Display bonus mail by loading it's full data $result_data = SQL_QUERY_ESC("SELECT id, subject, timestamp, cat_id, points, text, is_notify, data_type, time, url -FROM `{!MYSQL_PREFIX!}_bonus` +FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1", array(bigintval($_GET['bonusid'])), __FILE__, __LINE__); @@ -79,10 +79,10 @@ WHERE id=%s LIMIT 1", } elseif (isset($_GET['mailid'])) { // Display regular member mail by loading its full data $result_data = SQL_QUERY_ESC("SELECT s.id, s.subject, p.text, s.timestamp_ordered AS `timestamp`, s.cat_id, pay.price AS points, p.sender, pay.time, p.data_type -FROM `{!MYSQL_PREFIX!}_user_stats` AS s -LEFT JOIN `{!MYSQL_PREFIX!}_pool` AS p +FROM `{!_MYSQL_PREFIX!}_user_stats` AS s +LEFT JOIN `{!_MYSQL_PREFIX!}_pool` AS p ON s.pool_id=p.id -LEFT JOIN `{!MYSQL_PREFIX!}_payments` AS pay +LEFT JOIN `{!_MYSQL_PREFIX!}_payments` AS pay ON p.payment_id=pay.id WHERE s.id=%s LIMIT 1", array(bigintval($_GET['mailid'])), __FILE__, __LINE__); @@ -113,11 +113,11 @@ WHERE s.id=%s LIMIT 1", if (EXT_IS_ACTIVE("bonus")) { // Load bonus ID - $result = SQL_QUERY_ESC("SELECT stats_id, bonus_id, link_type FROM `{!MYSQL_PREFIX!}_user_links` WHERE userid=%s ORDER BY bonus_id DESC, stats_id DESC", + $result = SQL_QUERY_ESC("SELECT stats_id, bonus_id, link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE userid=%s ORDER BY bonus_id DESC, stats_id DESC", array($GLOBALS['userid']), __FILE__, __LINE__); } else { // Don't load bonus ID - $result = SQL_QUERY_ESC("SELECT stats_id, stats_id, link_type FROM `{!MYSQL_PREFIX!}_user_links` WHERE userid=%s ORDER BY stats_id DESC", + $result = SQL_QUERY_ESC("SELECT stats_id, stats_id, link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE userid=%s ORDER BY stats_id DESC", array($GLOBALS['userid']), __FILE__, __LINE__); } @@ -132,8 +132,8 @@ if (SQL_NUMROWS($result) > 0) { { case "NORMAL": $result_data = SQL_QUERY_ESC("SELECT s.subject, s.timestamp_ordered, s.cat_id, s.payment_id, p.sender -FROM `{!MYSQL_PREFIX!}_user_stats` AS s -LEFT JOIN `{!MYSQL_PREFIX!}_pool` AS p +FROM `{!_MYSQL_PREFIX!}_user_stats` AS s +LEFT JOIN `{!_MYSQL_PREFIX!}_pool` AS p ON s.pool_id=p.id WHERE s.id=%s LIMIT 1", @@ -142,7 +142,7 @@ LIMIT 1", break; case "BONUS": - $result_data = SQL_QUERY_ESC("SELECT subject, timestamp, cat_id, points, 0 FROM `{!MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1", + $result_data = SQL_QUERY_ESC("SELECT subject, timestamp, cat_id, points, 0 FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1", array(bigintval($id2)), __FILE__, __LINE__); $type = "bonusid"; $DATA = $id2; $PROBLEM = BONUS_MAIL_PROBLEM; break; @@ -240,7 +240,7 @@ LIMIT 1", } } else { // No mails left to confirm... :) - LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_NO_MAILS_TO_CONFIRM); + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_NO_MAILS_TO_CONFIRM')); } // diff --git a/inc/modules/member/what-welcome.php b/inc/modules/member/what-welcome.php index 127da07de6..c52971a46e 100644 --- a/inc/modules/member/what-welcome.php +++ b/inc/modules/member/what-welcome.php @@ -50,7 +50,7 @@ define('_LAST_MODULE_VALUE', GET_MOD_DESCR("member", $LAST['module'])); LOAD_TEMPLATE("member_welcome_header"); // Chedk if he is returning from a profile update notification -$result = SQL_QUERY_ESC("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE notified='Y' AND userid=%s LIMIT 1", +$result = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE notified='Y' AND userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); if ((SQL_NUMROWS($result) == 1) && (EXT_IS_ACTIVE("profile"))) { diff --git a/inc/modules/member/what-wernis.php b/inc/modules/member/what-wernis.php index d9ead54bdf..b5f4913e6d 100644 --- a/inc/modules/member/what-wernis.php +++ b/inc/modules/member/what-wernis.php @@ -63,7 +63,7 @@ if ((!isset($_GET['mode'])) || ($_GET['mode'] == "choose")) { $content['wds66_id'] = 0; // Get WDS66 id - $result = SQL_QUERY_ESC("SELECT wernis_userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT wernis_userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); // Are there some entries? @@ -81,7 +81,7 @@ if ((!isset($_GET['mode'])) || ($_GET['mode'] == "choose")) { $_GET['mode'] = "list"; // And load all rows! - $result = SQL_QUERY_ESC("SELECT `id`, `wernis_account`, `wernis_amount`, `wernis_timestamp`, `wernis_type` FROM `{!MYSQL_PREFIX!}_user_wernis` WHERE `userid` = %s ORDER BY `wernis_timestamp` DESC", + $result = SQL_QUERY_ESC("SELECT `id`, `wernis_account`, `wernis_amount`, `wernis_timestamp`, `wernis_type` FROM `{!_MYSQL_PREFIX!}_user_wernis` WHERE `userid` = %s ORDER BY `wernis_timestamp` DESC", array($GLOBALS['userid']), __FILE__, __LINE__); // Load all rows @@ -112,13 +112,13 @@ if ((!isset($_GET['mode'])) || ($_GET['mode'] == "choose")) { // Is the payout mode active? if (getConfig('wernis_payout_active') == "Y") { // Add link - $content['payout_link'] = "
    ".MEMBER_WERNIS_MODE_PAYOUT."
    "; + $content['payout_link'] = "
    ".MEMBER_WERNIS_MODE_PAYOUT."
    "; } // END - if // Is the withdraw mode active? if (getConfig('wernis_withdraw_active') == "Y") { // Add link - $content['withdraw_link'] = "
    ".MEMBER_WERNIS_MODE_WITHDRAW."
    "; + $content['withdraw_link'] = "
    ".MEMBER_WERNIS_MODE_WITHDRAW."
    "; } // END - if // Mode chooser! ;-) @@ -154,7 +154,7 @@ if ((!isset($_GET['mode'])) || ($_GET['mode'] == "choose")) { // Get WDS66 id $content['wds66_id'] = ""; - $result = SQL_QUERY_ESC("SELECT wernis_userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT wernis_userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); // Are there some entries? @@ -178,7 +178,7 @@ if ((!isset($_GET['mode'])) || ($_GET['mode'] == "choose")) { WERNIS_ADD_FEES_TO_ARRAY($content); // Get WDS66 id - $result = SQL_QUERY_ESC("SELECT wernis_userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT wernis_userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); // Are there some entries? @@ -235,7 +235,7 @@ if ((isset($_POST['ok'])) && (isset($_GET['mode']))) { ADD_POINTS_REFSYSTEM("wernis_withdraw", $GLOBALS['userid'], bigintval($_POST['amount']), false, 0, false, "direct"); // Update the user data as well.. - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET `wernis_userid`=%s WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `wernis_userid`=%s WHERE userid=%s LIMIT 1", array(bigintval($_POST['wds66_id']), $GLOBALS['userid']), __FILE__, __LINE__); // All done! @@ -270,7 +270,7 @@ if ((isset($_POST['ok'])) && (isset($_GET['mode']))) { SUB_POINTS("wernis_payout", $GLOBALS['userid'], $_POST['amount']); // Update WDS66 id - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET `wernis_userid`=%s WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `wernis_userid`=%s WHERE userid=%s LIMIT 1", array(bigintval($_POST['wds66_id']), $GLOBALS['userid']), __FILE__, __LINE__); // All done! diff --git a/inc/modules/order.php b/inc/modules/order.php index 399efd48a4..9082cb50ec 100644 --- a/inc/modules/order.php +++ b/inc/modules/order.php @@ -63,19 +63,19 @@ if (empty($URL)) { } // Update sending pool - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_pool` SET data_type='%s' WHERE id=%s AND sender=%s AND data_type='TEMP' LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET data_type='%s' WHERE id=%s AND sender=%s AND data_type='TEMP' LIMIT 1", array($type, bigintval($_GET['order']), $GLOBALS['userid']), __FILE__, __LINE__); // Finally is the entry valid? if (SQL_AFFECTEDROWS() == 1) { // Load personal data... - $result = SQL_QUERY_ESC("SELECT gender, surname, family, email FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT gender, surname, family, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); list($gender, $sname, $fname, $email) = SQL_FETCHROW($result); SQL_FREERESULT($result); // Load mail again... 0 1 2 3 4 5 6 7 - $result = SQL_QUERY_ESC("SELECT subject, text, receivers, payment_id, timestamp, url, cat_id, target_send FROM `{!MYSQL_PREFIX!}_pool` WHERE id=%s AND sender=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT subject, text, receivers, payment_id, timestamp, url, cat_id, target_send FROM `{!_MYSQL_PREFIX!}_pool` WHERE id=%s AND sender=%s LIMIT 1", array(bigintval($_GET['order']), $GLOBALS['userid']), __FILE__, __LINE__); $DATA = SQL_FETCHROW($result); SQL_FREERESULT($result); diff --git a/inc/modules/sponsor/account.php b/inc/modules/sponsor/account.php index 35bbe9b8c4..a228a9aef9 100644 --- a/inc/modules/sponsor/account.php +++ b/inc/modules/sponsor/account.php @@ -48,7 +48,7 @@ $result = SQL_QUERY_ESC("SELECT company, position, tax_ident, gender, surname, family, street_nr1, street_nr2, zip, city, country, phone, fax, cell, email, url, status, receive_warnings -FROM `{!MYSQL_PREFIX!}_sponsor_data` +FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' AND password='%s' LIMIT 1", array(bigintval(get_session('sponsorid')), get_session('sponsorpass')), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { diff --git a/inc/modules/sponsor/settings.php b/inc/modules/sponsor/settings.php index 79db1ecb61..cb6c64f12f 100644 --- a/inc/modules/sponsor/settings.php +++ b/inc/modules/sponsor/settings.php @@ -45,7 +45,7 @@ if (!defined('__SECURITY')) { // Data for the formular $result = SQL_QUERY_ESC("SELECT status, receive_warnings, warning_interval, email, surname, family, gender -FROM `{!MYSQL_PREFIX!}_sponsor_data` +FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' AND password='%s' LIMIT 1", array(bigintval(get_session('sponsorid')), get_session('sponsorpass')), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { diff --git a/inc/modules/sponsor/welcome.php b/inc/modules/sponsor/welcome.php index fc4db713f5..304593ecbf 100644 --- a/inc/modules/sponsor/welcome.php +++ b/inc/modules/sponsor/welcome.php @@ -45,7 +45,7 @@ if (!defined('__SECURITY')) { // Load some data $result = SQL_QUERY_ESC("SELECT gender, surname, family, (points_amount - points_used) AS points -FROM `{!MYSQL_PREFIX!}_sponsor_data` +FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' AND password='%s' LIMIT 1", array(bigintval(get_session('sponsorid')), get_session('sponsorpass')), __FILE__, __LINE__); list($gender, $surname, $family, $points) = SQL_FETCHROW($result); diff --git a/inc/monthly/monthly_beg.php b/inc/monthly/monthly_beg.php index c11b477238..6f659675d4 100644 --- a/inc/monthly/monthly_beg.php +++ b/inc/monthly/monthly_beg.php @@ -69,7 +69,7 @@ if (($curr != getConfig('last_month')) && (getConfig('last_month') > 0) && (getC // SQL string to check for accounts $result_main = SQL_QUERY_ESC("SELECT userid, email, gender, surname, family, beg_points AS points -FROM `{!MYSQL_PREFIX!}_user_data` +FROM `{!_MYSQL_PREFIX!}_user_data` WHERE status='CONFIRMED'".$whereStatement1." AND beg_points > 0 ORDER BY beg_points DESC, userid LIMIT %s", @@ -91,7 +91,7 @@ LIMIT %s", } // END - while // Reset accounts - $result = SQL_QUERY("UPDATE `{!MYSQL_PREFIX!}_user_data` SET beg_points=0.00000 WHERE beg_points > 0", __FILE__, __LINE__); + $result = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET beg_points=0.00000 WHERE beg_points > 0", __FILE__, __LINE__); } // END - if // Free memory diff --git a/inc/monthly/monthly_bonus.php b/inc/monthly/monthly_bonus.php index db93b58aee..3f2cfe959a 100644 --- a/inc/monthly/monthly_bonus.php +++ b/inc/monthly/monthly_bonus.php @@ -76,7 +76,7 @@ if (($curr != getConfig('last_month')) && (getConfig('bonus_ranks') > 0) && ($CS // Run SQL string to check for accounts $result_main = SQL_QUERY_ESC("SELECT userid, email, gender, surname, family, (0".$ADD.") AS points -FROM `{!MYSQL_PREFIX!}_user_data` +FROM `{!_MYSQL_PREFIX!}_user_data` ".$whereStatement1."".$ADD." ORDER BY points DESC, userid LIMIT %s", @@ -102,7 +102,7 @@ LIMIT %s", } // END - while // Reset accounts - $result = SQL_QUERY("UPDATE `{!MYSQL_PREFIX!}_user_data` + $result = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET turbo_bonus=0, login_bonus=0, bonus_order=0, bonus_stats=0, bonus_ref=0", __FILE__, __LINE__); } // END - if diff --git a/inc/monthly/monthly_newsletter.php b/inc/monthly/monthly_newsletter.php index 8b88763479..b71659c451 100644 --- a/inc/monthly/monthly_newsletter.php +++ b/inc/monthly/monthly_newsletter.php @@ -48,12 +48,12 @@ $curr = date("m", time()); if (getConfig('last_month') != $curr) { // Check for unsubscribed members - $result = SQL_QUERY("SELECT userid, nl_until FROM `{!MYSQL_PREFIX!}_user_data` WHERE nl_receive='N' ORDER BY userid", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT userid, nl_until FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nl_receive='N' ORDER BY userid", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Some unsubscriptions are found so we reset them to receive newsletters - while(list($uid, $until) = SQL_FETCHROW($result)) { + while (list($uid, $until) = SQL_FETCHROW($result)) { // Update account - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET nl_receive='Y', nl_until='0' WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET nl_receive='Y', nl_until='0' WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); // Send email to him diff --git a/inc/mysql-connect.php b/inc/mysql-connect.php index ef247614ed..c9e95630ec 100644 --- a/inc/mysql-connect.php +++ b/inc/mysql-connect.php @@ -107,17 +107,17 @@ register_shutdown_function('__SHUTDOWN_HOOK'); // Check if the user setups his MySQL stuff... if ((empty($MySQL['login'])) && (!defined('mxchange_installing')) && (!isset($_GET['installing'])) && (isBooleanConstantAndTrue('mxchange_installed'))) { // No login entered and outside installation mode - echo "".LANG_WARNING.": "; + OUTPUT_HTML("{!LANG_WARNING!}: "); if (isBooleanConstantAndTrue('mxchange_installed')) { // You have changed my configuration file! - die(DIE_CONFIG_CHANGED_YOU); + mxchange_die("{!DIE_CONFIG_CHANGED_YOU!}"); } else { // Please run the installation script (maybe again) - die(DIE_RUN_INSTALL_MYSQL); + mxchange_die("{!DIE_RUN_INSTALL_MYSQL!}"); } } elseif ((!isBooleanConstantAndTrue('mxchange_installing')) && (!isset($_GET['installing'])) && (empty($MySQL['password'])) && (isBooleanConstantAndTrue('warn_no_pass'))) { // No database password entered!!! - echo "
    ".LANG_WARNING.":
    ".WARN_NULL_PASSWORD; + OUTPUT_HTML("
    {!LANG_WARNING!}:
    {!WARN_NULL_PASSWORD!}"); } // Set dummy $_CONFIG array @@ -200,7 +200,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT RUN_FILTER('init'); // Set default 'what' value - //* DEBUG: */ echo "-".$GLOBALS['module']."/".$GLOBALS['what']."-
    \n"; + //* DEBUG: */ OUTPUT_HTML("-".$GLOBALS['module']."/".$GLOBALS['what']."-
    "); if ((empty($GLOBALS['what'])) && (empty($GLOBALS['action'])) && ($CSS != 1) && ($CSS != -1)) { if ($GLOBALS['module'] == "admin") { // Set 'action' value to 'login' in admin menu @@ -241,25 +241,25 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT } } else { // Add language system - include (PATH."inc/language.php"); + require_once(PATH."inc/language.php"); // Wrong database? - addFatalMessage(WRONG_DB_SELECTED); + addFatalMessage(getMessage('WRONG_DB_SELECTED')); } } else { // Add language system - include (PATH."inc/language.php"); + require_once(PATH."inc/language.php"); // No link to database! - addFatalMessage(NO_DB_LINK); + addFatalMessage(getMessage('NO_DB_LINK')); $db = false; } } else { // Add language system - include (PATH."inc/language.php"); + require_once(PATH."inc/language.php"); // Maybe you forgot to enter your MySQL data? - addFatalMessage(MYSQL_DATA_MISSING); + addFatalMessage(getMessage('MYSQL_DATA_MISSING')); } } else { /////////////////////////////////////////////////// @@ -284,22 +284,22 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndTrue('admin_registered'))) { // Check for file permissions if (!IS_INC_WRITEABLE("config")) { - addFatalMessage(CONFIG_IS_WRITE_PROTECTED); + addFatalMessage(getMessage('CONFIG_IS_WRITE_PROTECTED')); } // END - if if (!IS_INC_WRITEABLE("dummy")) { - addFatalMessage(DUMMY_IS_WRITE_PROTECTED); + addFatalMessage(getMessage('DUMMY_IS_WRITE_PROTECTED')); } // END - if if (!IS_INC_WRITEABLE(".secret/dummy")) { - addFatalMessage(SECRET_IS_WRITE_PROTECTED); + addFatalMessage(getMessage('SECRET_IS_WRITE_PROTECTED')); } // END - if } // END - if } if ((getTotalFatalErrors() > 0) && (isBooleanConstantAndTrue('mxchange_installed')) && (!defined('mxchange_installing')) && ($CSS != "1")) { // One or more fatal error(s) occur during connect... - include (PATH."inc/header.php"); - include (PATH."inc/fatal_errors.php"); - include (PATH."inc/footer.php"); + require_once(PATH."inc/header.php"); + require_once(PATH."inc/fatal_errors.php"); + require_once(PATH."inc/footer.php"); } // END - if // diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 119fcc7ed5..9e82899320 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -53,7 +53,7 @@ function ADD_MODULE_TITLE($mod) { incrementConfigEntry('cache_hits'); } elseif (!EXT_IS_ACTIVE("cache")) { // Load from database - $result = SQL_QUERY_ESC("SELECT title FROM `{!MYSQL_PREFIX!}_mod_reg` WHERE module='%s' LIMIT 1", array($mod), __FILE__, __LINE__); + $result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_mod_reg` WHERE module='%s' LIMIT 1", array($mod), __FILE__, __LINE__); list($name) = SQL_FETCHROW($result); SQL_FREERESULT($result); } @@ -123,7 +123,7 @@ function CHECK_MODULE ($mod) { } } elseif (!EXT_IS_ACTIVE("cache")) { // Check for module in database - $result = SQL_QUERY_ESC("SELECT locked, hidden, admin_only, mem_only FROM `{!MYSQL_PREFIX!}_mod_reg` WHERE module='%s' LIMIT 1", array($mod_chk), __FILE__, __LINE__); + $result = SQL_QUERY_ESC("SELECT locked, hidden, admin_only, mem_only FROM `{!_MYSQL_PREFIX!}_mod_reg` WHERE module='%s' LIMIT 1", array($mod_chk), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Read data list($locked, $hidden, $admin, $mem) = SQL_FETCHROW($result); @@ -160,12 +160,12 @@ function CHECK_MODULE ($mod) { if (GET_EXT_VERSION("sql_patches") >= "0.3.6") { // Since 0.3.6 we have a has_menu column, this took me a half hour // to find a loop here... *sigh* - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_mod_reg` + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_mod_reg` (module, locked, hidden, mem_only, admin_only, has_menu) VALUES ('%s','Y','N','N','N','N')", array($mod_chk), __FILE__, __LINE__); } else { // Wrong/missing sql_patches! - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_mod_reg` + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_mod_reg` (module, locked, hidden, mem_only, admin_only) VALUES ('%s','Y','N','N','N')", array($mod_chk), __FILE__, __LINE__); } @@ -227,7 +227,7 @@ function ADD_DESCR ($ACC_LVL, $file, $return = false, $output = true) { $modCheck = $GLOBALS['module']; break; } - $AND = " AND (what='' OR what IS NULL)"; + $AND = " AND (what='' OR `what` IS NULL)"; } elseif (substr($file, 0, 5) == "what-") { // This is an admin what file! $type = "what"; @@ -243,7 +243,7 @@ function ADD_DESCR ($ACC_LVL, $file, $return = false, $output = true) { case "member": $modCheck = $GLOBALS['module']; if (!IS_ADMIN()) { - $AND = " AND visible='Y' AND locked='N'"; + $AND = " AND `visible`='Y' AND `locked`='N'"; } break; } @@ -264,7 +264,7 @@ function ADD_DESCR ($ACC_LVL, $file, $return = false, $output = true) { } if ((!isset($NAV_DEPTH)) && (!$return)) { $NAV_DEPTH = 0; - $prefix = "
    ".YOU_ARE_HERE." Home"; + $prefix = "
    {!YOU_ARE_HERE!} Home"; } else { if (!$return) $NAV_DEPTH++; $prefix = ""; @@ -279,7 +279,7 @@ function ADD_DESCR ($ACC_LVL, $file, $return = false, $output = true) { } // END - i // Get the title from menu - $result = SQL_QUERY_ESC("SELECT title FROM `{!MYSQL_PREFIX!}_%s_menu` WHERE %s='%s' ".$AND." LIMIT 1", + $result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE %s='%s' ".$AND." LIMIT 1", array($ACC_LVL, $type, $search), __FILE__, __LINE__); // Menu found? @@ -293,7 +293,7 @@ function ADD_DESCR ($ACC_LVL, $file, $return = false, $output = true) { return $ret; } elseif (((GET_EXT_VERSION("sql_patches") >= "0.2.3") && (getConfig('youre_here') == "Y")) || ((IS_ADMIN()) && ($modCheck == "admin"))) { // Output HTML code - $OUT = $prefix."".$ret."\n"; + $OUT = $prefix."".$ret."\n"; // Can we close the you-are-here navigation? //* DEBUG: */ echo __LINE__."*".$type."/".$GLOBALS['what']."*
    \n"; @@ -330,16 +330,16 @@ function ADD_MENU ($MODE, $act, $wht) { $main_action = ""; $sub_what = ""; - if (!VALIDATE_MENU_ACTION($MODE, $act, $wht, true)) return CODE_MENU_NOT_VALID; + if (!VALIDATE_MENU_ACTION($MODE, $act, $wht, true)) return getMessage('CODE_MENU_NOT_VALID'); // Non-admin shall not see all menus if (!IS_ADMIN()) { - $AND = " AND visible='Y' AND locked='N'"; + $AND = " AND `visible`='Y' AND `locked`='N'"; } // Load SQL data and add the menu to the output stream... - $result_main = SQL_QUERY_ESC("SELECT title, action FROM `{!MYSQL_PREFIX!}_%s_menu` WHERE (what='' OR what IS NULL)".$AND." ORDER BY sort", - array($MODE), __FILE__, __LINE__); + $result_main = SQL_QUERY_ESC("SELECT title, action FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE (what='' OR `what` IS NULL)".$AND." ORDER BY `sort`", + array($MODE), __FILE__, __LINE__); //* DEBUG: */ echo __LINE__."/".$main_cnt."/".$main_action."/".$sub_what.":".$GLOBALS['what']."*
    \n"; if (SQL_NUMROWS($result_main) > 0) { OUTPUT_HTML(""); @@ -358,7 +358,7 @@ function ADD_MENU ($MODE, $act, $wht) { // Load menu header template LOAD_TEMPLATE($MODE."_menu_title", false, $content); - $result_sub = SQL_QUERY_ESC("SELECT title, what FROM `{!MYSQL_PREFIX!}_%s_menu` WHERE action='%s' AND what != '' AND what IS NOT NULL ".$AND." ORDER BY sort", + $result_sub = SQL_QUERY_ESC("SELECT title, what FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE action='%s' AND `what` != '' AND `what` IS NOT NULL ".$AND." ORDER BY `sort`", array($MODE, $main_action), __FILE__, __LINE__); $ctl = SQL_NUMROWS($result_sub); if ($ctl > 0) { @@ -377,7 +377,7 @@ function ADD_MENU ($MODE, $act, $wht) { } // Navigation link - $content .= ""; + $content .= ""; } else { $content .= ""; } @@ -469,7 +469,7 @@ function IS_ADMIN ($admin="") { $cacheArray['admin_hash'] = $valPass; } elseif ((!empty($admin)) && ((!EXT_IS_ACTIVE("cache"))) || (!isset($cacheArray['admins']['password'][$admin]))) { // Search for admin - $result = SQL_QUERY_ESC("SELECT HIGH_PRIORITY password FROM `{!MYSQL_PREFIX!}_admins` WHERE login='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT HIGH_PRIORITY password FROM `{!_MYSQL_PREFIX!}_admins` WHERE login='%s' LIMIT 1", array($admin), __FILE__, __LINE__); // Is he admin? @@ -508,7 +508,7 @@ function ADD_MAX_RECEIVE_LIST($MODE, $default="", $return=false) { case "guest": // Guests (in the registration form) are not allowed to select 0 mails per day. - $result = SQL_QUERY("SELECT value, comment FROM `{!MYSQL_PREFIX!}_max_receive` WHERE value > 0 ORDER BY value", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT value, comment FROM `{!_MYSQL_PREFIX!}_max_receive` WHERE value > 0 ORDER BY value", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { $OUT = ""; @@ -534,7 +534,7 @@ function ADD_MAX_RECEIVE_LIST($MODE, $default="", $return=false) case "member": // Members are allowed to set to zero mails per day (we will change this soon!) - $result = SQL_QUERY("SELECT value, comment FROM `{!MYSQL_PREFIX!}_max_receive` ORDER BY value", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT value, comment FROM `{!_MYSQL_PREFIX!}_max_receive` ORDER BY value", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { $OUT = ""; @@ -572,7 +572,7 @@ function ADD_MAX_RECEIVE_LIST($MODE, $default="", $return=false) function SEARCH_EMAIL_USERTAB($email) { $ret = false; - $result = SQL_QUERY_ESC("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE email LIKE '{PER}%s{PER}' LIMIT 1", array($email), __FILE__, __LINE__); + $result = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE email LIKE '{PER}%s{PER}' LIMIT 1", array($email), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) $ret = true; SQL_FREERESULT($result); return $ret; @@ -588,7 +588,7 @@ function WHAT_IS_VALID($act, $wht, $type="guest") else { $ret = false; - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_%s_menu` WHERE action='%s' AND what='%s' AND locked='N' LIMIT 1", array($type, $act, $wht), __FILE__, __LINE__); + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE action='%s' AND what='%s' AND `locked`='N' LIMIT 1", array($type, $act, $wht), __FILE__, __LINE__); // Is "what" valid? if (SQL_NUMROWS($result) == 1) $ret = true; SQL_FREERESULT($result); @@ -613,7 +613,7 @@ function IS_MEMBER () { // Are cookies set? if ((!empty($GLOBALS['userid'])) && (isSessionVariableSet('u_hash'))) { // Cookies are set with values, but are they valid? - $result = SQL_QUERY_ESC("SELECT password, status, last_module, last_online FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT password, status, last_module, last_online FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Load data from cookies @@ -663,19 +663,19 @@ function VALIDATE_MENU_ACTION ($MODE, $act, $wht, $UPDATE=false) { $ret = false; $ADD = ""; - if ((!IS_ADMIN()) && ($MODE != "admin")) $ADD = " AND locked='N'"; + if ((!IS_ADMIN()) && ($MODE != "admin")) $ADD = " AND `locked`='N'"; //* DEBUG: */ echo __LINE__.":".$MODE."/".$act."/".$wht."*
    \n"; if (($MODE != "admin") && ($UPDATE)) { // 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), __FILE__, __LINE__, false); } elseif ($wht != "overview") { // Other actions - $SQL = SQL_QUERY_ESC("SELECT id, what FROM `{!MYSQL_PREFIX!}_%s_menu` WHERE action='%s'".$ADD." ORDER BY action DESC LIMIT 1", + $SQL = SQL_QUERY_ESC("SELECT id, what FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE action='%s'".$ADD." ORDER BY action DESC LIMIT 1", array($MODE, $act), __FILE__, __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), __FILE__, __LINE__, false); } @@ -711,7 +711,7 @@ function GET_MOD_DESCR($MODE, $wht, $column="what") $ret = "??? (".$wht.")"; // Look for title - $result = SQL_QUERY_ESC("SELECT title FROM `{!MYSQL_PREFIX!}_%s_menu` WHERE %s='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE %s='%s' LIMIT 1", array($MODE, $column, $wht), __FILE__, __LINE__); // Is there an entry? @@ -729,7 +729,7 @@ function SEND_MODE_MAILS($mod, $modes) { global $DATA; // Load hash - $result_main = SQL_QUERY_ESC("SELECT password FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s AND status='CONFIRMED' LIMIT 1", + $result_main = SQL_QUERY_ESC("SELECT password FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND status='CONFIRMED' LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); if (SQL_NUMROWS($result_main) == 1) { // Load hash from database @@ -742,7 +742,7 @@ function SEND_MODE_MAILS($mod, $modes) { $hash = generatePassString($hashDB); if (($hash == get_session('u_hash')) || ($_POST['pass1'] == $_POST['pass2'])) { // Load user's data - $result = SQL_QUERY_ESC("SELECT gender, surname, family, street_nr, country, zip, city, email FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s AND password='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT gender, surname, family, street_nr, country, zip, city, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND password='%s' LIMIT 1", array($GLOBALS['userid'], $hashDB), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Load the data @@ -851,7 +851,7 @@ function SEND_MODE_MAILS($mod, $modes) { function COUNT_MODULE($mod) { if ($mod != "css") { // Do count all other modules but not accesses on CSS file css.php! - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_mod_reg` SET clicks=clicks+1 WHERE module='%s' LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET clicks=clicks+1 WHERE module='%s' LIMIT 1", array($mod), __FILE__, __LINE__); } // END - if } @@ -895,7 +895,7 @@ function GET_ACTION ($MODE, &$wht) { if (empty($ret)) $ret = "main"; // Load from database - $result = SQL_QUERY_ESC("SELECT action FROM `{!MYSQL_PREFIX!}_%s_menu` WHERE what='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT action FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE what='%s' LIMIT 1", array($MODE, $wht), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Load action value and pray that this one is the right you want... ;-) @@ -924,7 +924,7 @@ function GET_CATEGORY ($cid) { $ret = _CATEGORY_NONE; } elseif ($cid > 0) { // Lookup the category in database - $result = SQL_QUERY_ESC("SELECT cat FROM `{!MYSQL_PREFIX!}_cats` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT cat FROM `{!_MYSQL_PREFIX!}_cats` WHERE id=%s LIMIT 1", array(bigintval($cid)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Category found... :-) @@ -945,7 +945,7 @@ function GET_PAYMENT ($pid, $full=false) { $ret = _PAYMENT_404; // Load payment data - $result = SQL_QUERY_ESC("SELECT mail_title, price FROM `{!MYSQL_PREFIX!}_payments` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT mail_title, price FROM `{!_MYSQL_PREFIX!}_payments` WHERE id=%s LIMIT 1", array(bigintval($pid)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Payment type found... :-) @@ -970,7 +970,7 @@ function GET_PAYMENT ($pid, $full=false) { function GET_PAY_POINTS($pid, $lookFor="price") { $ret = "-1"; - $result = SQL_QUERY_ESC("SELECT %s FROM `{!MYSQL_PREFIX!}_payments` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT %s FROM `{!_MYSQL_PREFIX!}_payments` WHERE id=%s LIMIT 1", array($lookFor, $pid), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { @@ -996,12 +996,12 @@ function REMOVE_RECEIVER (&$ARRAY, $key, $uid, $pool_id, $stats_id="", $bonus=fa // Only when we got a real stats ID continue searching for the entry $type = "NORMAL"; $rowName = "stats_id"; if ($bonus) { $type = "BONUS"; $rowName = "bonus_id"; } - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_user_links` WHERE %s='%s' AND userid=%s AND link_type='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_links` WHERE %s='%s' AND userid=%s AND link_type='%s' LIMIT 1", array($rowName, $stats_id, bigintval($uid), $type), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 0) { // No, so we add one! - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_user_links` (%s, userid, link_type) VALUES ('%s','%s','%s')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_links` (%s, userid, link_type) VALUES ('%s','%s','%s')", array($rowName, $stats_id, bigintval($uid), $type), __FILE__, __LINE__); $ret = "done"; } @@ -1026,12 +1026,12 @@ function GET_TOTAL_DATA ($search, $tableName, $lookFor, $whereStatement="userid" if (($onlyRows) || ($lookFor == "userid")) { // Count rows //* DEBUG: */ echo "COUNT!
    \n"; - $result = SQL_QUERY_ESC("SELECT COUNT(`%s`) FROM `{!MYSQL_PREFIX!}_%s` WHERE `%s`='%s'".$add, + $result = SQL_QUERY_ESC("SELECT COUNT(`%s`) FROM `{!_MYSQL_PREFIX!}_%s` WHERE `%s`='%s'".$add, array($lookFor, $tableName, $whereStatement, $search), __FILE__, __LINE__); } else { // Add all rows //* DEBUG: */ echo "SUM!
    \n"; - $result = SQL_QUERY_ESC("SELECT SUM(`%s`) FROM `{!MYSQL_PREFIX!}_%s` WHERE `%s`='%s'".$add, + $result = SQL_QUERY_ESC("SELECT SUM(`%s`) FROM `{!_MYSQL_PREFIX!}_%s` WHERE `%s`='%s'".$add, array($lookFor, $tableName, $whereStatement, $search), __FILE__, __LINE__); } @@ -1073,7 +1073,7 @@ function GET_REF_LEVEL_PERCENTS ($level) { } } elseif (!EXT_IS_ACTIVE("cache")) { // 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? @@ -1140,7 +1140,7 @@ function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify=false, $rid if ($locked) $data = "locked_points"; // Check user account - $result_user = SQL_QUERY_ESC("SELECT refid, email FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s AND status='CONFIRMED' LIMIT 1", + $result_user = SQL_QUERY_ESC("SELECT refid, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND status='CONFIRMED' LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); //* DEBUG: */ print __FUNCTION__."(".__LINE__."):uid={$uid},numRows=".SQL_NUMROWS($result_user).",points={$points}
    \n"; @@ -1167,14 +1167,14 @@ function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify=false, $rid } // END - if // Update points... - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_points` SET %s=%s+%s WHERE userid=%s AND ref_depth='%s' LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_points` SET %s=%s+%s WHERE userid=%s AND ref_depth='%s' LIMIT 1", array($data, $data, $ref_points, bigintval($uid), bigintval($GLOBALS['ref_level'])), __FILE__, __LINE__); //* DEBUG: */ print __FUNCTION__."(".__LINE__."):data={$data},ref_points={$ref_points},uid={$uid},depth={$GLOBALS['ref_level']},mode={$add_mode} - UPDATE! (".SQL_AFFECTEDROWS().")
    \n"; // No entry updated? if (SQL_AFFECTEDROWS() < 1) { // First ref in this level! :-) - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_user_points` (userid,ref_depth,%s) VALUES (%s,'%s',%s)", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_points` (userid,ref_depth,%s) VALUES (%s,'%s',%s)", array($data, bigintval($uid), bigintval($GLOBALS['ref_level']), $ref_points), __FILE__, __LINE__); //* DEBUG: */ print __FUNCTION__."(".__LINE__."):data={$data},ref_points={$ref_points},uid={$uid},depth={$GLOBALS['ref_level']},mode={$add_mode} - INSERTED! (".SQL_AFFECTEDROWS().")
    \n"; } // END - if @@ -1214,7 +1214,7 @@ function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify=false, $rid // And sent it away SEND_EMAIL($email, SUBJECT_DIRECT_PAYMENT, $msg); - if (!isset($_GET['mid'])) LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_POINTS_ADDED); + if (!isset($_GET['mid'])) LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_POINTS_ADDED')); } // Maybe there's another ref? @@ -1239,20 +1239,20 @@ function UPDATE_REF_COUNTER ($uid) { //* DEBUG: */ print __FUNCTION__."(".__LINE__."):uid={$uid},level={$cacheArray['ref_level'][$uid]}
    \n"; // Update counter - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_refsystem` SET counter=counter+1 WHERE userid=%s AND level='%s' LIMIT 1", + 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 //* DEBUG: */ print __FUNCTION__."(".__LINE__."):updated=".SQL_AFFECTEDROWS()."
    \n"; if (SQL_AFFECTEDROWS() < 1) { // First count! - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_refsystem` (userid, level, counter) VALUES (%s,%s,1)", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_refsystem` (userid, level, counter) VALUES (%s,%s,1)", array(bigintval($uid), $cacheArray['ref_level'][$uid]), __FILE__, __LINE__); //* DEBUG: */ print __FUNCTION__."(".__LINE__."):uid={$uid}
    \n"; } // END - if // Check for his referal - $result = SQL_QUERY_ESC("SELECT refid FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT refid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); // Load refid @@ -1285,7 +1285,7 @@ function UPDATE_REF_COUNTER ($uid) { // OBSOLETE: Sends out mail to all administrators function SEND_ADMIN_EMAILS ($subj, $msg) { // Load all admin email addresses - $result = SQL_QUERY("SELECT email FROM `{!MYSQL_PREFIX!}_admins` ORDER BY id ASC", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT email FROM `{!_MYSQL_PREFIX!}_admins` ORDER BY `id` ASC", __FILE__, __LINE__); while (list($email) = SQL_FETCHROW($result)) { // Send the email out SEND_EMAIL($email, $subj, $msg); @@ -1309,7 +1309,7 @@ function GET_ADMIN_ID ($login) { incrementConfigEntry('cache_hits'); } elseif (!EXT_IS_ACTIVE("cache")) { // Load from database - $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_admins` WHERE login='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admins` WHERE login='%s' LIMIT 1", array($login), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { list($ret) = SQL_FETCHROW($result); @@ -1346,7 +1346,7 @@ function GET_ADMIN_HASH ($aid) incrementConfigEntry('cache_hits'); } elseif (!EXT_IS_ACTIVE("cache")) { // Load from database - $result = SQL_QUERY_ESC("SELECT password FROM `{!MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT password FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", array($aid), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Fetch data @@ -1373,7 +1373,7 @@ function GET_ADMIN_LOGIN ($aid) { incrementConfigEntry('cache_hits'); } elseif (!EXT_IS_ACTIVE("cache")) { // Load from database - $result = SQL_QUERY_ESC("SELECT login FROM `{!MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", + $result = SQL_QUERY_ESC("SELECT login FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", array(bigintval($aid)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Fetch data @@ -1401,7 +1401,7 @@ function GET_ADMIN_EMAIL ($aid) { incrementConfigEntry('cache_hits'); } elseif (!EXT_IS_ACTIVE("cache")) { // Load from database - $result_aid = SQL_QUERY_ESC("SELECT email FROM `{!MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", + $result_aid = SQL_QUERY_ESC("SELECT email FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", array(bigintval($aid)), __FILE__, __LINE__); if (SQL_NUMROWS($result_aid) == 1) { // Get data @@ -1431,7 +1431,7 @@ function GET_ADMIN_DEFAULT_ACL ($aid) { incrementConfigEntry('cache_hits'); } elseif (!EXT_IS_ACTIVE("cache")) { // Load from database - $result_aid = SQL_QUERY_ESC("SELECT default_acl FROM `{!MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", + $result_aid = SQL_QUERY_ESC("SELECT default_acl FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1", array(bigintval($aid)), __FILE__, __LINE__); if (SQL_NUMROWS($result_aid) == 1) { // Fetch data @@ -1498,9 +1498,9 @@ function activateExchange() { if ($totalUsers >= getConfig('activate_xchange')) { // Activate System $SQLs = array( - "UPDATE `{!MYSQL_PREFIX!}_mod_reg` SET locked='N', hidden='N', mem_only='Y' WHERE module='order' LIMIT 1", - "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='Y', locked='N' WHERE what='order' OR what='unconfirmed' LIMIT 2", - "UPDATE `{!MYSQL_PREFIX!}_config` SET activate_xchange='0' WHERE config=0 LIMIT 1" + "UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='N', hidden='N', mem_only='Y' WHERE module='order' LIMIT 1", + "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='order' OR what='unconfirmed' LIMIT 2", + "UPDATE `{!_MYSQL_PREFIX!}_config` SET activate_xchange='0' WHERE config=0 LIMIT 1" ); // Run SQLs @@ -1515,8 +1515,8 @@ function DELETE_USER_ACCOUNT($uid, $reason) { $points = 0; $result = SQL_QUERY_ESC("SELECT (SUM(p.points) - d.used_points) AS points -FROM `{!MYSQL_PREFIX!}_user_points` AS p -LEFT JOIN `{!MYSQL_PREFIX!}_user_data` AS d +FROM `{!_MYSQL_PREFIX!}_user_points` AS p +LEFT JOIN `{!_MYSQL_PREFIX!}_user_data` AS d ON p.userid=d.userid WHERE p.userid=%s", array(bigintval($uid)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { @@ -1525,7 +1525,7 @@ WHERE p.userid=%s", array(bigintval($uid)), __FILE__, __LINE__); SQL_FREERESULT($result); // Delete points entries as well - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_user_points` WHERE userid=%s", array(bigintval($uid)), __FILE__, __LINE__); + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_points` WHERE userid=%s", array(bigintval($uid)), __FILE__, __LINE__); // Update mediadata as well if (GET_EXT_VERSION("mediadata") >= "0.0.4") { @@ -1538,21 +1538,21 @@ WHERE p.userid=%s", array(bigintval($uid)), __FILE__, __LINE__); } // Delete category selections as well... - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_user_cats` WHERE userid=%s", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE userid=%s", array(bigintval($uid)), __FILE__, __LINE__); // Remove from rallye if found if (EXT_IS_ACTIVE("rallye")) { - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_rallye_users` WHERE userid=%s", + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE userid=%s", array(bigintval($uid)), __FILE__, __LINE__); } // Now a mail to the user and that's all... $msg = LOAD_EMAIL_TEMPLATE("del-user", array('text' => $reason), $uid); - SEND_EMAIL($uid, ADMIN_DEL_ACCOUNT, $msg); + SEND_EMAIL($uid, getMessage('ADMIN_DEL_ACCOUNT'), $msg); // Ok, delete the account! - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); } // @@ -1571,16 +1571,16 @@ function META_DESCRIPTION ($mod, $wht) { } // function ADD_JACKPOT($points) { - $result = SQL_QUERY("SELECT points FROM `{!MYSQL_PREFIX!}_jackpot` WHERE ok='ok' LIMIT 1", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT points FROM `{!_MYSQL_PREFIX!}_jackpot` WHERE ok='ok' LIMIT 1", __FILE__, __LINE__); if (SQL_NUMROWS($result) == 0) { // Create line - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_jackpot` (ok, points) VALUES ('ok','%s')", array($points), __FILE__, __LINE__); + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_jackpot` (ok, points) VALUES ('ok','%s')", array($points), __FILE__, __LINE__); } else { // Free memory SQL_FREERESULT($result); // Update points - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_jackpot` SET points=points+%s WHERE ok='ok' LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_jackpot` SET points=points+%s WHERE ok='ok' LIMIT 1", array($points), __FILE__, __LINE__); } } @@ -1590,16 +1590,16 @@ function SUB_JACKPOT($points) { $ret = "-1"; // Get current points - $result = SQL_QUERY("SELECT points FROM `{!MYSQL_PREFIX!}_jackpot` WHERE ok='ok' LIMIT 1", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT points FROM `{!_MYSQL_PREFIX!}_jackpot` WHERE ok='ok' LIMIT 1", __FILE__, __LINE__); if (SQL_NUMROWS($result) == 0) { // Create line - SQL_QUERY("INSERT INTO `{!MYSQL_PREFIX!}_jackpot` (ok, points) VALUES ('ok', 0.00000)", __FILE__, __LINE__); + SQL_QUERY("INSERT INTO `{!_MYSQL_PREFIX!}_jackpot` (ok, points) VALUES ('ok', 0.00000)", __FILE__, __LINE__); } else { // Read points list($jackpot) = SQL_FETCHROW($result); if ($jackpot >= $points) { // Update points when there are enougth points in jackpot - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_jackpot` SET points=points-%s WHERE ok='ok' LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_jackpot` SET points=points-%s WHERE ok='ok' LIMIT 1", array($points), __FILE__, __LINE__); $ret = $jackpot - $points; } // END - if @@ -1631,7 +1631,7 @@ function LOAD_CONFIG ($no="0") { } // END - if } elseif ((!EXT_IS_ACTIVE("cache")) || (!isset($cacheArray['config'][$no]))) { // Load config from DB - $result_config = SQL_QUERY_ESC("SELECT * FROM `{!MYSQL_PREFIX!}_config` WHERE config=%d LIMIT 1", + $result_config = SQL_QUERY_ESC("SELECT * FROM `{!_MYSQL_PREFIX!}_config` WHERE config=%d LIMIT 1", array(bigintval($no)), __FILE__, __LINE__); // Get config from database @@ -1675,7 +1675,7 @@ function GET_WHAT($modCheck) { // Subtract points from database and mediadata cache function SUB_POINTS ($subject, $uid, $points) { // Add points to used points - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET `used_points`=`used_points`+%s WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `used_points`=`used_points`+%s WHERE userid=%s LIMIT 1", array($points, bigintval($uid)), __FILE__, __LINE__); // Insert booking record @@ -1736,7 +1736,7 @@ function UPDATE_CONFIG ($entries, $values, $updateMode="") { // Run database update //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "entries={$entries}"); - SQL_QUERY("UPDATE `{!MYSQL_PREFIX!}_config` SET ".$entries." WHERE config=0 LIMIT 1", __FILE__, __LINE__); + SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_config` SET ".$entries." WHERE config=0 LIMIT 1", __FILE__, __LINE__); // Get affected rows $affectedRows = SQL_AFFECTEDROWS(); @@ -1766,8 +1766,8 @@ function PREPARE_SQL_HTML_HOLIDAY ($mode) { function GET_TOTAL_RECEIVERS ($mode="normal") { // Query database $result_all = SQL_QUERY("SELECT userid -FROM `{!MYSQL_PREFIX!}_user_data` -WHERE status='CONFIRMED' AND receive_mails > 0".PREPARE_SQL_HTML_HOLIDAY($mode), +FROM `{!_MYSQL_PREFIX!}_user_data` +WHERE status='CONFIRMED' AND receive_mails > 0 ".PREPARE_SQL_HTML_HOLIDAY($mode), __FILE__, __LINE__); // Get num rows @@ -1783,7 +1783,7 @@ WHERE status='CONFIRMED' AND receive_mails > 0".PREPARE_SQL_HTML_HOLIDAY($mode), // Returns HTML code with an "