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
}
} 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__);
}
// 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?
// 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?
$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
// 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__);
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
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']));
// 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?
// 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__);
}
$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__);
}
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
// 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'))
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'));
}
}
// 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;
}
// 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
$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
// 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
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
// 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__);
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.", ";
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
// 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",
// 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__);
// 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__);
// 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__);
// 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__);
// 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();
// 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__);
// 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
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
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
} // 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;
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
}
} 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__);
}
// 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
} 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?
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?
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
$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
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);
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);
// 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?
// 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?
// 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
}
// 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,
// 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,
}
} 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?
$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?
$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?
{
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";
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);
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
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 (<strong>Heute Online</strong> 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 (<strong>Heute Online</strong> im Gastbereich) vornehmen.', 8)";
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Aktiven-Liste im Gastbereich ist nun einschränkbar.";
{
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);
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.";
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 '',
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.";
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 <strong>admins</strong> und (kommender) <strong>contact</strong>.";
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.";
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 <strong>admins</strong> und (kommender) <strong>contact</strong>.";
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 <strong>admins</strong> und (kommender) <strong>contact</strong>. Beseitigung eines Fehlers <strong>HTTP_POSR_VARS</strong> beim Ändern von Administratoren.";
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.";
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.";
{
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
{
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
{
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
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.";
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).<br /><br /><u>Bitte aktualisieren Sie auch die Admin-Templates!</u>";
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.<br /><br /><u>Bitte aktualisieren Sie auch die Admin-Templates!</u>";
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.";
{
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,
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,
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,
// 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,
) 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
{
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',
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
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!})";
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 <u>admin_config_beg.tpl</u> (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.";
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.";
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!";
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 <strong>Einstellungen --> Bettel-Link/-rallye</strong> seperat ein- und ausschalten! Zudem ist eine Sperre gegen eingeloggte Mitglieder eingebaut, die das Klicken auf den eigenen Bettel-Link etwas erschweren soll.";
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.";
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.";
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.";
// 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")) {
{
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
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,
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.";
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.";
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";
{
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 '',
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
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 <a href=\"{!URL!}/modules.php?module=admin&what=updates\">Updates prüfen</a> 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,
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.";
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 <u>{!MYSQL_PREFIX!}_bonus_urls</u> und <u>{!MYSQL_PREFIX!}_bonus_customer</u> entfernt, da dies bald von der Erweiterung <u>paidlinks</u> erledigt wird.";
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";
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 <u>Aktiv-Rallye-Teilnehmer</u> 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.";
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.";
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.<br />Template <u>admin_config_bonus_pro.tpl</u> ist überflüssig geworden. Bitte löschen Sie dies!<br />Eingestellte Bonus-{!POINTS!} für Rank 2 war um eins verschoben.";
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.";
$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";
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.";
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).";
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.";
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.";
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.";
{
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',
) 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
{
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);
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.";
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.";
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.";
{
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',
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
{
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',
) 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',
) 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 '',
) 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,
) 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 <strong>inc/cache/</strong> 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 <em>debug.log</em> 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 <strong>inc/cache/</strong> 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 <em>debug.log</em> 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
{
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,
// --- 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
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.";
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.";
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.<br />Template <u>admin_config_doubler_pro.tpl</u> ist überflüssig geworden. Bitte löschen Sie dies!";
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.";
{
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,
) 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
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 <strong>Urlaub</strong> 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.";
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";
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.";
{
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
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'),
{
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
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
{
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
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
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)
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)<br />
break;
case "0.0.9": // SQL queries for v0.0.9
- $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','mediadata','Mediendaten',3,'Y','N')";
+ $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','mediadata','Mediendaten',3,'Y','N')";
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Menüpunkt wird durch diese Erweiterung generiert.";
{
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 ('mods', NULL, 'Modul-Management','Verwalten Sie die Basis-Module index, login, admin usw.', 4)";
- $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('mods','config_mods','Module ändern','Ändern Sie hier die Zugtiffsrechte auf die Module. Was dennoch nicht geht: Mitglied- oder Gastzugriffsrtechte auf Admin-Module bzw. Gastzugriffsrechte auf Mitglieder-Module. Diese sind extra abgesichert.', 1)";
- $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('mods','stats_mods','Modul-Statistiken','Sehen Sie sich hier die Statistiken der Module und die damit verknüpften action- und what-Dateien an. Bei einigen Modulen gibt es allerdings keine verknüpften Dateien und somit keine Extra-Statistik.', 2)";
+ $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('mods', NULL, 'Modul-Management','Verwalten Sie die Basis-Module index, login, admin usw.', 4)";
+ $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('mods','config_mods','Module ändern','Ändern Sie hier die Zugtiffsrechte auf die Module. Was dennoch nicht geht: Mitglied- oder Gastzugriffsrtechte auf Admin-Module bzw. Gastzugriffsrechte auf Mitglieder-Module. Diese sind extra abgesichert.', 1)";
+ $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('mods','stats_mods','Modul-Statistiken','Sehen Sie sich hier die Statistiken der Module und die damit verknüpften action- und what-Dateien an. Bei einigen Modulen gibt es allerdings keine verknüpften Dateien und somit keine Extra-Statistik.', 2)";
break;
case "remove": // Do stuff when removing extension
// SQL commands to run
- $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE action='mods' LIMIT 3";
+ $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='mods' LIMIT 3";
break;
case "activate": // Do stuff when admin activates this extension
break;
case "0.0.8": // SQL queries for v0.0.8
- $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET title = 'Modul-Management' WHERE action = 'mods' AND (what='' OR what IS NULL) LIMIT 1";
+ $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET title = 'Modul-Management' WHERE action = 'mods' AND (what='' OR `what` IS NULL) LIMIT 1";
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Verwaltung auf Management umgestellt.";
case "remove": // Do stuff when removing extension
// SQL commands to run
- $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE action='newsletter' AND what != 'send_newsletter' LIMIT 3";
- $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_member_menu` WHERE what='newsletter' LIMIT 1";
+ $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='newsletter' AND what != 'send_newsletter' LIMIT 3";
+ $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='newsletter' LIMIT 1";
break;
case "activate": // Do stuff when admin activates this extension
// SQL commands to run
- $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET locked='N', visible='Y' WHERE what='newsletter' LIMIT 1";
+ $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `locked`='N', `visible`='Y' WHERE what='newsletter' LIMIT 1";
break;
case "deactivate": // Do stuff when admin deactivates this extension
// SQL commands to run
- $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET locked='Y', visible='N' WHERE what='newsletter' LIMIT 1";
+ $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `locked`='Y', `visible`='N' WHERE what='newsletter' LIMIT 1";
break;
case "update": // Update an extension
switch ($EXT_VER)
{
case "0.0.1": // SQL queries for v0.0.1
- $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('newsletter', NULL, 'Newsletter','Einstellungen am Newsletter, Newsletter versenden, Abbestellungen auflisten usw.', 3)";
- $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('newsletter','list_newsletter','Abbestellungen','Alle Abbestellungen auflisten und bearbeiten.', 2)";
- $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('newsletter','config_newsletter','Einstellungen','Gebühr zum Abbestellen des Newsletters usw. sind hier einstellbar.', 3)";
- $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET action='newsletter', what='send_newsletter', title='Versenden', sort='1' WHERE what='newsletter' LIMIT 1";
- $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','newsletter','Newsletter-Empfang','N','Y', 10)";
- $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD nl_charge FLOAT(10,2) UNSIGNED NOT NULL DEFAULT '5.00'";
- $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD nl_receive ENUM('Y','N') NOT NULL DEFAULT 'Y'";
- $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD nl_until VARCHAR(10) NOT NULL DEFAULT 0";
- $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD nl_timespan VARCHAR(10) NOT NULL DEFAULT 0";
+ $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('newsletter', NULL, 'Newsletter','Einstellungen am Newsletter, Newsletter versenden, Abbestellungen auflisten usw.', 3)";
+ $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('newsletter','list_newsletter','Abbestellungen','Alle Abbestellungen auflisten und bearbeiten.', 2)";
+ $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('newsletter','config_newsletter','Einstellungen','Gebühr zum Abbestellen des Newsletters usw. sind hier einstellbar.', 3)";
+ $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET action='newsletter', what='send_newsletter', title='Versenden', sort='1' WHERE what='newsletter' LIMIT 1";
+ $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','newsletter','Newsletter-Empfang','N','Y', 10)";
+ $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD nl_charge FLOAT(10,2) UNSIGNED NOT NULL DEFAULT '5.00'";
+ $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD nl_receive ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+ $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD nl_until VARCHAR(10) NOT NULL DEFAULT 0";
+ $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD nl_timespan VARCHAR(10) NOT NULL DEFAULT 0";
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Vor der eigentlichen Freigabe dieser Erweiterungen habe ich sie versehendlich im Archiv mit auf den Server hochgeladen. Diese Version fügt die bereits angekündigte Funktionalitäten, wie zum Beispiel das Einstellen der Abschaltgebühr.";
{
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 nickname VARCHAR(255) NOT NULL DEFAULT ''";
- $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD nick_uid ENUM ('nick','uid') NOT NULL DEFAULT 'uid'";
- $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','nickname','Nicknamen','5','Y','Y')";
+ $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD nickname VARCHAR(255) NOT NULL DEFAULT ''";
+ $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD nick_uid ENUM ('nick','uid') NOT NULL DEFAULT 'uid'";
+ $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','nickname','Nicknamen','5','Y','Y')";
// Load CSS file?
$EXT_CSS = "Y";
case "remove": // Do stuff when removing extension
// SQL commands to run
- $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_member_menu` WHERE what='nickname' LIMIT 1";
- $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE what IN ('config_nickname','list_nickname') LIMIT 2";
- $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_nickname_history`";
+ $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='nickname' LIMIT 1";
+ $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN ('config_nickname','list_nickname') LIMIT 2";
+ $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_nickname_history`";
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='nickname' LIMIT 1";
+ $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='nickname' 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='nickname' LIMIT 1";
+ $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='nickname' LIMIT 1";
break;
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='nickname' AND ext_has_css='N' LIMIT 1";
+ $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_has_css='Y' WHERE ext_name='nickname' AND ext_has_css='N' LIMIT 1";
// This update depends on sql_patches update!
$EXT_UPDATE_DEPENDS = "sql_patches";
break;
case "0.0.6": // SQL queries for v0.0.6
- $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD nickname_len TINYINT(3) UNSIGNED NOT NULL DEFAULT '5'";
- $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD nickname_pattern VARCHAR(255) NOT NULL DEFAULT 'a-zA-Z0-9_'";
- $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD nickname_chars VARCHAR(255) NOT NULL DEFAULT 'a-z, A-Z, 0-9, _'";
- $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_nickname','Nicknamen','Stellen Sie minimale Nicknamenlänge, sowie erlaubte Zeichen hier ein.', 12)";
+ $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD nickname_len TINYINT(3) UNSIGNED NOT NULL DEFAULT '5'";
+ $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD nickname_pattern VARCHAR(255) NOT NULL DEFAULT 'a-zA-Z0-9_'";
+ $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD nickname_chars VARCHAR(255) NOT NULL DEFAULT 'a-z, A-Z, 0-9, _'";
+ $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_nickname','Nicknamen','Stellen Sie minimale Nicknamenlänge, sowie erlaubte Zeichen hier ein.', 12)";
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Minimale Länge, sowie erlaubte Zeichen sind per Adminbereich änderbar. Setzen Sie als erlaubte Zeichen nur URL-konforme Zeichen ein!";
break;
case "0.1.1": // SQL queries for v0.1.1
- $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` DROP nick_uid";
+ $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP nick_uid";
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Auswahlfür Mitglied ob mit Nickname oder User-ID einloggen entfernt.";
break;
case "0.1.6": // SQL queries for v0.1.6
- $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET action='extras', sort='2' WHERE what='nickname' LIMIT 1";
+ $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='extras', sort='2' WHERE what='nickname' LIMIT 1";
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Mitgliedsmenü komplett umgebaut.";
break;
case "0.1.9": // SQL queries for v0.1.9
- $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_nickname','Nickname-Historie','Listet alle verwendeten Nicknames der Mitglieder auf.', 12)";
- $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_nickname_history`";
- $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_nickname_history` (
+ $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_nickname','Nickname-Historie','Listet alle verwendeten Nicknames der Mitglieder auf.', 12)";
+ $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_nickname_history`";
+ $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_nickname_history` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
nickname VARCHAR(255) NOT NULL DEFAULT '',
{
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!}_online`";
- $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_online` (
+ $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_online`";
+ $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_online` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
sid VARCHAR(32) NOT NULL DEFAULT '',
ip VARCHAR(15) NOT NULL DEFAULT '',
KEY(userid),
KEY(refid)
) TYPE=MyISAM";
- $SQLs[]="INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('misc','usr_online','Online-Statistik','Eine Liste von derzeit "Online" Usern. Doppelte Einträge könnte auf mangelnden Cookie-Support des Browsers oder auf einen Spider hindeuten.', 1)";
+ $SQLs[]="INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('misc','usr_online','Online-Statistik','Eine Liste von derzeit "Online" Usern. Doppelte Einträge könnte auf mangelnden Cookie-Support des Browsers oder auf einen Spider hindeuten.', 1)";
break;
case "remove": // Do stuff when removing extension
// SQL commands to run
- $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_online`";
- $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE what='usr_online' LIMIT 1";
- $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE action='online' LIMIT 1";
+ $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_online`";
+ $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='usr_online' LIMIT 1";
+ $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE action='online' LIMIT 1";
// Unregister filter
UNREGISTER_FILTER('init', 'UPDATE_ONLINE_LIST', true, $dry_run);
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='online' LIMIT 1";
+ $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y', `locked`='N' WHERE action='online' 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 action='online' LIMIT 1";
+ $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE action='online' LIMIT 1";
break;
case "update": // Update an extension
case "0.0.4": // SQL queries for v0.0.4
// Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Erstellung der Datenbanktabelle `{!MYSQL_PREFIX!}_online` in diese Erweiterung ausgelagert.";
+ $UPDATE_NOTES = "Erstellung der Datenbanktabelle `{!_MYSQL_PREFIX!}_online` in diese Erweiterung ausgelagert.";
break;
case "0.0.5": // SQL queries for v0.0.5
- $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('online',NULL,'Jetzt Online','2','Y','N')";
+ $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('online',NULL,'Jetzt Online','2','Y','N')";
// Register filter
REGISTER_FILTER('init', 'UPDATE_ONLINE_LIST', false, true, $dry_run);
{
case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called)
// SQL commands to run
- $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_optimize_gain`(
+ $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_optimize_gain`(
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
gain decimal(10,3) NOT NULL DEFAULT '0.000',
PRIMARY KEY(id)
) TYPE=MyISAM";
- $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('misc','optimize','DB optimieren','Führen Sie dies ab und an aus, damit überflüssige Daten aus der Datenbank entfernt werden.','5')";
+ $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('misc','optimize','DB optimieren','Führen Sie dies ab und an aus, damit überflüssige Daten aus der Datenbank entfernt werden.','5')";
break;
case "remove": // Do stuff when removing extension
// SQL commands to run
- $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_optimize_gain`";
- $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE what='optimize' LIMIT 1";
+ $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_optimize_gain`";
+ $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='optimize' LIMIT 1";
break;
case "activate": // Do stuff when admin activates this extension
case "remove": // Do stuff when removing extension
// SQL commands to run
- $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE what='config_order' LIMIT 1";
+ $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_order' 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='order' LIMIT 1";
- $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_mod_reg` SET locked='N', hidden='N', admin_only='N', mem_only='Y' WHERE module='order' LIMIT 1";
+ $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='order' LIMIT 1";
+ $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='N', hidden='N', admin_only='N', mem_only='Y' WHERE module='order' 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='order' LIMIT 1";
- $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_mod_reg` SET visible='N', locked='Y' WHERE module='order' LIMIT 1";
+ $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='order' LIMIT 1";
+ $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `visible`='N', `locked`='Y' WHERE module='order' LIMIT 1";
break;
case "update": // Update an extension
switch ($EXT_VER)
{
case "0.1": // SQL queries for v0.1
- $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD order_max_full ENUM('ORDER','MAX') NOT NULL DEFAULT 'MAX'";
- $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('setup','config_order','Mailbuchungsseite','7','Einstellungen am Mailbuchungsformular.')";
+ $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD order_max_full ENUM('ORDER','MAX') NOT NULL DEFAULT 'MAX'";
+ $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('setup','config_order','Mailbuchungsseite','7','Einstellungen am Mailbuchungsformular.')";
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Maximale Mailbuchungen sind nun vom maximalen Empfang abhägig.";
break;
case "0.1.1": // SQL queries for v0.1.1
- $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE what='config_order' LIMIT 1";
- $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('setup','config_order','Mailbuchungsseite','7','Einstellungen am Mailbuchungsformular.')";
- $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_user_data` ADD mail_orders BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
+ $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_order' LIMIT 1";
+ $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('setup','config_order','Mailbuchungsseite','7','Einstellungen am Mailbuchungsformular.')";
+ $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD mail_orders BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Maximale Mailbuchung vervollständigt (Admin-Bereich und im Buchungsformular selber).";
break;
case "0.2.3": // SQL queries for v0.2.3
- $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD order_min BIGINT(20) UNSIGNED NOT NULL DEFAULT 10";
+ $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD order_min BIGINT(20) UNSIGNED NOT NULL DEFAULT 10";
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Minimum an Empfänger pro Mailbuchung einstellbar. Standart: 10 Empfänger";
break;
case "0.3.1": // SQL queries for v0.3.1
- $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD order_select VARCHAR(255) NOT NULL DEFAULT 'userid'";
- $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD order_mode ENUM('ASC','DESC') NOT NULL DEFAULT 'DESC'";
+ $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD order_select VARCHAR(255) NOT NULL DEFAULT 'userid'";
+ $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD order_mode ENUM('ASC','DESC') NOT NULL DEFAULT 'DESC'";
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Beworbene URL wird nun getestet.";
break;
case "0.4.6": // SQL queries for v0.4.6
- $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('order',NULL,'Mailbuchungen',3,'Y','N')";
- $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('order','order2','Framekiller-Mails',2,'Y','N')";
- $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_member_menu` SET action='order', sort='1', title='Klick-Mails' WHERE what='order' LIMIT 1";
+ $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('order',NULL,'Mailbuchungen',3,'Y','N')";
+ $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('order','order2','Framekiller-Mails',2,'Y','N')";
+ $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='order', sort='1', title='Klick-Mails' WHERE what='order' LIMIT 1";
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Mitgliedsmenü komplett umgebaut.";
break;
case "0.4.8": // SQL queries for v0.4.8
- $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET title='Mailbuchung' WHERE what='config_order' LIMIT 1";
+ $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET title='Mailbuchung' WHERE what='config_order' LIMIT 1";
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Menüpunkt "Mailbuchungsseite" nach "Mailbuchung" umbenannt und weitere Einstellungen aus Sonstige Einstellungen verschoben.";
break;
case "0.4.9": // SQL queries for v0.4.9
- $SQLs[] = "ALTER TABLE `{!MYSQL_PREFIX!}_config` ADD repay_deleted_mails ENUM('REPAY','JACKPOT','SHRED') NOT NULL DEFAULT 'REPAY'";
+ $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD repay_deleted_mails ENUM('REPAY','JACKPOT','SHRED') NOT NULL DEFAULT 'REPAY'";
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Bei Löschung von Mailbuchungen kann nun global entschieden werden (Einstellungen also), ob die verbliebenen {!POINTS!} wieder gutgeschrieben werden sollen oder in den Jackpot landen.";
break;
case "0.5.0": // SQL queries for v0.5.0
- $SQLs[] = "DROP TABLE IF EXISTS `{!MYSQL_PREFIX!}_url_blacklist`";
- $SQLs[] = "CREATE TABLE `{!MYSQL_PREFIX!}_url_blacklist` (
+ $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_url_blacklist`";
+ $SQLs[] = "CREATE TABLE `{!_MYSQL_PREFIX!}_url_blacklist` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`url` VARCHAR(255) NOT NULL DEFAULT '',
`pool_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
// Do daily reset only when installed and extension version is at least 0.1.1
if ((isBooleanConstantAndTrue('__DAILY_RESET')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (GET_EXT_VERSION("order") >= "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;
}
{
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
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.";
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.";
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.";
{
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',
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
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.";
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.";
{
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 '',
) 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
{
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 '',
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,
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,
) 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);
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.";
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.";
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 <strong>templates/de/emails/member/member_rallye_notify.tpl</strong> folgende zwei Zeilen ein:<br />
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.";
// 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) {
// 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"))) {
{
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,
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.";
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
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',
) 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 <strong>Profildaten ändern</strong> 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 <strong>Profildaten ändern</strong> 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";
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 <strong>templates/".GET_LANGUAGE()."/html/guest/guest_register.tpl</strong> ist nicht mehr nötig.";
{
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);
{
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
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.";
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
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.";
// 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;
//
// 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 '',
//
// 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,
//
// 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,
//
// 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,
//
// 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,
//
// 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',
//
// 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://',
//
// 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://',
//
// 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,
//
// 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,
//
// 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',
//
// 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 '',
//
// 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";
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
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
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
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 <strong>{!MYSQL_PREFIX!}_config</strong> musste die Spalte <strong>auto_purge</strong> (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 <strong>EMail-Details ansehen</strong> und <strong>EMail-Archiv</strong> 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 ' <strong><big>·</big></strong> '";
+ $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD menu_blur_spacer VARCHAR(255) NOT NULL DEFAULT ' <strong><big>·</big></strong> '";
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Nette Mouse-Hover-Effekte eingebaut (Anleitung <strong>MENUE_HOVER.txt</strong> 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 <a href=\"{!URL!}/modules.php?module=admin&`what`=config_home\">hier</a> die Verzögerungszeit in der <a href=\"{!URL!}/index.php\">Eingangsseite</a> 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?";
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 <u>ext_has_admin</u> aus der Tabelle <u>{!MYSQL_PREFIX!}_extensions</u> 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 <strong>what</strong>-Dateien kann hinzugefügt werden.";
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.";
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.";
// 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 <u>imagecreatefromjpeg()</u> 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 <u>max_mails</u> und <u>receive_mails</u> 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 = "<ol>
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 <strong>Mailtausch</strong>, <strong>Mailtausches</strong> und <strong>Mailtauscher</strong> 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.";
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 '',
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 '',
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.";
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',
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!)";
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.";
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";
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',
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 <strong>ausschliesslich</strong> 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.";
{
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 '',
) 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,
) 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,
) 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,
) 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,
) 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. <strong>Vorsicht!</strong> 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. <strong>Vorsicht!</strong> 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";
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
{
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";
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
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";
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
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 '',
) 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 <u>sql_patches</u> übertragen. (Kann Fehlermeldungen verursacht haben!)";
{
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";
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
{
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,
) 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,
) 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
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 <em>Auflisten</em> 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!";
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";
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.";
{
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
{
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";
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
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";
$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.";
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. <big>Diese Anzeige kann fehlerhaft sein, wenn Sie bereits Mitglieder in Ihrem {!MT_WORD!} haben sollen!</big>";
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.";
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.";
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";
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 '',
{
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 '',
) 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.";
{
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. <strong>Vorsicht:</strong> 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. <strong>Vorsicht:</strong> 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,
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
// 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?
$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) {
// 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
$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?
} // 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!
// @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?
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__."(<font color=\"#0000aa\">".__LINE__."</font>):numRows=".SQL_NUMROWS($result_email)."<br />\n";
// Does the user exist?
list($TO) = SQL_FETCHROW($result_email);
} else {
// Set webmaster
- $TO = WEBMASTER;
+ $TO = constant('WEBMASTER');
}
// Free result
}
} elseif ("$TO" == "0") {
// Is the webmaster!
- $TO = WEBMASTER;
+ $TO = constant('WEBMASTER');
}
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):TO={$TO}<br />\n";
$mail->Username = SMTP_USER;
$mail->Password = SMTP_PASSWORD;
if (empty($from)) {
- $mail->From = WEBMASTER;
+ $mail->From = constant('WEBMASTER');
} else {
$mail->From = $from;
}
}
//
function IMG_CODE ($code, $type, $DATA, $uid) {
- return "<IMG border=\"0\" alt=\"Code\" src=\"".URL."/mailid_top.php?uid=".$uid."&".$type."=".$DATA."&mode=img&code=".$code."\">";
+ return "<IMG border=\"0\" alt=\"Code\" src=\"{!URL!}/mailid_top.php?uid=".$uid."&".$type."=".$DATA."&mode=img&code=".$code."\">";
}
//
function TRANSLATE_STATUS($status) {
$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();
} // END - if
// Neutral email address is default
- $email = WEBMASTER;
+ $email = constant('WEBMASTER');
// Expiration in a nice output format
if (getConfig('auto_purge') == 0) {
if (EXT_IS_ACTIVE("nickname")) {
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):NICKNAME!<br />\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__."(<font color=\"#0000aa\">".__LINE__."</font>):NO-NICK!<br />\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__);
}
return;
} elseif (!$header) {
// Return in an HTML code code
- return "<IMG src=\"".URL."/img.php?code=".$img_code."\">\n";
+ return "<IMG src=\"{!URL!}/img.php?code=".$img_code."\">\n";
}
// Load image
} // 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;
}
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__);
}
}
$NAV .= "<strong>-";
} else {
// Open anchor tag and add base URL
- $NAV .= "<a href=\"".URL."/modules.php?module=admin&what=".$GLOBALS['what']."&page=".$page."&offset=".$offset;
+ $NAV .= "<a href=\"{!URL!}/modules.php?module=admin&what=".$GLOBALS['what']."&page=".$page."&offset=".$offset;
// Add userid when we shall show all mails from a single member
if ((isset($_GET['u_id'])) && (bigintval($_GET['u_id']) > 0)) $NAV .= "&u_id=".bigintval($_GET['u_id']);
);
// 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!");
$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 {
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?
// 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;
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;
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);
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");
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__);
$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
$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
//* DEBUG: */ die("Secret-Key: ".$secretKey."<br />Cookie: ".get_session('u_hash')."<br />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
));
// 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
LOAD_TEMPLATE("header");
// Include stylesheet
- include (PATH."inc/stylesheet.php");
+ require_once(PATH."inc/stylesheet.php");
} // END - if
// Closing HEAD tag
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'];
define('ENTRY_404_1', "Eintrag <em>");
define('ENTRY_404_2', "</em> 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 <strong>");
define('DEL_MENU_2', "</strong> Menüeintrag/-einträge gelöscht werden:");
define('ENTRY_404_1', "Entry <em>");
define('ENTRY_404_2', "</em> 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', "<strong>");
define('DEL_MENU_2', "</strong> menu entr(y/ies) shall be deleted:");
if ((EXT_IS_ACTIVE("active")) && (EXT_IS_ACTIVE("online"))) {
// Init content
$content = array(
- 'menu' => "<a class=\"menu_blur\" href=\"".URL."/modules.php?module=index&what=active\">".getConfig('menu_blur_spacer').GUEST_ACTIVE_LINK."</a>",
+ 'menu' => "<a class=\"menu_blur\" href=\"{!URL!}/modules.php?module=index&what=active\">".getConfig('menu_blur_spacer').GUEST_ACTIVE_LINK."</a>",
'what' => "active"
);
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__);
}
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__);
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
// 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',
), __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'
$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
// 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'] = " ";
// 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) {
$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
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'));
}
}
// 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
// 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
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);
$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
// 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
} // 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
}
// 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);
$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
} // 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
$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
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(), "");
} // 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__);
}
// 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?
// 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__);
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 = "---"; }
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);
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) {
$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__);
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
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__);
}
}
$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
} 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
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?
} // 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',
);
} 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'],
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__);
}
$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
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("<br /><div align=\"center\">
-<div align=\"center\"><strong>".PAYOUT_NOW.":</strong></div><br />
+<div align=\"center\"><strong>{!PAYOUT_NOW!}:</strong></div><br />
<ul>");
// Now let's check
while (list($id, $type, $rate, $mpoi) = SQL_FETCHROW($result)) {
if ($points >= $mpoi) {
// Ok we found one
$P = $points * $rate - 0.5;
- OUTPUT_HTML("<li>".PAYOUT_IN.": <strong><a href=\"".URL."/modules.php?module=login&what=payout&payout=".$id."\">".$type." (".PAYOUT_MAX." ".round($P)." ".$type.")</a></strong></li>");
+ OUTPUT_HTML("<li>{!PAYOUT_IN!}: <strong><a href=\"{!URL!}/modules.php?module=login&what=payout&payout=".$id."\">".$type." (".PAYOUT_MAX." ".round($P)." ".$type.")</a></strong></li>");
}
}
- // Free memory
- SQL_FREERESULT($result);
OUTPUT_HTML("</ul></div>");
} else {
// No payout types setup so far
- LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"guest_failed\">".PAYOUT_NO_PAYOUT_TYPES."</div");
+ LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"guest_failed\">{!PAYOUT_NO_PAYOUT_TYPES!}</div");
}
+
+ // Free memory
+ SQL_FREERESULT($result);
} else {
// Points is empty
- LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"guest_failed\">".PAYOUT_NO_POINTS_ENTERED."</div");
+ LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"guest_failed\">{!PAYOUT_NO_POINTS_ENTERED!}</div");
}
}
SQL_FREERESULT($result);
// Set notified to Y
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_rallye_data` SET notified='Y' WHERE id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET notified='Y' WHERE id=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
// Do a snapshot off all user refs
- $result_user = SQL_QUERY("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE status='CONFIRMED' ORDER BY userid", __FILE__, __LINE__);
+ $result_user = SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE status='CONFIRMED' ORDER BY userid", __FILE__, __LINE__);
// Transfer all neccessary data to the global $DATA array
$DATA['uid_cnt'] = SQL_NUMROWS($result_user);
if (empty($cnt)) $cnt = 0; // Added prevent some unknown troubles... :-?
// Check if line is already included...
- $result_ref = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s AND userid=%s LIMIT 1",
+ $result_ref = 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__);
if (SQL_NUMROWS($result_ref) == 0) {
// Free memory
// Add userid and his ref count to table
$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__);
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;
}
// 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
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__);
'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__);
} // 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;
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 {
// 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);
} // 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)
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__);
$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))
);
// 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;
);
// 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
// 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__);
//
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);
// 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);
// 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;
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__);
}
} 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);
$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)) {
$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__."(<font color=\"#0000aa\">".__LINE__."</font>):refback={$refback},uid={$uid},refid={$refid} - UPDATE! (".SQL_AFFECTEDROWS().")<br />\n";
$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!)
// 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__);
$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__."(<font color=\"#0000aa\">".__LINE__."</font>):found=".SQL_NUMROWS($result_refid)."<br />\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;
} // 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?
if (SQL_NUMROWS($result) == 0) {
// Insert this level
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$cacheArray['back_level']},ref={$cacheArray['up_refid'][$cacheArray['back_level']]} - ADD!<br />\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!
$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__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level=".($cacheArray['back_level']-$minus).",ref={$cacheArray['up_refid'][$cacheArray['back_level']]},numRows=".SQL_NUMROWS($result)." - BACK!<br />\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__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level=".($cacheArray['back_level']-$minus).",ref={$cacheArray['up_refid'][$cacheArray['back_level']]} - RETURNED!<br />\n";
} // END - if
// 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",
$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?
$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?
//
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 = "<div class=\\\"guest_failed\\\"> (*)</div>";
$eval = "define('MUST_".strtoupper($name)."', \"".$value."\");";
$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
//
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
// 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)
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
$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?
// 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', ";
}
$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);
$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) {
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 = "<strong>".$title_sub."</strong>";
// 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__);
$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',";
foreach ($actionArray as $actionId=>$action) {
// Add form for this action
$OUT .= sprintf(" <td align=\"center\" width=\"%d%%\">
- <form action=\"".URL."/modules.php?module=login&what=surfbar_list\" method=\"post\" style=\"padding-bottom:0px\">
+ <form action=\"{!URL!}/modules.php?module=login&what=surfbar_list\" method=\"post\" style=\"padding-bottom:0px\">
<input type=\"hidden\" name=\"id\" value=\"%s\" />
<input type=\"hidden\" name=\"action\" value=\"%s\" />
<input type=\"submit\" class=\"member_submit\" name=\"ok\" title=\"{--MEMBER_SURFBAR_ACTION_%s_TITLE--}\" value=\"{--MEMBER_SURFBAR_ACTION_%s_SUBMIT--}\" />
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?
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
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
// 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",
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'],
} // 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",
// 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__
);
// 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__
//* 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"
} // 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
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
// 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
//* 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",
// 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
} 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
// 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__);
// 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! ---------
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__);
// 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__);
$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?
// 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
} 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",
$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', "<a href=\"".URL."/modules.php?module=admin&what=list_task&type=updates\">".$value."</a>");
+ define('__TASK_UPDATE_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&what=list_task&type=updates\">".$value."</a>");
} else {
define('__TASK_UPDATE_VALUE', "0");
}
$value = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true);
if ($value > 0) {
- define('__CONFIRMED_VALUE', "<a href=\"".URL."/modules.php?module=admin&what=list_user&status=confirmed\">".$value."</a>");
+ define('__CONFIRMED_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&what=list_user&status=confirmed\">".$value."</a>");
} else {
define('__CONFIRMED_VALUE', "0");
}
$value = GET_TOTAL_DATA("UNCONFIRMED", "user_data", "userid", "status", true);
if ($value > 0) {
- define('__UNCONFIRMED_VALUE', "<a href=\"".URL."/modules.php?module=admin&what=chk_regs\">".$value."</a>");
+ define('__UNCONFIRMED_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&what=chk_regs\">".$value."</a>");
} else {
define('__UNCONFIRMED_VALUE', "0");
}
$value = GET_TOTAL_DATA("LOCKED", "user_data", "userid", "status", true);
if ($value > 0) {
- define('__LOCKED_VALUE', "<a href=\"".URL."/modules.php?module=admin&what=list_user&status=locked\">".$value."</a>");
+ define('__LOCKED_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&what=list_user&status=locked\">".$value."</a>");
} else {
define('__LOCKED_VALUE', "0");
}
$value = GET_TOTAL_DATA("0", "task_system", "id", "assigned_admin", true, " AND `status` != 'DELETED'");
if ($value > 0) {
- define('__TASK_NEW_VALUE', "<a href=\"".URL."/modules.php?module=admin&what=list_task&type=unassigned\">".$value."</a>");
+ define('__TASK_NEW_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&what=list_task&type=unassigned\">".$value."</a>");
} else {
define('__TASK_NEW_VALUE', "0");
}
$value = GET_TOTAL_DATA("CLOSED", "task_system", "id", "status", true);
if ($value > 0) {
- define('__TASK_CLOSED_VALUE', "<a href=\"".URL."/modules.php?module=admin&what=list_task&type=closed\">".$value."</a>");
+ define('__TASK_CLOSED_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&what=list_task&type=closed\">".$value."</a>");
} else {
define('__TASK_CLOSED_VALUE', "0");
}
$value = GET_TOTAL_DATA("DELETED", "task_system", "id", "status", true);
if ($value > 0) {
- define('__TASK_DELETED_VALUE', "<a href=\"".URL."/modules.php?module=admin&what=list_task&type=deleted\">".$value."</a>");
+ define('__TASK_DELETED_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&what=list_task&type=deleted\">".$value."</a>");
} else {
define('__TASK_DELETED_VALUE', "0");
}
$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', "<a href=\"".URL."/modules.php?module=admin&what=list_task&type=solved\">".$value."</a>");
+ define('__TASK_SOLVED_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&what=list_task&type=solved\">".$value."</a>");
} else {
define('__TASK_SOLVED_VALUE', "0");
}
$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', "<a href=\"".URL."/modules.php?module=admin&what=list_task\">".$value."</a>");
+ define('__TASK_YOUR_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&what=list_task\">".$value."</a>");
} else {
define('__TASK_YOUR_VALUE', "0");
}
$value = GET_TOTAL_DATA("ADMIN", "pool", "id", "data_type", true);
if ($value > 0) {
- define('__MAIL_ADMIN_VALUE', "<a href=\"".URL."/modules.php?module=admin&what=unlock_emails\">".$value."</a>");
+ define('__MAIL_ADMIN_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&what=unlock_emails\">".$value."</a>");
} else {
define('__MAIL_ADMIN_VALUE', "0");
}
$value = GET_TOTAL_DATA("TEMP", "pool", "id", "data_type", true);
if ($value > 0) {
- define('__MAIL_TEMP_VALUE', "<a href=\"".URL."/modules.php?module=admin&what=email_details\">".$value."</a>");
+ define('__MAIL_TEMP_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&what=email_details\">".$value."</a>");
} else {
define('__MAIL_TEMP_VALUE', "0");
}
$value = GET_TOTAL_DATA("SEND", "pool", "id", "data_type", true);
if ($value > 0) {
- define('__MAIL_SEND_VALUE', "<a href=\"".URL."/modules.php?module=admin&what=email_archiv\">".$value."</a>");
+ define('__MAIL_SEND_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&what=email_archiv\">".$value."</a>");
} else {
define('__MAIL_SEND_VALUE', "0");
}
$value = GET_TOTAL_DATA("DELETED", "pool", "id", "data_type", true);
if ($value > 0) {
- define('__MAIL_DELETED_VALUE', "<a href=\"".URL."/modules.php?module=admin&what=email_details\">".$value."</a>");
+ define('__MAIL_DELETED_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&what=email_details\">".$value."</a>");
} else {
define('__MAIL_DELETED_VALUE', "0");
}
$value = GET_TOTAL_DATA("DELETED", "bonus", "id", "data_type", true);
if ($value > 0) {
- define('__MAIL_BONUS_AP_VALUE', "<a href=\"".URL."/modules.php?module=admin&what=email_details\">".$value."</a>");
+ define('__MAIL_BONUS_AP_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&what=email_details\">".$value."</a>");
} 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', "<div class=\"admin_note\">".ADMIN_EXT_BONUS_404."</div>");
+ define('__MAIL_BONUS_AP_VALUE', "<div class=\"admin_note\">{!ADMIN_EXT_BONUS_404!}</div>");
}
} else {
- define('__MAIL_BONUS_AP_VALUE', "<div class=\"admin_note\">".ADMIN_EXT_AUTOPURGE_404."</div>");
- define('__MAIL_DELETED_VALUE', "<div class=\"admin_note\">".ADMIN_EXT_AUTOPURGE_404."</div>");
+ define('__MAIL_BONUS_AP_VALUE', "<div class=\"admin_note\">{!ADMIN_EXT_AUTOPURGE_404!}</div>");
+ define('__MAIL_DELETED_VALUE', "<div class=\"admin_note\">{!ADMIN_EXT_AUTOPURGE_404!}</div>");
}
//
$value = GET_TOTAL_DATA("SEND", "bonus", "id", "data_type", true, " AND is_notify='N'");
if ($value > 0) {
- define('__MAIL_BONUS_SEND_VALUE', "<a href=\"".URL."/modules.php?module=admin&what=email_details\">".$value."</a>");
+ define('__MAIL_BONUS_SEND_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&what=email_details\">".$value."</a>");
} 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")) {
// 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") {
}
$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") {
$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
}
//
-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) {
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'] = "<a href=\"".URL."/modules.php?module=admin&what=".$WHATs[$key]."\" title=\"".$TITLEs[$key]."\">".$value."</a>";
+ if (empty($TITLEs[$key])) $TITLEs[$key] = getMessage('TASK_ADMIN_UNKNOWN_LIST_TITLE');
+ $content['row_link'] = "<a href=\"{!URL!}/modules.php?module=admin&what=".$WHATs[$key]."\" title=\"".$TITLEs[$key]."\">".$value."</a>";
} else {
$content['row_link'] = 0;
}
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);
);
// 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)) {
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?
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?
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
//
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
$OUT .= "<strong>".$ltr."</strong>";
} else {
// Output link to letter
- $OUT .= "<a href=\"".URL."/modules.php?module=admin&what=".$GLOBALS['what'];
+ $OUT .= "<a href=\"{!URL!}/modules.php?module=admin&what=".$GLOBALS['what'];
if (!empty($_GET['mode'])) $OUT .= "&mode=".SQL_ESCAPE($_GET['mode']);
$OUT .= "&letter=".$ltr."&sortby=".$sortby.$ADD."\">".$ltr."</a>";
}
if ($sortby == $sort) {
$OUT .= "<strong>".$title."</strong> | ";
} else {
- $OUT .= "<a href=\"".URL."/modules.php?module=admin&what=list_user&letter=".$letter."&sortby=".$sort.$ADD."\">".$title."</a> | ";
+ $OUT .= "<a href=\"{!URL!}/modules.php?module=admin&what=list_user&letter=".$letter."&sortby=".$sort.$ADD."\">".$title."</a> | ";
}
} // END - foreach
if (empty($_GET['sortby'])) $_GET['sortby'] = "userid";
// Base link
- $OUT .= "<a href=\"".URL."/modules.php?module=admin&what=".$GLOBALS['what'];
+ $OUT .= "<a href=\"{!URL!}/modules.php?module=admin&what=".$GLOBALS['what'];
// Add status or mode
if (!empty($_GET['status'])) $OUT .= "&mode=".SQL_ESCAPE($_GET['status']);
if (IS_ADMIN()) $locked = "";
$result = SQL_QUERY_ESC("SELECT userid
-FROM `{!MYSQL_PREFIX!}_user_data`
+FROM `{!_MYSQL_PREFIX!}_user_data`
WHERE email='%s'".$locked." LIMIT 1",
array($email), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 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);
} // END - if
// Free memory
$randNum = mt_rand(0, ($totalUsers - 1));
// Look for random user
- $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",
+ $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?
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
$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);
}
$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
// 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
}
} 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!
} 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?
// 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!
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);
// 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__);
}
$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
}
$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__);
}
$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?
// 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
$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
}
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__);
}
}
// 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
// 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
$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)) {
$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);
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
$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);
$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);
// 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
$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
$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",
// 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__);
}
// 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
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__);
}
$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
$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",
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
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
if (!empty($_GET['register'])) {
// Registration of first admin is done
- if ($_GET['register'] == "done") LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"admin\">".ADMIN_REGISTER_DONE."</div>");
+ 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
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." [<a href=\"".URL."/modules.php?module=admin&reset_pass=1\">".ADMIN_RESET_PASS."</a>]\n";
+ $ret = "{!WRONG_PASS!} [<a href=\"{!URL!}/modules.php?module=admin&reset_pass=1\">{!ADMIN_RESET_PASS!}</a>]\n";
DESTROY_ADMIN_SESSION();
break;
$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
$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?
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__);
}
// 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
// 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
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) {
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);
}
} // 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 = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"admin_menu_main\">
}
else
{
- $OUT .= "[<a href=\"".URL."/modules.php?module=admin&action=".$menu."\">";
+ $OUT .= "[<a href=\"{!URL!}/modules.php?module=admin&action=".$menu."\">";
}
$OUT .= $title;
if (($menu == $act) && (empty($wht)))
}
$OUT .= "</NOBR></td>
</tr>\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();
}
else
{
- $OUT .= "[<a href=\"".URL."/modules.php?module=admin&what=".$wht_sub."\">";
+ $OUT .= "[<a href=\"{!URL!}/modules.php?module=admin&what=".$wht_sub."\">";
}
}
else
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 ;-) )
}
//
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
$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
$DATA_UPDATE = implode(", ", $DATA);
// Generate SQL string
- $SQL = sprintf("UPDATE `"._MYSQL_PREFIX."%s` SET %s WHERE %s LIMIT 1",
+ $SQL = sprintf("UPDATE `{!_MYSQL_PREFIX!}%s` SET %s WHERE %s LIMIT 1",
$tableName,
$DATA_UPDATE,
$whereStatement
$VALUEs = implode(", ", $VALUEs);
// Generate SQL string
- $SQL = sprintf("INSERT INTO "._MYSQL_PREFIX."%s (%s) VALUES (%s)",
+ $SQL = sprintf("INSERT INTO {!_MYSQL_PREFIX!}%s (%s) VALUES (%s)",
$tableName,
$KEYs,
$VALUEs
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
//* DEBUG: */ echo "a:".$title."<br />";
// Return link
- return "<a href=\"".URL."/modules.php?module=admin&what=".$wht."&u_id=".$uid."\" title=\"".ADMIN_USER_PROFILE_TITLE."\">".$title."</a>";
+ return "<a href=\"{!URL!}/modules.php?module=admin&what=".$wht."&u_id=".$uid."\" title=\"".ADMIN_USER_PROFILE_TITLE."\">".$title."</a>";
}
-//
-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
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
// 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?
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
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
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;
), 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!)
);
// 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
} // 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!)
// 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 = "";
// 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
// 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)));
}
} // 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!)
$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
// 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)));
}
} // 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!)
}
} // 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!)
}
} // END - if
}
+
// Checks proxy settins by fetching check-updates3.php from www.mxchange.org
function ADMIN_TEST_PROXY_SETTINGS ($settingsArray) {
global $_CONFIG;
// 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
$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
$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... ;)
$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?
}
// 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
// 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__);
}
//
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...
// 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__);
// 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...
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
} // 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);
{
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);
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);
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);
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);
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
$login = GET_ADMIN_LOGIN($admin);
if ($login != "***") {
// Admin found
- $admin = "<a href=\"".URL."/modules.php?module=admin&what=admins_contct&admin=".$admin."\">".$login."</a>";
+ $admin = "<a href=\"{!URL!}/modules.php?module=admin&what=admins_contct&admin=".$admin."\">".$login."</a>";
} else {
// Maybe deleted?
$admin = "<div class=\"admin_note\">".ADMIN_ID_404_1.$admin.ADMIN_ID_404_2."</div>";
// 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
// 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
// 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', "<a href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".$sname." ".$fname."</a>");
$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(),
), __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);
// 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
$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
// 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)
{
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'],
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'],
);
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'));
}
//
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']);
}
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)
{
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)
{
$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',
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
// 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);
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);
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);
}
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)
if (($sort == 0) || (($sort == 1) && (!empty($SUB))))
{
// Is highest position
- $NAVI = "<a href=\"".URL."/modules.php?module=admin&what=adminedit&sub=".$SUB."&act=".$act."&w=".$wht."&tid=".($sort+1)."&fid=".$sort."\">".LOWER."</a>";
+ $NAVI = "<a href=\"{!URL!}/modules.php?module=admin&what=adminedit&sub=".$SUB."&act=".$act."&w=".$wht."&tid=".($sort+1)."&fid=".$sort."\">{!LOWER!}</a>";
}
elseif ($cnt == $max)
{
// Is lowest position
- $NAVI = "<a href=\"".URL."/modules.php?module=admin&what=adminedit&sub=".$SUB."&act=".$act."&w=".$wht."&tid=".($sort-1)."&fid=".$sort."\">".HIGHER."</a>";
+ $NAVI = "<a href=\"{!URL!}/modules.php?module=admin&what=adminedit&sub=".$SUB."&act=".$act."&w=".$wht."&tid=".($sort-1)."&fid=".$sort."\">{!HIGHER!}</a>";
}
elseif ($sort > 0)
{
// Anything else between highest and lowest
- $NAVI = "<a href=\"".URL."/modules.php?module=admin&what=adminedit&sub=".$SUB."&act=".$act."&w=".$wht."&tid=".($sort-1)."&fid=".$sort."\">".HIGHER."</a>/<a href=\"".URL."/modules.php?module=admin&what=adminedit&sub=".$SUB."&act=".$act."&w=".$wht."&tid=".($sort+1)."&fid=".$sort."\">".LOWER."</a>";
+ $NAVI = "<a href=\"{!URL!}/modules.php?module=admin&what=adminedit&sub=".$SUB."&act=".$act."&w=".$wht."&tid=".($sort-1)."&fid=".$sort."\">{!HIGHER!}</a>/<a href=\"{!URL!}/modules.php?module=admin&what=adminedit&sub=".$SUB."&act=".$act."&w=".$wht."&tid=".($sort+1)."&fid=".$sort."\">{!LOWER!}</a>";
}
if (empty($act)) $act = " ";
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'));
}
}
$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);
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))
{
// 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__);
$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 = "<a href=\"".URL."/modules.php?module=admin&what=admins_contct&admin=".$aid."\">".$admin."</a>";
+ $admin_link = "<a href=\"{!URL!}/modules.php?module=admin&what=admins_contct&admin=".$aid."\">".$admin."</a>";
}
elseif ($aid == 0)
{
// 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__);
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
$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);
'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
),
);
$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__);
}
}
// 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);
$login = GET_ADMIN_LOGIN($admin);
if ($login != "***") {
// Admin found
- $admin = "<a href=\"".URL."/modules.php?module=admin&what=admins_contct&admin=".$admin."\">".$login."</a>";
+ $admin = "<a href=\"{!URL!}/modules.php?module=admin&what=admins_contct&admin=".$admin."\">".$login."</a>";
} else {
// Maybe deleted?
$admin = "<div class=\"admin_note\">".ADMIN_ID_404_1.$admin.ADMIN_ID_404_2."</div>";
} 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__);
}
}
// 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']));
$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']),
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 = "---";
// Load admin's data
$login = GET_ADMIN_LOGIN($admin);
- if ($login != "***")
- {
+ if ($login != "***") {
// Admin found
- $admin = "<a href=\"".URL."/modules.php?module=admin&what=admins_contct&admin=".$admin."\">".$login."</a>";
- }
- else
- {
+ $admin = "<a href=\"{!URL!}/modules.php?module=admin&what=admins_contct&admin=".$admin."\">".$login."</a>";
+ } else {
// Maybe deleted?
$admin = "<div class=\"admin_note\">".ADMIN_ID_404_1.$admin.ADMIN_ID_404_2."</div>";
}
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 {
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;
$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);
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);
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
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 {
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;
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);
$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);
// 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 = "";
if (isset($_POST['ok'])) {
// Save settings
ADMIN_SAVE_SETTINGS($_POST);
- OUTPUT_HTML("<a href=\"".URL."/modules.php?module=admin&what=config_home&sub=settings\">".ADMIN_CONTINUE_TO_CONFIG."</a>");
+ OUTPUT_HTML("<a href=\"{!URL!}/modules.php?module=admin&what=config_home&sub=settings\">".ADMIN_CONTINUE_TO_CONFIG."</a>");
} else {
// Prepare data for the template
$content = array_fill(-1, 60, "");
// 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 = "<a href=\"".URL."/modules.php?module=admin&what=config_home&sub=target&home=".$wht."\">"._IS_NEW_HOME."</a>";
+ $LINK = "<a href=\"{!URL!}/modules.php?module=admin&what=config_home&sub=target&home=".$wht."\">"._IS_NEW_HOME."</a>";
if ($wht == getConfig('index_home')) {
// Is current home
- $LINK = "<div class=\"admin_note\">"._IS_CURRENT_HOME."</div>";
+ $LINK = "<div class=\"admin_note\">{!_IS_CURRENT_HOME!}</div>";
$atitle = "<div class=\"admin_note\">".$atitle."</div>";
$wtitle = "<div class=\"admin_note\">".$wtitle."</div>";
}
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);
$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__);
}
{
// 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))
if (($mod == "index") || ($mod == "login"))
{
// Add link to detail statistics
- $mod = "<strong><a href=\"".URL."/modules.php?module=admin&what=stats_mods&mod=".$mod."\">".$mod."</a></strong>";
+ $mod = "<strong><a href=\"{!URL!}/modules.php?module=admin&what=stats_mods&mod=".$mod."\">".$mod."</a></strong>";
}
// Prepare array for the template
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(
}
// 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)) {
// 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,
$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);
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;
$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);
}
// 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
// Does your members request payouts?
if ((SQL_NUMROWS($result_mem) > 0) && ($display)) {
// Members has requested payouts
- LOAD_TEMPLATE("admin_settings_saved", false, "<a href=\"".URL."/modules.php?module=admin&what=list_payouts\">".ADMIN_PAYOUT_LIST_REQUESTS."</a></P>");
+ LOAD_TEMPLATE("admin_settings_saved", false, "<a href=\"{!URL!}/modules.php?module=admin&what=list_payouts\">".ADMIN_PAYOUT_LIST_REQUESTS."</a></P>");
} 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
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
$_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;
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;
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'
);
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
// 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);
// 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);
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 = "";
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
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']),
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__);
}
$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__);
}
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);
else
{
// Nothing selected
- $content = RALLYE_NO_PRICES_SELECTED_1."<a href=\"".URL."/modules.php?module=admin&what=config_rallye_prices&rallye=".$_GET['rallye']."\">".RALLYE_NO_PRICES_SELECTED_2."</a>".RALLYE_NO_PRICES_SELECTED_3;
+ $content = RALLYE_NO_PRICES_SELECTED_1."<a href=\"{!URL!}/modules.php?module=admin&what=config_rallye_prices&rallye=".$_GET['rallye']."\">".RALLYE_NO_PRICES_SELECTED_2."</a>".RALLYE_NO_PRICES_SELECTED_3;
LOAD_TEMPLATE("admin_settings_saved", false, $content);
}
}
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);
else
{
// Nothing selected
- $content = RALLYE_NO_PRICES_SELECTED_1."<a href=\"".URL."/modules.php?module=admin&what=config_rallye_prices&rallye=".$_GET['rallye']."\">".RALLYE_NO_PRICES_SELECTED_2."</a>".RALLYE_NO_PRICES_SELECTED_3;
+ $content = RALLYE_NO_PRICES_SELECTED_1."<a href=\"{!URL!}/modules.php?module=admin&what=config_rallye_prices&rallye=".$_GET['rallye']."\">".RALLYE_NO_PRICES_SELECTED_2."</a>".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 = "---";
{
// 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)
{
// 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
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 = "---";
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
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
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
// 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__);
}
} 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!
}
// 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, "<a href=\"".URL."/modules.php?module=admin&what=del_email&pid=".bigintval($_GET['mid'])."\">".ADMIN_REMOVE_STATS_ENTRY."</a>");
+ LOAD_TEMPLATE("admin_settings_saved", false, "<a href=\"{!URL!}/modules.php?module=admin&what=del_email&pid=".bigintval($_GET['mid'])."\">".ADMIN_REMOVE_STATS_ENTRY."</a>");
} // 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();
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
$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();
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
$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();
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'));
}
//
{
// 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)
{
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
// 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)
{
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
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
// 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
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");
}
} 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'));
}
//
// 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(
// 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
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
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);
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'
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
$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
$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
} // END - if
} elseif (FILE_READABLE(sprintf("%stemplates/%s/html/admin/%s.tpl", PATH, GET_LANGUAGE(), $TPL))) {
// Create mailto link
- define('__SPONSOR_VALUE', "<a href=\"mailto:".__EMAIL."\">".__SURNAME." ".__FAMILY."</a>");
+ define('__SPONSOR_VALUE', "<a href=\"mailto:{!__EMAIL!}\">{!__SURNAME!} {!__FAMILY!}</a>");
// Load mode template
LOAD_TEMPLATE($TPL);
}
} 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'));
}
//
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__);
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',
// 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";
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);
if ($unconfirmed > 0)
{
// Add link to list_unconfirmed what-file
- $unconfirmed = "<strong><a href=\"".URL."/modules.php?module=admin&what=list_unconfirmed&mid=".$pool[0]."\">".$unconfirmed."</a></strong>";
+ $unconfirmed = "<strong><a href=\"{!URL!}/modules.php?module=admin&what=list_unconfirmed&mid=".$pool[0]."\">".$unconfirmed."</a></strong>";
}
// Prepare data for the row template
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'));
}
//
?>
// 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";
// 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'];
// 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'];
// 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";
// 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);
$pool['unconfirmed'] = $pool['sent_email'] - $pool['clicks'];
if ($pool['unconfirmed'] > 0) {
// Add link to list_unconfirmed what-file
- $pool['unconfirmed'] = "<strong><a href=\"".URL."/modules.php?module=admin&what=list_unconfirmed&mid=".$pool['id']."\">".$pool['unconfirmed']."</a></strong>";
+ $pool['unconfirmed'] = "<strong><a href=\"{!URL!}/modules.php?module=admin&what=list_unconfirmed&mid=".$pool['id']."\">".$pool['unconfirmed']."</a></strong>";
} elseif ($pool['unconfirmed'] < 0) {
// Sometimes rarely displayed minus values will be "fixed" to zero
$pool['unconfirmed'] = 0;
// Add link?
if ($bonus['unconfirmed'] > 0) {
// Add link to list_unconfirmed what-file
- $bonus['unconfirmed'] = "<strong><a href=\"".URL."/modules.php?module=admin&what=list_unconfirmed&bid=".$bonus['id']."\">".$bonus['unconfirmed']."</a></strong>";
+ $bonus['unconfirmed'] = "<strong><a href=\"{!URL!}/modules.php?module=admin&what=list_unconfirmed&bid=".$bonus['id']."\">".$bonus['unconfirmed']."</a></strong>";
} // END - if
// Prepare content
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
//
// 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
$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__);
}
}
// Extensions changed
- OUTPUT_HTML("<P align=\"center\">");
- LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_EXT_CHANGED);
- OUTPUT_HTML("</P>");
+ LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_EXT_CHANGED'));
} else {
// Edit selected entries
$SW = "2"; $OUT = "";
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);
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__);
}
LOAD_TEMPLATE("admin_extensions");
} else {
// No extensions are registered
- LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NO_EXTENSION_REGISTERED."</div>");
+ 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);
// 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);
$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")) {
} // 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;
}
//
$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)) {
// 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)
{
// 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'],
}
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'],
$_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'));
}
//
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
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)
{
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)
{
$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
$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
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)
{
// 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);
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
// 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__);
}
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 = "<a href=\"".URL."/modules.php?module=admin&what=guestedit&sub=".__SUB_VALUE."&act=".$act."&w=".$wht."&tid=".($sort+1)."&fid=".$sort."\">".LOWER."</a>";
- }
- elseif ($cnt == $max)
- {
+ $NAVI = "<a href=\"{!URL!}/modules.php?module=admin&what=guestedit&sub=".__SUB_VALUE."&act=".$act."&w=".$wht."&tid=".($sort+1)."&fid=".$sort."\">{!LOWER!}</a>";
+ } elseif ($cnt == $max) {
// Is lowest position
- $NAVI = "<a href=\"".URL."/modules.php?module=admin&what=guestedit&sub=".__SUB_VALUE."&act=".$act."&w=".$wht."&tid=".($sort-1)."&fid=".$sort."\">".HIGHER."</a>";
- }
- elseif ($sort > 0)
- {
+ $NAVI = "<a href=\"{!URL!}/modules.php?module=admin&what=guestedit&sub=".__SUB_VALUE."&act=".$act."&w=".$wht."&tid=".($sort-1)."&fid=".$sort."\">{!HIGHER!}</a>";
+ } elseif ($sort > 0) {
// Anything else between highest and lowest
- $NAVI = "<a href=\"".URL."/modules.php?module=admin&what=guestedit&sub=".__SUB_VALUE."&act=".$act."&w=".$wht."&tid=".($sort-1)."&fid=".$sort."\">".HIGHER."</a>/<a href=\"".URL."/modules.php?module=admin&what=guestedit&sub=".__SUB_VALUE."&act=".$act."&w=".$wht."&tid=".($sort+1)."&fid=".$sort."\">".LOWER."</a>";
+ $NAVI = "<a href=\"{!URL!}/modules.php?module=admin&what=guestedit&sub=".__SUB_VALUE."&act=".$act."&w=".$wht."&tid=".($sort-1)."&fid=".$sort."\">{!HIGHER!}</a>/<a href=\"{!URL!}/modules.php?module=admin&what=guestedit&sub=".__SUB_VALUE."&act=".$act."&w=".$wht."&tid=".($sort+1)."&fid=".$sort."\">{!LOWER!}</a>";
}
+
if (empty($act)) $act = " ";
if (empty($wht)) $wht = " ";
if (empty($title)) $title = " ";
// 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'));
}
}
// 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__);
{
// 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(
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'));
}
//
?>
// 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) {
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
$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("<br />");
+ LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_BEG_WITHDRAW_PREPARED'));
} // END - if
// Autopurge installed?
// 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__);
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')) {
define('__BEG_WITHDRAW_FORM', LOAD_TEMPLATE("admin_list_beg_form", true));
} else {
// Display message "no manual withdraw possible"
- define('__BEG_WITHDRAW_FORM', "<div class=\"admin_failed\">".ADMIN_BEG_ALREADY_WITHDRAW."</div>");
+ define('__BEG_WITHDRAW_FORM', "<div class=\"admin_failed\">{!ADMIN_BEG_ALREADY_WITHDRAW!}</div>");
}
// Prepare constant for timemark
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'));
}
//
$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("<br />");
+ LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_BONUS_WITHDRAW_PREPARED'));
}
if (GET_EXT_VERSION("bonus") >= "0.6.9") {
// 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__);
define('__BONUS_WITHDRAW_FORM', LOAD_TEMPLATE("admin_list_bonus_form", true));
} else {
// Display message "no manual withdraw possible"
- define('__BONUS_WITHDRAW_FORM', "<div class=\"admin_failed\">".ADMIN_BONUS_ALREADY_WITHDRAW."</div>");
+ define('__BONUS_WITHDRAW_FORM', "<div class=\"admin_failed\">{!ADMIN_BONUS_ALREADY_WITHDRAW!}</div>");
}
// 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'));
}
//
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
SQL_FREERESULT($result);
// Prepare constants
- define('__CATS_BASE' , "<a href=\"".URL."/modules.php?module=admin&u_id=");
+ define('__CATS_BASE' , "<a href=\"{!URL!}/modules.php?module=admin&u_id=");
define('__UID' , bigintval($_GET['u_id']));
define('__MEMBER_LINKS', MEMBER_ACTION_LINKS(__UID));
define('__EMAIL' , "<a href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".$sname." ".$fname."</a>");
// 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
// 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
$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
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
} 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;
}
// 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,
} 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);
}
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);
{
// Something was payed out
$SUM_ALREADY += $cnt;
- define('__DOUBLER_ALREADY_DIRECT_LINK', "<a href=\"".URL."/modules.php?module=admin&what=list_doubler&mode=already&select=direct\">".$cnt."</a>");
+ define('__DOUBLER_ALREADY_DIRECT_LINK', "<a href=\"{!URL!}/modules.php?module=admin&what=list_doubler&mode=already&select=direct\">".$cnt."</a>");
}
- $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);
{
// Something was payed out
$SUM_ALREADY += $cnt;
- define('__DOUBLER_ALREADY_REF_LINK', "<a href=\"".URL."/modules.php?module=admin&what=list_doubler&mode=already&select=ref\">".$cnt."</a>");
+ define('__DOUBLER_ALREADY_REF_LINK', "<a href=\"{!URL!}/modules.php?module=admin&what=list_doubler&mode=already&select=ref\">".$cnt."</a>");
}
- define('__DOUBLER_ALREADY_ALL_LINK', "<a href=\"".URL."/modules.php?module=admin&what=list_doubler&mode=already&select=all\">".$SUM_ALREADY."</a>");
+ define('__DOUBLER_ALREADY_ALL_LINK', "<a href=\"{!URL!}/modules.php?module=admin&what=list_doubler&mode=already&select=all\">".$SUM_ALREADY."</a>");
// 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);
{
// Something was payed out
$SUM_WAITING += $cnt;
- define('__DOUBLER_WAITING_DIRECT_LINK', "<a href=\"".URL."/modules.php?module=admin&what=list_doubler&mode=waiting&select=direct\">".$cnt."</a>");
+ define('__DOUBLER_WAITING_DIRECT_LINK', "<a href=\"{!URL!}/modules.php?module=admin&what=list_doubler&mode=waiting&select=direct\">".$cnt."</a>");
}
- $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);
{
// Something was payed out
$SUM_WAITING += $cnt;
- define('__DOUBLER_WAITING_REF_LINK', "<a href=\"".URL."/modules.php?module=admin&what=list_doubler&mode=waiting&select=ref\">".$cnt."</a>");
+ define('__DOUBLER_WAITING_REF_LINK', "<a href=\"{!URL!}/modules.php?module=admin&what=list_doubler&mode=waiting&select=ref\">".$cnt."</a>");
}
- define('__DOUBLER_WAITING_ALL_LINK', "<a href=\"".URL."/modules.php?module=admin&what=list_doubler&mode=waiting&select=all\">".$SUM_WAITING."</a>");
+ define('__DOUBLER_WAITING_ALL_LINK', "<a href=\"{!URL!}/modules.php?module=admin&what=list_doubler&mode=waiting&select=all\">".$SUM_WAITING."</a>");
// All data is loaded here...
break;
// 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__);
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?
// 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__);
}
// 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 = "";
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 = "<a href=\"".URL."/mailid.php?uid=".$_GET['u_id']."&mailid=".$id."\" target=\"_blank\">".$id."</a>";
+ $LINK = "<a href=\"{!URL!}/mailid.php?uid=".$_GET['u_id']."&mailid=".$id."\" target=\"_blank\">".$id."</a>";
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 = "<a href=\"".URL."/mailid.php?uid=".$_GET['u_id']."&bonusid=".$id2."\" target=\"_blank\">".$id2."</a>";
+ $LINK = "<a href=\"{!URL!}/mailid.php?uid=".$_GET['u_id']."&bonusid=".$id2."\" target=\"_blank\">".$id2."</a>";
break;
default: // Problem in application detected!
// 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(
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...
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'));
}
//
// 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";
// Add link?
if ($bonus['unconfirmed'] > 0) {
// Add link to list_unconfirmed what-file
- $bonus['unconfirmed'] = "<strong><a href=\"".URL."/modules.php?module=admin&what=list_unconfirmed&bid=".$bonus['id']."\">".$bonus['unconfirmed']."</a></strong>";
+ $bonus['unconfirmed'] = "<strong><a href=\"{!URL!}/modules.php?module=admin&what=list_unconfirmed&bid=".$bonus['id']."\">".$bonus['unconfirmed']."</a></strong>";
} // END - if
// Prepare content
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);
// 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);
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);
// 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);
}
// 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
}
// 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
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__);
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 = "<a href=\"".URL."/modules.php?module=admin&what=list_payouts&do=accept&pid=".$pid."\">".PAYOUT_ACCEPT_PAYOUT."</a> | <a href=\"".URL."/modules.php?module=admin&what=list_payouts&do=reject&pid=".$pid."\">".PAYOUT_REJECT_PAYOUT."</a>";
+ $status = "<a href=\"{!URL!}/modules.php?module=admin&what=list_payouts&do=accept&pid=".$pid."\">".PAYOUT_ACCEPT_PAYOUT."</a> | <a href=\"{!URL!}/modules.php?module=admin&what=list_payouts&do=reject&pid=".$pid."\">".PAYOUT_REJECT_PAYOUT."</a>";
} else {
// Translate status
$status = constant('PAYOUT_STATUS_'.strtoupper($status).'');
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?
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;
}
}
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;
}
}
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;
}
}
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__);
}
$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',
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);
}
} 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)
{
{
// 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)
$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);
if ($joined > 0)
{
// List joined users
- $joined = "<a href=\"".URL."/modules.php?module=admin&what=list_rallyes&sub=users&rallye=".$id."\" title=\"".RALLYE_LIST_USERS."\">".$joined."</a>";
+ $joined = "<a href=\"{!URL!}/modules.php?module=admin&what=list_rallyes&sub=users&rallye=".$id."\" title=\"".RALLYE_LIST_USERS."\">".$joined."</a>";
}
// Alter some variables
$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?
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);
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
// 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)."<br />\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);
$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?
$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
$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);
}
} 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
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__);
}
// 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);
}
} 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
// 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) {
SQL_FREERESULT($result);
} else {
// No refs made so far
- LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SPONSOR_REFS_404_1."<a href=\"".URL."/modules.php?module=admin&what=list_sponsor&id=".bigintval($_GET['rid'])."\">".bigintval($_GET['rid'])."</a>".ADMIN_SPONSOR_REFS_404_2);
+ LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SPONSOR_REFS_404_1."<a href=\"{!URL!}/modules.php?module=admin&what=list_sponsor&id=".bigintval($_GET['rid'])."\">".bigintval($_GET['rid'])."</a>".ADMIN_SPONSOR_REFS_404_2);
}
} else {
// Sponsor not found
} 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,
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'));
}
}
$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__);
// 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__);
}
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__);
$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
}
} 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?
$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,
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) {
// ...
}
} 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'));
}
//
// 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?
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
// 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;
// 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) {
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
} 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())) {
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'])) {
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)
}
// 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!
if ($admin == "0")
{
// No admin currently is assigned
- $admin = "<div class=\"admin_note\">".ADMIN_NO_ADMIN_ASSIGNED."</div>";
+ $admin = "<div class=\"admin_note\">{!ADMIN_NO_ADMIN_ASSIGNED!}</div>";
}
else
{
if ($login != "***")
{
// Admin found
- $admin = "<a href=\"".URL."/modules.php?module=admin&what=admins_contct&admin=".$admin."\">".$login."</a>";
+ $admin = "<a href=\"{!URL!}/modules.php?module=admin&what=admins_contct&admin=".$admin."\">".$login."</a>";
}
else
{
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(
// 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";
// 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);
// 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,
// 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'));
}
}
//
if (empty($_GET['page'])) { $_GET['page'] = "1"; }
// Set base URL
-$BASE = "[<a href=\"".URL."/modules.php?module=admin";
+$BASE = "[<a href=\"{!URL!}/modules.php?module=admin";
if (!empty($_GET['u_id'])) {
// Secure the user ID
// Does the account exists?
$result_user = SQL_QUERY_ESC("SELECT gender, surname, family, street_nr, zip, city, country, email, birth_day, birth_month, birth_year, max_mails, receive_mails, refid, status, REMOTE_ADDR, last_online, last_module, ref_clicks, total_logins, used_points, emails_sent, joined, last_update, last_profile_sent, notified, ref_payout, emails_received, mails_confirmed".$MORE."
-FROM `{!MYSQL_PREFIX!}_user_data`
+FROM `{!_MYSQL_PREFIX!}_user_data`
WHERE userid=%s
LIMIT 1",
array($uid), __FILE__, __LINE__);
SQL_FREERESULT($result_user);
} else {
$whereStatement = "";
- if (($_GET['letter'] != _ALL2) && ($_GET['letter'] != _OTHERS) && (!empty($_GET['letter']))) {
+ if (($_GET['letter'] != getMessage('_ALL2')) && ($_GET['letter'] != getMessage('_OTHERS')) && (!empty($_GET['letter']))) {
// List only persons w
$whereStatement = " WHERE family LIKE '".$_GET['letter']."%'";
} // END - if
} // END = if
// Prepare SQL and run it
- $SQL = "SELECT userid, gender, surname, family, email, REMOTE_ADDR, refid, status, emails_sent, mails_confirmed, emails_received".$MORE." FROM `{!MYSQL_PREFIX!}_user_data`".$whereStatement." ORDER BY ".SQL_ESCAPE($_GET['sortby']);
+ $SQL = "SELECT userid, gender, surname, family, email, REMOTE_ADDR, refid, status, emails_sent, mails_confirmed, emails_received".$MORE." FROM `{!_MYSQL_PREFIX!}_user_data`".$whereStatement." ORDER BY ".SQL_ESCAPE($_GET['sortby']);
$result_master = SQL_QUERY($SQL, __FILE__, __LINE__);
// Calculate page count (0.5 fixes a bug with page count)
$SQL .= " LIMIT ".($_GET['offset'] * $_GET['page'] - $_GET['offset']).", ".$_GET['offset'];
$result = SQL_QUERY($SQL, __FILE__, __LINE__);
- $result_user = SQL_QUERY("SELECT emails_sent FROM `{!MYSQL_PREFIX!}_user_data` WHERE status='CONFIRMED'", __FILE__, __LINE__);
+ $result_user = SQL_QUERY("SELECT emails_sent FROM `{!_MYSQL_PREFIX!}_user_data` WHERE status='CONFIRMED'", __FILE__, __LINE__);
$user_count = SQL_NUMROWS($result_user);
SQL_FREERESULT($result_user);
SQL_FREERESULT($result_master);
} else {
// No one as registered so far! :-(
- LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NO_NONE_REGISTERED);
+ LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_NO_NONE_REGISTERED'));
}
}
ADD_DESCR("admin", __FILE__);
// Check for entries
-$result = SQL_QUERY("SELECT id, userid, wernis_account, wernis_amount, wernis_timestamp, wernis_type, wernis_api_message, wernis_api_status FROM `{!MYSQL_PREFIX!}_user_wernis` ORDER BY wernis_timestamp DESC, id DESC",
+$result = SQL_QUERY("SELECT id, userid, wernis_account, wernis_amount, wernis_timestamp, wernis_type, wernis_api_message, wernis_api_status FROM `{!_MYSQL_PREFIX!}_user_wernis` ORDER BY wernis_timestamp DESC, id DESC",
__FILE__, __LINE__);
// Are there some entries to display?
// Enougth queries left?
if (getConfig('yoomedia_requests_remain') == 0) {
// Output message
- LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_YOOMEDIA_REQUESTS_DEPLETED);
+ LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_YOOMEDIA_REQUESTS_DEPLETED'));
// Abort here!
return false;
// Sanity-check on result array
if ((!is_array($result)) || (count($result) == 0) || (!isset($result[0]['id']))) {
// Invalid result
- LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_YOOMEDIA_INVALID_RESULT);
+ LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_YOOMEDIA_INVALID_RESULT'));
return false;
} elseif (count($result[0]) < 7) {
// Error received so prepare error code
if (!empty($_GET['id'])) {
// Check for selected sponsor
- $result = SQL_QUERY_ESC("SELECT gender, surname, family, email, status FROM `{!MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT gender, surname, family, email, status FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' LIMIT 1",
array(bigintval($_GET['id'])), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Get sponsor's current status and let only confirmed and locked status pass
SEND_EMAIL($email, $subject, $msg);
// Update sponsor's account
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_sponsor_data` SET status='".$status."' WHERE id='%s' LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET status='".$status."' WHERE id='%s' LIMIT 1",
array(bigintval($_GET['id'])), __FILE__, __LINE__);
} elseif (!empty($_POST['no'])) {
// No don't lock / unlock now!
// Is a userid set?
if (!empty($_GET['u_id'])) {
// Load user's data
- $result_user = SQL_QUERY_ESC("SELECT status, gender, surname, family, email FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
+ $result_user = SQL_QUERY_ESC("SELECT status, gender, surname, family, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
array(bigintval($_GET['u_id'])), __FILE__, __LINE__);
$ACT = false;
if (SQL_NUMROWS($result_user) == 1) {
// Ok, lock the account!
if (GET_EXT_VERSION("user") >= "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__);
}
// 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__);
}
$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
// 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?
if (!empty($MSG)) {
LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"admin_green\">".$MSG."</div>");
} else {
- LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"admin_green\">".ADMIN_USER_UPDATED."</div>");
+ LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"admin_green\">".getMessage('ADMIN_USER_UPDATED')."</div>");
}
}
} else {
// 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("<li><a href=\"".URL."/modules.php?module=admin&what=".$GLOBALS['what']."&access=".urlencode($file)."\">".$file."</a></li>");
+ OUTPUT_HTML("<li><a href=\"{!URL!}/modules.php?module=admin&what=".$GLOBALS['what']."&access=".urlencode($file)."\">".$file."</a></li>");
}
}
closedir($handle);
// 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;
}
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
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;
// 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;
// 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;
}
}
$OUT = "<select class=\"admin_select\" name=\"sort\" size=\"1\">
<option value=\"\">".IS_FIRST_MENU."</option>";
- foreach ($below as $key => $m)
- {
- if (is_array($m))
- {
- foreach ($m as $key2 => $m2)
- {
+ foreach ($below as $key => $m) {
+ if (is_array($m)) {
+ foreach ($m as $key2 => $m2) {
$OUT .= " <option value=\"".$m2."\">".$titles[$key][$key2];
- foreach ($menus as $k => $v)
- {
- if (($v == $key) && (!is_array($v)))
- {
+ foreach ($menus as $k => $v) {
+ if (($v == $key) && (!is_array($v))) {
$OUT .= " (".$titles[$k].")";
}
}
$OUT .= "</option>\n";
}
- }
- else
- {
+ } else {
$OUT .= " <option value=\"".$m."\">".$titles[$key]."</option>\n";
}
}
// Display form
LOAD_TEMPLATE("admin_member_add");
-}
- elseif (!IS_DEMO())
-{
+} elseif (!IS_DEMO()) {
// Insert new menu entry
if (!empty($_POST['menu']))
{
- SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('%s','%s','%s','%s','%s','%s')",
+ SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('%s','%s','%s','%s','%s','%s')",
array(
$_POST['menu'],
$_POST['name'],
$_POST['active'],
bigintval($_POST['sort']),
), __FILE__, __LINE__);
- }
- else
- {
- SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_member_menu` (`action`,`title`,`visible`,`locked`,`sort`) VALUES ('%s','%s','%s','%s','%s')",
+ } else {
+ SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`title`,`visible`,`locked`,`sort`) VALUES ('%s','%s','%s','%s','%s')",
array(
$_POST['name'],
$_POST['title'],
bigintval($_POST['sort']),
), __FILE__, __LINE__);
}
- LOAD_TEMPLATE("admin_settings_saved", false, SAVING_DONE);
-}
- else
-{
+ 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'));
}
//
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']);
}
if (!empty($_POST['sel'])) $chk = SELECTION_COUNT($_POST['sel']);
// List all menu points and make them editable
-if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO()))
-{
+if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) {
// Edit menu entries
define('__SUB_VALUE', $SUB);
define('__CHK_VALUE', $chk);
$SW = 2; $cnt = 0; $OUT = "";
- foreach ($_POST['sel'] as $sel => $confirm)
- {
- if ($confirm == 1)
- {
+ foreach ($_POST['sel'] as $sel => $confirm) {
+ if ($confirm == 1) {
$cnt++;
- $result = SQL_QUERY_ESC("SELECT title, action, what FROM `{!MYSQL_PREFIX!}_member_menu` WHERE ".$AND." AND id=%s LIMIT 1",
- array(bigintval($sel)), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) == 1)
- {
+ $result = SQL_QUERY_ESC("SELECT title, action, what FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE ".$AND." AND id=%s LIMIT 1",
+ array(bigintval($sel)), __FILE__, __LINE__);
+ if (SQL_NUMROWS($result) == 1) {
// Entry found so we load the stuff...
list($menu, $act, $wht, $descr) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
);
// Load template
$OUT .= LOAD_TEMPLATE("admin_mmenu_edit_row", true, $content);
- }
- else
- {
+ } else {
// Entry not found?
$content = array(
'sw' => $SW,
// Load template
LOAD_TEMPLATE("admin_mmenu_edit");
-}
- elseif ((isset($_POST['del'])) && ($chk > 0) && (!IS_DEMO()))
-{
+} elseif ((isset($_POST['del'])) && ($chk > 0) && (!IS_DEMO())) {
// Del menu entries with or without confirmation
define('__SUB_VALUE', $SUB);
define('__CHK_VALUE', $chk);
$SW = 2; $cnt = 0; $OUT = "";
- foreach ($_POST['sel'] as $sel => $confirm)
- {
- if ($confirm == 1)
- {
+ foreach ($_POST['sel'] as $sel => $confirm) {
+ if ($confirm == 1) {
$cnt++;
- $result = SQL_QUERY_ESC("SELECT title FROM `{!MYSQL_PREFIX!}_member_menu` WHERE ".$AND." AND id=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE ".$AND." AND id=%s LIMIT 1",
array(bigintval($sel)), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1)
{
// Load template
LOAD_TEMPLATE("admin_mmenu_delete");
-}
- elseif ((isset($_POST['status'])) && ($chk > 0) && (!IS_DEMO()))
-{
+} elseif ((isset($_POST['status'])) && ($chk > 0) && (!IS_DEMO())) {
// Change status (visible / locked)
define('__SUB_VALUE', $SUB);
define('__CHK_VALUE', $chk);
$SW = 2; $cnt = 0; $OUT = "";
- foreach ($_POST['sel'] as $sel => $confirm)
- {
- if ($confirm == 1)
- {
+ foreach ($_POST['sel'] as $sel => $confirm) {
+ if ($confirm == 1) {
$cnt++;
- $result = SQL_QUERY_ESC("SELECT title, visible, locked FROM `{!MYSQL_PREFIX!}_member_menu` WHERE ".$AND." AND id=%s LIMIT 1",
- array(bigintval($sel)), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) == 1)
- {
+ $result = SQL_QUERY_ESC("SELECT title, visible, locked FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE ".$AND." AND id=%s LIMIT 1",
+ array(bigintval($sel)), __FILE__, __LINE__);
+ if (SQL_NUMROWS($result) == 1) {
// Entry found so we load the stuff...
list($menu, $vis, $locked) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
define('__CNT_VALUE', $cnt);
//
LOAD_TEMPLATE("admin_mmenu_status");
-}
- elseif ((isset($_POST['ok'])) && (!IS_DEMO()))
-{
+} elseif ((isset($_POST['ok'])) && (!IS_DEMO())) {
// An act is done...
- foreach ($_POST['sel'] as $sel => $menu)
- {
- $AND = "(what = '' OR what IS NULL)";
+ foreach ($_POST['sel'] as $sel => $menu) {
+ $AND = "(`what` = '' OR `what` IS NULL)";
$sel = bigintval($sel);
if (!empty($SUB)) $AND = "action='".$SUB."'";
switch ($_POST['ok'])
{
case "edit": // Edit menu
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_member_menu` SET title='%s', action='%s', what='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET title='%s', action='%s', what='%s' WHERE ".$AND." AND id=%s LIMIT 1",
array($menu, $_POST['sel_act'][$sel], $_POST['sel_what'][$sel], $sel), __FILE__, __LINE__);
break;
case "del": // Delete menu
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_member_menu` WHERE ".$AND." AND id=%s LIMIT 1",
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE ".$AND." AND id=%s LIMIT 1",
array($sel), __FILE__, __LINE__);
break;
case "status": // Change status of menus
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_member_menu` SET visible='%s', locked='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='%s', `locked`='%s' WHERE ".$AND." AND id=%s LIMIT 1",
array($_POST['visible'][$sel], $_POST['locked'][$sel], $sel), __FILE__, __LINE__);
break;
}
}
// Load template
- LOAD_TEMPLATE("admin_settings_saved", false, SAVING_DONE);
+ LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SETTINGS_SAVED'));
} else {
if ((!empty($_GET['act'])) && (!empty($_GET['tid'])) && (!empty($_GET['fid']))) {
// Init
// Get IDs
if (!empty($_GET['w'])) {
// Sub menus selected
- $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_member_menu` WHERE action='%s' AND sort='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE action='%s' AND sort='%s' LIMIT 1",
array(bigintval($_GET['act']), bigintval($_GET['tid'])), __FILE__, __LINE__);
list($tid) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
- $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_member_menu` WHERE action='%s' AND sort='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE action='%s' AND sort='%s' LIMIT 1",
array(bigintval($_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!}_member_menu` WHERE (what='' OR what IS NULL) AND sort='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE (what='' OR `what` IS NULL) AND sort='%s' LIMIT 1",
array(bigintval($_GET['tid'])), __FILE__, __LINE__);
list($tid) = SQL_FETCHROW($result);
- $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_member_menu` WHERE (what='' OR what IS NULL) AND sort='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE (what='' OR `what` IS NULL) AND sort='%s' LIMIT 1",
array(bigintval($_GET['fid'])), __FILE__, __LINE__);
list($fid) = SQL_FETCHROW($result);
}
if ((!empty($tid)) && (!empty($fid))) {
// Sort menu
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_member_menu` SET sort='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_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!}_member_menu` SET sort='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET sort='%s' WHERE ".$AND." AND id=%s LIMIT 1",
array(bigintval($_GET['fid']), bigintval($tid)), __FILE__, __LINE__);
} // END - -fi
}
- if (!empty($SUB))
- {
+ if (!empty($SUB)) {
// Edit sub menus
- $result = SQL_QUERY("SELECT id, action, what, title, sort FROM `{!MYSQL_PREFIX!}_member_menu` WHERE ".$AND." AND what != '' AND what IS NOT NULL ORDER BY sort ASC", __FILE__, __LINE__);
- }
- else
- {
+ $result = SQL_QUERY("SELECT id, action, what, title, sort FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE ".$AND." AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC", __FILE__, __LINE__);
+ } else {
// Edit main menus
- $result = SQL_QUERY("SELECT id, action, what, title, sort FROM `{!MYSQL_PREFIX!}_member_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!}_member_menu` WHERE (what='' OR `what` IS NULL) ORDER BY `sort` ASC", __FILE__, __LINE__);
}
+
$max = SQL_NUMROWS($result);
- if ($max > 0)
- {
+ if ($max > 0) {
// Set sub value
define('__SUB_VALUE', $SUB);
$SW = 2; $cnt = 0; $OUT = "";
- while (list($id, $act, $wht, $title, $sort) = SQL_FETCHROW($result))
- {
+ 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 = "<a href=\"".URL."/modules.php?module=admin&what=memedit&sub=".$SUB."&act=".$act."&w=".$wht."&tid=".($sort+1)."&fid=".$sort."\">".LOWER."</a>";
- }
- elseif ($cnt == $max)
- {
+ $NAVI = "<a href=\"{!URL!}/modules.php?module=admin&what=memedit&sub=".$SUB."&act=".$act."&w=".$wht."&tid=".($sort+1)."&fid=".$sort."\">{!LOWER!}</a>";
+ } elseif ($cnt == $max) {
// Is lowest position
- $NAVI = "<a href=\"".URL."/modules.php?module=admin&what=memedit&sub=".$SUB."&act=".$act."&w=".$wht."&tid=".($sort-1)."&fid=".$sort."\">".HIGHER."</a>";
- }
- elseif ($sort > 0)
- {
+ $NAVI = "<a href=\"{!URL!}/modules.php?module=admin&what=memedit&sub=".$SUB."&act=".$act."&w=".$wht."&tid=".($sort-1)."&fid=".$sort."\">{!HIGHER!}</a>";
+ } elseif ($sort > 0) {
// Anything else between highest and lowest
- $NAVI = "<a href=\"".URL."/modules.php?module=admin&what=memedit&sub=".$SUB."&act=".$act."&w=".$wht."&tid=".($sort-1)."&fid=".$sort."\">".HIGHER."</a>/<a href=\"".URL."/modules.php?module=admin&what=memedit&sub=".$SUB."&act=".$act."&w=".$wht."&tid=".($sort+1)."&fid=".$sort."\">".LOWER."</a>";
+ $NAVI = "<a href=\"{!URL!}/modules.php?module=admin&what=memedit&sub=".$SUB."&act=".$act."&w=".$wht."&tid=".($sort-1)."&fid=".$sort."\">{!HIGHER!}</a>/<a href=\"{!URL!}/modules.php?module=admin&what=memedit&sub=".$SUB."&act=".$act."&w=".$wht."&tid=".($sort+1)."&fid=".$sort."\">{!LOWER!}</a>";
}
+
if (empty($act)) $act = " ";
if (empty($wht)) $wht = " ";
if (empty($title)) $title = " ";
SQL_FREERESULT($result);
define('__MENU_ROWS', $OUT);
LOAD_TEMPLATE("admin_mmenu_overview");
- }
- 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'));
}
}
$SQL = array();
switch ($_GET['do']) {
case "add":
- $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_payments` (time, payment, mail_title, price) VALUES ('".$_POST['t_wait']."','".$_POST['payment']."','".$_POST['title']."','".$_POST['price']."')";
- $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_payments` WHERE time='%s' LIMIT 1",
+ $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_payments` (time, payment, mail_title, price) VALUES ('".$_POST['t_wait']."','".$_POST['payment']."','".$_POST['title']."','".$_POST['price']."')";
+ $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_payments` WHERE time='%s' LIMIT 1",
array($_POST['t_wait']), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Free memory
case "edit":
foreach ($_POST['time'] as $id => $value) {
- $SQLs[] = "UPDATE `{!MYSQL_PREFIX!}_payments` SET time='".$value."', payment='".$_POST['pay'][$id]."', price='".$_POST['price'][$id]."', mail_title='".$_POST['title'][$id]."' WHERE id='".$id."' LIMIT 1";
+ $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_payments` SET time='".$value."', payment='".$_POST['pay'][$id]."', price='".$_POST['price'][$id]."', mail_title='".$_POST['title'][$id]."' WHERE id='".$id."' LIMIT 1";
}
break;
case "del":
foreach ($_POST['id'] as $id => $value) {
- $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_payments` WHERE id='".$id."' LIMIT 1";
+ $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_payments` WHERE id='".$id."' LIMIT 1";
}
break;
}
// Delete entries here
$SW = 2; $OUT = "";
foreach ($_POST['sel'] as $id => $value) {
- $result = SQL_QUERY_ESC("SELECT time, mail_title FROM `{!MYSQL_PREFIX!}_payments` WHERE id=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT time, mail_title FROM `{!_MYSQL_PREFIX!}_payments` WHERE id=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
list($time, $title) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
// Edit entries
$SW = 2; $OUT = "";
foreach ($_POST['sel'] as $id => $value) {
- $result = SQL_QUERY_ESC("SELECT time, payment, mail_title, price FROM `{!MYSQL_PREFIX!}_payments` WHERE id=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT time, payment, mail_title, price FROM `{!_MYSQL_PREFIX!}_payments` WHERE id=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
list($time, $pay, $title, $price) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
LOAD_TEMPLATE("admin_edit_payments");
} else {
// Referal levels
- $result = SQL_QUERY("SELECT id, time, payment, mail_title, price FROM `{!MYSQL_PREFIX!}_payments` ORDER BY time", __FILE__, __LINE__);
+ $result = SQL_QUERY("SELECT id, time, payment, mail_title, price FROM `{!_MYSQL_PREFIX!}_payments` ORDER BY time", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
// Make referal levels editable and deletable
$SW = 2; $OUT = "";
{
case "add":
// Check if banner is already added
- $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_refbanner` WHERE url='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_refbanner` WHERE url='%s' LIMIT 1",
array($_POST['url']), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 0) {
// Add banner
- SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_refbanner` (url, alternate, visible)
+ SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_refbanner` (url, alternate, visible)
VALUES ('%s','%s','%s')",
array($_POST['url'], $_POST['alternate'], $_POST['visible']), __FILE__, __LINE__);
} else {
$id = bigintval($id);
// Update entry
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_refbanner` SET url='%s', alternate='%s', visible='%s' WHERE id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_refbanner` SET url='%s', alternate='%s', `visible`='%s' WHERE id=%s LIMIT 1",
array($_POST['url'][$id], $_POST['alternate'][$id], $_POST['visible'], $id), __FILE__, __LINE__);
}
break;
$SW = ""; $OUT = "";
foreach ($_POST['sel'] as $id => $sel) {
// Load data
- $result = SQL_QUERY_ESC("SELECT url, alternate, visible FROM `{!MYSQL_PREFIX!}_refbanner` WHERE id=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT url, alternate, visible FROM `{!_MYSQL_PREFIX!}_refbanner` WHERE id=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
list($url, $alt, $vis) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
{
// Delete banner
foreach ($_POST['sel'] as $id => $sel) {
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_refbanner` WHERE id=%s LIMIT 1",
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_refbanner` WHERE id=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
}
}
// Referal levels
- $result = SQL_QUERY("SELECT id, url, alternate, visible, counter, clicks FROM `{!MYSQL_PREFIX!}_refbanner` ORDER BY url", __FILE__, __LINE__);
+ $result = SQL_QUERY("SELECT id, url, alternate, visible, counter, clicks FROM `{!_MYSQL_PREFIX!}_refbanner` ORDER BY url", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0)
{
// Make referal banner editable and deletable
$ACTIONS = array();
// First fix all main menus (what="")...
-$result_fix = SQL_QUERY("SELECT id, action FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE (what='' OR what IS NULL) AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__);
+$result_fix = SQL_QUERY("SELECT id, action FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE (what='' OR `what` IS NULL) AND action != 'logout' ORDER BY `sort` ASC", __FILE__, __LINE__);
$cnt = 0; $REP = 0;
-while(list($id, $act) = SQL_FETCHROW($result_fix)) {
+while (list($id, $act) = SQL_FETCHROW($result_fix)) {
// Store act value for later usage in sorting sub menus
$ACTIONS[] = $act;
// Fix weight
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET sort=%s WHERE id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET sort=%s WHERE id=%s LIMIT 1",
array($cnt, $id), __FILE__, __LINE__);
$REP += SQL_AFFECTEDROWS();
}
// Set logout weight to 999
-SQL_QUERY("UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET sort='999' WHERE action='logout' AND (what='' OR what IS NULL) LIMIT 1", __FILE__, __LINE__);
+SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET sort='999' WHERE action='logout' AND (what='' OR `what` IS NULL) LIMIT 1", __FILE__, __LINE__);
// Now sort every each menu
foreach ($ACTIONS as $act) {
- $result_fix = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort",
+ $result_fix = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`",
array($act), __FILE__, __LINE__);
$cnt = 1;
while (list($id) = SQL_FETCHROW($result_fix)) {
// Fix weight
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_admin_menu` SET sort=%s WHERE id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET sort=%s WHERE id=%s LIMIT 1",
array($cnt, $id), __FILE__, __LINE__);
$REP += SQL_AFFECTEDROWS();
// Add description as navigation point
ADD_DESCR("admin", __FILE__);
-$result = SQL_QUERY("SELECT userid FROM `{!MYSQL_PREFIX!}_user_cats` ORDER BY userid", __FILE__, __LINE__);
+$result = SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_cats` ORDER BY userid", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
// Check if found userid is also found in user_data table
$REMOVED = 0; // Nothing is removed for now... ;-)
while (list($uid) = SQL_FETCHROW($result)) {
- $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($uid)), __FILE__, __LINE__);
if (SQL_NUMROWS($result_user) == 0) {
// Ok, we found something to remove
- 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__);
$REMOVED += SQL_AFFECTEDROWS();
} else {
$ACTIONS = array();
// First fix all main menus (what="")...
-$result_fix = SQL_QUERY("SELECT id, action FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE (what='' OR what IS NULL) AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__);
+$result_fix = SQL_QUERY("SELECT id, action FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE (what='' OR `what` IS NULL) AND action != 'logout' ORDER BY `sort` ASC", __FILE__, __LINE__);
$cnt = 0; $REP = 0;
-while(list($id, $act) = SQL_FETCHROW($result_fix))
+while (list($id, $act) = SQL_FETCHROW($result_fix))
{
// Store act value for later usage in sorting sub menus
$ACTIONS[] = $act;
// Fix weight
- $result_sort = SQL_QUERY("UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET sort='".$cnt."' WHERE id='".$id."' LIMIT 1", __FILE__, __LINE__);
+ $result_sort = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET sort='".$cnt."' WHERE id='".$id."' LIMIT 1", __FILE__, __LINE__);
$REP += SQL_AFFECTEDROWS();
// Count one up
$cnt++;
}
// Set logout weight to 999
-$result_sort = SQL_QUERY("UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET sort='999' WHERE action='logout' AND (what='' OR what IS NULL) LIMIT 1", __FILE__, __LINE__);
+$result_sort = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET sort='999' WHERE action='logout' AND (what='' OR `what` IS NULL) LIMIT 1", __FILE__, __LINE__);
// Now sort every each menu
foreach ($ACTIONS as $act) {
- $result_fix = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_guest_menu` WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort",
+ $result_fix = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE action='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`",
array($act), __FILE__, __LINE__);
$cnt = 1;
while (list($id) = SQL_FETCHROW($result_fix)) {
// Fix weight
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_guest_menu` SET sort=%s WHERE id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET sort=%s WHERE id=%s LIMIT 1",
array($cnt, $id), __FILE__, __LINE__);
$REP += SQL_AFFECTEDROWS();
$ACTIONS = array();
// First fix all main menus (what="")...
-$result_fix = SQL_QUERY("SELECT id, action FROM `{!MYSQL_PREFIX!}_member_menu` WHERE (what='' OR what IS NULL) AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__);
+$result_fix = SQL_QUERY("SELECT id, action FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE (what='' OR `what` IS NULL) AND action != 'logout' ORDER BY `sort` ASC", __FILE__, __LINE__);
$cnt = 0; $REP = 0;
-while(list($id, $act) = SQL_FETCHROW($result_fix)) {
+while (list($id, $act) = SQL_FETCHROW($result_fix)) {
// Store action value for later usage in sorting sub menus
$ACTIONS[] = $act;
// Fix weight
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_member_menu` SET sort=%s WHERE id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET sort=%s WHERE id=%s LIMIT 1",
array($cnt, $id), __FILE__, __LINE__);
$REP += SQL_AFFECTEDROWS();
$cnt++;
}
// Set logout weight to 999
-SQL_QUERY("UPDATE `{!MYSQL_PREFIX!}_member_menu` SET sort='999' WHERE action='logout' AND (what='' OR what IS NULL) LIMIT 1", __FILE__, __LINE__);
+SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET sort='999' WHERE action='logout' AND (what='' OR `what` IS NULL) LIMIT 1", __FILE__, __LINE__);
// Now sort every each menu
foreach ($ACTIONS as $act) {
- $result_fix = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_member_menu` WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort",
+ $result_fix = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE action='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`",
array($act), __FILE__, __LINE__);
$cnt = 1;
while (list($id) = SQL_FETCHROW($result_fix)) {
// Fix weight
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_member_menu` SET sort=%s WHERE id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET sort=%s WHERE id=%s LIMIT 1",
array($cnt, $id), __FILE__, __LINE__);
$REP += SQL_AFFECTEDROWS();
if (isset($_POST['ok'])) {
$result = SQL_QUERY("SELECT userid, email
-FROM `{!MYSQL_PREFIX!}_user_data`
+FROM `{!_MYSQL_PREFIX!}_user_data`
WHERE status='CONFIRMED' AND nl_receive='Y'
ORDER BY userid ASC", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
SQL_FREERESULT($result);
// Output message
- LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NL_SEND_DONE);
+ LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_NL_SEND_DONE'));
}
} else {
// Copy data into constants for the template and load it
}
// Load module's detail statistic
- $result = SQL_QUERY_ESC("SELECT action, title, counter FROM `{!MYSQL_PREFIX!}_%s_menu` WHERE what != '' AND what IS NOT NULL ORDER BY counter DESC",
+ $result = SQL_QUERY_ESC("SELECT action, title, counter FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE `what` != '' AND `what` IS NOT NULL ORDER BY counter DESC",
array($mod), __FILE__, __LINE__);
$SW = 2; $OUT = "";
- while(list($act, $title, $clicks) = SQL_FETCHROW($result))
+ while (list($act, $title, $clicks) = SQL_FETCHROW($result))
{
// Prepare array for the template
$content = array(
// Load final template
LOAD_TEMPLATE("admin_mods_stats2");
-}
- else
-{
+} else {
// Load module statics
- $result = SQL_QUERY("SELECT module, title, clicks FROM `{!MYSQL_PREFIX!}_mod_reg` ORDER BY clicks DESC, module", __FILE__, __LINE__);
+ $result = SQL_QUERY("SELECT module, title, clicks FROM `{!_MYSQL_PREFIX!}_mod_reg` ORDER BY clicks DESC, module", __FILE__, __LINE__);
$SW = 2; $OUT = "";
- while(list($mod, $title, $clicks) = SQL_FETCHROW($result))
- {
+ while (list($mod, $title, $clicks) = SQL_FETCHROW($result)) {
if (empty($title)) $title = "---";
if (($mod == "index") || ($mod == "login"))
{
// Add link to detail statistics
- $mod = "<strong><a href=\"".URL."/modules.php?module=admin&what=stats_mods&mod=".$mod."\">".$mod."</a></strong>";
+ $mod = "<strong><a href=\"{!URL!}/modules.php?module=admin&what=stats_mods&mod=".$mod."\">".$mod."</a></strong>";
}
// Prepare array for the template
$content = array(
// Fix a notice
if (!isset($_GET['u_id'])) $_GET['u_id'] = "";
-if ($_GET['u_id'] == "all")
-{
+if ($_GET['u_id'] == "all") {
// Add points to all accounts
define('__POINTS_VALUE', $_POST['points']);
- if ((isset($_POST['ok'])) && ($_POST['points'] > 0))
- {
- $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))
- {
+ if ((isset($_POST['ok'])) && ($_POST['points'] > 0)) {
+ $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)) {
// 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",
- array(bigintval($uid)), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) == 1)
- {
+ $result = SQL_QUERY_ESC("SELECT surname, family, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND status='CONFIRMED' LIMIT 1",
+ array(bigintval($uid)), __FILE__, __LINE__);
+
+ // Entry found?
+ if (SQL_NUMROWS($result) == 1) {
// Selected user does exist
list($sname, $fname, $email) = SQL_FETCHROW($result);
+
+ // Free result
SQL_FREERESULT($result);
- if ((isset($_POST['ok'])) && (!empty($_POST['points'])))
- {
+ if ((isset($_POST['ok'])) && (!empty($_POST['points']))) {
// Ok, add points to used points and send an email to him...
SUB_POINTS("admin_all", $uid, $_POST['points']);
// Load message and send it away
$msg = LOAD_EMAIL_TEMPLATE("sub-points", $content, bigintval($uid));
- SEND_EMAIL(bigintval($uid), ADMIN_SUB_SUBJ, $msg);
+ SEND_EMAIL(bigintval($uid), getMessage('ADMIN_SUB_SUBJ'), $msg);
}
}
}
SQL_FREERESULT($result_main);
// Output message
- LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_ALL_POINTS_SUBTRACTED);
- }
- else
- {
+ LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_ALL_POINTS_SUBTRACTED'));
+ } else {
// Display form add points
LOAD_TEMPLATE("admin_sub_points_all");
}
-}
- elseif (!empty($_GET['u_id']))
-{
+} 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",
- array(bigintval($_GET['u_id'])),__FILE__, __LINE__);
+ $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
list($sname, $fname, $email) = SQL_FETCHROW($result);
// Load email and send it away
$msg = LOAD_EMAIL_TEMPLATE("sub-points", $content, bigintval($_GET['u_id']));
- SEND_EMAIL(bigintval($_GET['u_id']), ADMIN_SUB_SUBJ, $msg);
+ SEND_EMAIL(bigintval($_GET['u_id']), getMessage('ADMIN_SUB_SUBJ'), $msg);
// Output message
- LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_POINTS_SUBTRACTED);
+ LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_POINTS_SUBTRACTED'));
} else {
// Opps, missing form here
define('__USER_VALUE', "<a href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".$sname." ".$fname."</a>");
if (isset($_GET['url_id'])) {
// Generate general statistics
$result = SQL_QUERY_ESC("SELECT `userid`, `count` AS `total_visits`, UNIX_TIMESTAMP(`last_online`) AS `last_online`
-FROM `{!MYSQL_PREFIX!}_surfbar_stats`
+FROM `{!_MYSQL_PREFIX!}_surfbar_stats`
WHERE `url_id`=%s
ORDER BY `userid` ASC",
array(bigintval($_GET['url_id'])), __FILE__, __LINE__);
LOAD_TEMPLATE("admin_surfbar_url_stats", false, $content);
} else {
// No statistics so far
- LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SURFBAR_NO_URL_STATS);
+ LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_SURFBAR_NO_URL_STATS'));
}
} else {
// Generate general statistics
$result = SQL_QUERY("SELECT `userid`, COUNT(`url_id`) AS `visited_urls`, SUM(`count`) AS `total_visits`
-FROM `{!MYSQL_PREFIX!}_surfbar_stats`
+FROM `{!_MYSQL_PREFIX!}_surfbar_stats`
GROUP BY `userid`
ORDER BY `userid` ASC", __FILE__, __LINE__);
LOAD_TEMPLATE("admin_surfbar_stats", false, $content);
} else {
// No statistics so far
- LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_SURFBAR_NO_STATS);
+ LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_SURFBAR_NO_STATS'));
}
}
}
} else {
// No theme where found
- LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_THEME_NOTHING_FOUND);
+ LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_THEME_NOTHING_FOUND'));
}
//
if (isset($_POST['status'])) {
// Change status
if ($_POST['active'][$id] == "Y") {
- $SQL = "UPDATE `{!MYSQL_PREFIX!}_themes` SET theme_active='N' WHERE id='".$id."' LIMIT 1";
+ $SQL = "UPDATE `{!_MYSQL_PREFIX!}_themes` SET theme_active='N' WHERE id='".$id."' LIMIT 1";
} else {
- $SQL = "UPDATE `{!MYSQL_PREFIX!}_themes` SET theme_active='Y' WHERE id='".$id."' LIMIT 1";
+ $SQL = "UPDATE `{!_MYSQL_PREFIX!}_themes` SET theme_active='Y' WHERE id='".$id."' LIMIT 1";
}
$OUT = ADMIN_THEMES_UPDATED;
} elseif (isset($_POST['del'])) {
// Delete themes
- $SQL = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_themes` WHERE id='".$id."' LIMIT 1";
+ $SQL = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_themes` WHERE id='".$id."' LIMIT 1";
$OUT = ADMIN_THEMES_DELETED;
}
// Generate output lines for the template
$OUT = ""; $SW = 2;
-$result = SQL_QUERY("SELECT id, theme_path, theme_active, theme_ver, theme_name FROM `{!MYSQL_PREFIX!}_themes` ORDER BY theme_path", __FILE__, __LINE__);
+$result = SQL_QUERY("SELECT id, theme_path, theme_active, theme_ver, theme_name FROM `{!_MYSQL_PREFIX!}_themes` ORDER BY theme_path", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
- while(list($id, $unix, $active, $ver, $name) = SQL_FETCHROW($result)) {
+ while (list($id, $unix, $active, $ver, $name) = SQL_FETCHROW($result)) {
// Load theme in test mode
require(PATH."theme/".$unix."/theme.php");
// Is the loaded theme name != current theme name?
$LINK = $unix;
- if ($unix != GET_CURR_THEME()) $LINK = "<a href=\"".URL."/modules.php?module=admin&what=theme_edit&default_theme=".$unix."\" title=\"".ADMIN_SET_AS_NEW_THEME."\">".$unix."</a>";
+ if ($unix != GET_CURR_THEME()) $LINK = "<a href=\"{!URL!}/modules.php?module=admin&what=theme_edit&default_theme=".$unix."\" title=\"".ADMIN_SET_AS_NEW_THEME."\">".$unix."</a>";
// Prepare data for the row template
$content = array(
// No themes found???
$OUT .= "<tr>
<td colspan=\"7\" class=\"bottom2\" height=\"60\">
- ".LOAD_TEMPLATE("admin_settings_saved", true, ADMIN_NO_THEMES_FOUND)."
+ ".LOAD_TEMPLATE("admin_settings_saved", true, getMessage('ADMIN_NO_THEMES_FOUND'))."
</td>
</tr>\n";
}
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__);
// Check if current theme is already imported or not
if (THEME_CHECK_EXIST($unix)) {
// Already installed
- $FOUND = "<div class=\"admin_note\">".ADMIN_THEME_ALREADY_INSTALLED."</div>";
+ $FOUND = "<div class=\"admin_note\">{!ADMIN_THEME_ALREADY_INSTALLED!}</div>";
} else {
// Theme not installed
- $FOUND = "<form action=\"".URL."/modules.php?module=admin&what=theme_import\" method=\"POST\">
+ $FOUND = "<form action=\"{!URL!}/modules.php?module=admin&what=theme_import\" method=\"POST\">
<input type=\"submit\" name=\"ok\" class=\"admin_submit\" value=\"{!ADMIN_INSTALL_THEME!}\" />
<input type=\"hidden\" name=\"theme\" value=\"".$unix."\" />
</form>";
// No themes found???
$OUT .= "<tr>
<td colspan=\"6\" class=\"bottom2\" height=\"80\">
- ".LOAD_TEMPLATE("admin_settings_saved", true, ADMIN_NO_THEMES_FOUND)."
+ ".LOAD_TEMPLATE("admin_settings_saved", true, getMessage('ADMIN_NO_THEMES_FOUND'))."
</td>
</tr>\n";
} // END - if
// 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__);
// 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",
// 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
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
$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
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
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
$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
} // 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 = "";
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'));
}
//
// 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;
// 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;
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__);
// 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);
}
} 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
// 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,
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
// 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) {
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
// 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 <body> plus trailing </html> tag?
// 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?
// 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);
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));
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
} // 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
// 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",
$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",
// 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?
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'])))));
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);
// 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) {
// 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__);
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;
}
// Redirect...
-LOAD_URL (URL."/modules.php?module=admin&action=login");
+LOAD_URL("modules.php?module=admin&action=login");
//
?>
$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...
// 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
// 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");
}
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
{
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");
}
}
// 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);
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;
// 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);
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);
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;
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);
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__);
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);
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);
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__);
}
else
{
- define('__RALLYE_EXTRAS', "<a href=\"".URL."/modules.php?module=index&what=register\">".RALLYE_REGISTER_NOW."</a>");
+ define('__RALLYE_EXTRAS', "<a href=\"{!URL!}/modules.php?module=index&what=register\">".RALLYE_REGISTER_NOW."</a>");
}
// Set admin line (currently set to impressum, later to contact form)
- define('__RALLYE_ADMIN', "<a href=\"".URL."/modules.php?module=index&what=impressum&admin=".$aid."\">".$login."</a>");
+ define('__RALLYE_ADMIN', "<a href=\"{!URL!}/modules.php?module=index&what=impressum&admin=".$aid."\">".$login."</a>");
// Set title
define('__RALLYE_TITLE', COMPILE_CODE($title));
$_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?
// 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! ;-)
// 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,
} // 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
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
// 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);
}
if ($SHORT_PASS) {
- OUTPUT_HTML("<div class=\"register_failed\">".SHORT_PASS.": ".getConfig('pass_len')."</div>");
+ OUTPUT_HTML("<div class=\"register_failed\">{!SHORT_PASS!}: ".getConfig('pass_len')."</div>");
} // END - if
if ($IP_TIMEOUT) {
- OUTPUT_HTML("<div class=\"register_failed\">".REMOTE_ADDR_TIMEOUT."</div>");
+ OUTPUT_HTML("<div class=\"register_failed\">{!REMOTE_ADDR_TIMEOUT!}</div>");
} // END - if
if ((!empty($cats)) && ($cats < getConfig('least_cats'))) {
- OUTPUT_HTML("<div class=\"register_failed\">".CATS_LEAST.": ".getConfig('least_cats')."</div>");
+ OUTPUT_HTML("<div class=\"register_failed\">{!CATS_LEAST!}: ".getConfig('least_cats')."</div>");
} // END - if
// Generate birthday selection
// 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);
} // 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;
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) {
// 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__);
}
} 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__);
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__);
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?
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__);
}
} 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) {
// 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);
{
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)
{
} 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 = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"300\" class=\"left2 right2 top2\">\n";
$SW = 2;
- while(list($id, $name, $rate, $curr, $min) = SQL_FETCHROW($result))
+ while (list($id, $name, $rate, $curr, $min) = SQL_FETCHROW($result))
{
$OUT .= "<tr>
<td class=\"bottom2 switch_sw".$SW."\" height=\"50\" style=\"padding-left: 2px; padding-right: 2px\">
{
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;
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();
// 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__));
}
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("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"guest_table dashed\" width=\"310\">
<tr>
- <td align=\"center\" class=\"guest_stats_title bottom2\" colspan=\"2\"><strong>".GUEST_TOPTEN_STATS."</strong></td>
+ <td align=\"center\" class=\"guest_stats_title bottom2\" colspan=\"2\"><strong>{!GUEST_TOPTEN_STATS!}</strong></td>
</tr>");
}
- if (SQL_NUMROWS($guest_t10) > 0)
- {
+ if (SQL_NUMROWS($guest_t10) > 0) {
// Guest clicks
OUTPUT_HTML("<tr>
<td align=\"center\" class=\"guest_title2 bottom2\" colspan=\"2\">".GUEST_TOP_GUEST_STATS."</td>
</tr>");
$SW = 2;
- while (list($clicks, $title) = SQL_FETCHROW($guest_t10))
- {
+ while (list($clicks, $title) = SQL_FETCHROW($guest_t10)) {
OUTPUT_HTML("<tr>
<td class=\"switch_sw".$SW." bottom2 right2\" align=\"right\" width=\"250\">".$title." </td>
<td class=\"switch_sw".$SW." bottom2\" width=\"50\"> ".$clicks."</td>
$SW = 3 - $SW;
}
}
- if (SQL_NUMROWS($guest_t10) > 0)
- {
+
+ if (SQL_NUMROWS($guest_t10) > 0) {
// Guest clicks
OUTPUT_HTML("<tr>
<td align=\"center\" class=\"guest_title2 bottom2\" colspan=\"2\">".GUEST_TOP_MEMBER_STATS."</td>
</tr>");
$SW = 2;
- while (list($clicks, $title) = SQL_FETCHROW($mem_t10))
- {
+ while (list($clicks, $title) = SQL_FETCHROW($mem_t10)) {
OUTPUT_HTML("<tr>
<td class=\"switch_sw".$SW." bottom2 right2\" align=\"right\" width=\"250\">".$title." </td>
<td class=\"switch_sw".$SW." bottom2\" width=\"50\"> ".$clicks."</td>
$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("<tr>
- <td align=\"center\" class=\"guest_stats_footer\" colspan=\"2\"><a href=\"".URL."/modules.php?module=index&what=stats&mode=".$lmode."\">".$ltitle."</a></td>
+ <td align=\"center\" class=\"guest_stats_footer\" colspan=\"2\"><a href=\"{!URL!}/modules.php?module=index&what=stats&mode=".$lmode."\">".$ltitle."</a></td>
</tr>
</table>");
}
SELECT
userid, total_logins, last_online
FROM
- "._MYSQL_PREFIX."_user_data
+ {!_MYSQL_PREFIX!}_user_data
WHERE
total_logins > 0 AND
status='CONFIRMED'
(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
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
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);
// 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) {
// 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);
}
// 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__);
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,
}
// 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",
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)
{
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
{
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))
}
}
// Categories saved...
- LOAD_TEMPLATE("admin_settings_saved", true, MEMBER_CATS_SAVED);
+ LOAD_TEMPLATE("admin_settings_saved", true, getMessage('MEMBER_CATS_SAVED'));
}
else
{
$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
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);
ADD_DESCR("member", __FILE__);
// Simply redirect...
-LOAD_URL (URL."/modules.php?module=index");
+LOAD_URL("modules.php?module=index");
//
?>
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))
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__);
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
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);
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)
{
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
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);
{
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)
{
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");
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);
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);
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__);
}
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);
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',
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',
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;
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);
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
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 {
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'] = "";
} // 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__);
//
// 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__);
// 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) {
} // 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",
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
$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
$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'],
), __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'],
// 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',
), __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',
// 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'],
$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...
$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;
$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()
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);
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) {
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
$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) {
}
} else {
// No mail types defined
- LOAD_TEMPLATE("admin_settings_saved", false, "<span class=\"member_failed\">".MEMBER_NO_PAYMENTS."</span>");
+ LOAD_TEMPLATE("admin_settings_saved", false, "<span class=\"member_failed\">{!MEMBER_NO_PAYMENTS!}</span>");
}
} else {
// No points left!
- LOAD_TEMPLATE("admin_settings_saved", false, "<span class=\"member_failed\">".MEMBER_NO_POINTS."</span>");
+ LOAD_TEMPLATE("admin_settings_saved", false, "<span class=\"member_failed\">{!MEMBER_NO_POINTS!}</span>");
}
} else {
// No cateogries are defined yet
- LOAD_TEMPLATE("admin_settings_saved", false, "<span class=\"member_failed\">".MEMBER_NO_CATS."</span>");
+ LOAD_TEMPLATE("admin_settings_saved", false, "<span class=\"member_failed\">{!MEMBER_NO_CATS!}</span>");
}
} 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);
// 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
{
// 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)
// 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",
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)
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'],
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'],
}
// 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,
// 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
$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);
}
// 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);
// 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);
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);
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
$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?
$_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
// 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?
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!
$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__);
}
else
{
- define('__RALLYE_EXTRAS', "<a href=\"".URL."/modules.php?module=login&what=reflinks\">".RALLYE_GET_REFLINK."</a>");
+ define('__RALLYE_EXTRAS', "<a href=\"{!URL!}/modules.php?module=login&what=reflinks\">".RALLYE_GET_REFLINK."</a>");
}
// Set admin line (currently set to impressum, later to contact form)
- define('__RALLYE_ADMIN', "<a href=\"".URL."/modules.php?module=index&what=impressum&admin=".$aid."\">".$login."</a>");
+ define('__RALLYE_ADMIN', "<a href=\"{!URL!}/modules.php?module=index&what=impressum&admin=".$aid."\">".$login."</a>");
// Set title
define('__RALLYE_TITLE', COMPILE_CODE($title));
// 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
// 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 ;-)
// 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__);
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
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("<div class=\"tiny\">".YOUR_PERSONAL_REFLINK.":<br />
-<strong><a href=\"".URL."/ref.php?refid=".$GLOBALS['userid']."\" target=\"_blank\">".URL."/ref.php?ref=".$GLOBALS['userid']."</a></strong><br />
+<strong><a href=\"{!URL!}/ref.php?refid=".$GLOBALS['userid']."\" target=\"_blank\">{!URL!}/ref.php?ref=".$GLOBALS['userid']."</a></strong><br />
<br />");
if (EXT_IS_ACTIVE("nickname")) {
if (!empty($nick)) {
// Display nickname link
OUTPUT_HTML(NICKNAME_YOUR_REFLINK.":<br />
-<strong><a href=\"".URL."/ref.php?ref=".$nick."\" target=\"_blank\">".URL."/ref.php?ref=".$nick."</a></strong><br />
+<strong><a href=\"{!URL!}/ref.php?ref=".$nick."\" target=\"_blank\">{!URL!}/ref.php?ref=".$nick."</a></strong><br />
<br />");
} else {
// Display link to nickname form
OUTPUT_HTML("<div class=\"guest_note\">".NO_NICKNAME_SET."</strong><br />
-<a class=\"tiny\" href=\"".URL."/modules.php?module=login&what=nickname\">".PLEASE_CLICK_NICKNAME_FORM."</a>");
+<a class=\"tiny\" href=\"{!URL!}/modules.php?module=login&what=nickname\">".PLEASE_CLICK_NICKNAME_FORM."</a>");
}
}
// Clicks on your reflink
OUTPUT_HTML(YOUR_REFCLICKS.": <strong>".$c."</strong> ".CLICKS."</div><br /><br />");
-$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
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
// 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__);
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
// 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__);
$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
// 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__);
$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
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
// 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']))) {
// 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
$content['url'] = DEREFERER($content['url']);
if ($content['views_total'] > 0) {
// Include link to stats
- $content['views_total'] = "[<a href=\"".URL."/modules.php?module=login&what=surfbar_list\">".TRANSLATE_COMMA($content['views_total'])."</a>]";
+ $content['views_total'] = "[<a href=\"{!URL!}/modules.php?module=login&what=surfbar_list\">".TRANSLATE_COMMA($content['views_total'])."</a>]";
} // END - if
$content['registered'] = MAKE_DATETIME($content['registered'], "2");
$content['last_locked'] = MAKE_DATETIME($content['last_locked'], "2");
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'));
}
//
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
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
// No themes found???
$OUT = "<tr>
<td colspan=\"5\" class=\"bottom2\" height=\"80\">
- ".LOAD_TEMPLATE("admin_settings_saved", true, MEMBER_NO_THEMES_FOUND)."
+ ".LOAD_TEMPLATE("admin_settings_saved", true, getMessage('MEMBER_NO_THEMES_FOUND'))."
</td>
</tr>\n";
}
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);
}
// 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);
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__);
SEND_ADMIN_NOTIFICATION($ADMIN_SUBJ, "admin_transfer_points");
// Transfer is completed
- LOAD_TEMPLATE("admin_settings_saved", false, TRANSFER_COMPLETED."<br /><a href=\"".URL."/modules.php?module=login&what=transfer\">".TRANSFER_CONTINUE_OVERVIEW."</a>");
+ LOAD_TEMPLATE("admin_settings_saved", false, TRANSFER_COMPLETED."<br /><a href=\"{!URL!}/modules.php?module=login&what=transfer\">".TRANSFER_CONTINUE_OVERVIEW."</a>");
} elseif (!$valid_code) {
// Invalid Touring code!
LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"member_note\">".TRANSFER_INVALID_CODE."</div>");
// 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__);
}
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);
// 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',
) 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
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 .= "<tr>
<td class=\"transfer_row1 switch_sw".$SW." bottom2 right2\">
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);
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', "<a href=\"".URL."/modules.php?module=login&what=transfer&mode=list_in\">".$dmy."</a>");
+ define('__TRANSFER_IN_LINK', "<a href=\"{!URL!}/modules.php?module=login&what=transfer&mode=list_in\">".$dmy."</a>");
} 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', "<a href=\"".URL."/modules.php?module=login&what=transfer&mode=list_out\">".$dmy."</a>");
+ define('__TRANSFER_OUT_LINK', "<a href=\"{!URL!}/modules.php?module=login&what=transfer&mode=list_out\">".$dmy."</a>");
} else {
define('__TRANSFER_OUT_LINK', $dmy);
}
// Total transactions
if ($total > 0) {
- define('__TRANSFER_ALL_LINK', "<a href=\"".URL."/modules.php?module=login&what=transfer&mode=list_all\">".$total."</a>");
+ define('__TRANSFER_ALL_LINK', "<a href=\"{!URL!}/modules.php?module=login&what=transfer&mode=list_all\">".$total."</a>");
} 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
case "Y":
define('__TRANSFER_ALLOW_Y', " checked=\"checked\"");
define('__TRANSFER_ALLOW_N', "");
- define('__TRANSFER_NEW_LINK', "<a href=\"".URL."/modules.php?module=login&what=transfer&mode=new\">".TRANSFER_NOW_LINK."</a>");
+ define('__TRANSFER_NEW_LINK', "<a href=\"{!URL!}/modules.php?module=login&what=transfer&mode=new\">".TRANSFER_NOW_LINK."</a>");
break;
case "N":
// 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__);
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__);
} 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__);
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__);
}
{
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",
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;
}
} 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'));
}
//
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"))) {
$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?
$_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
// Is the payout mode active?
if (getConfig('wernis_payout_active') == "Y") {
// Add link
- $content['payout_link'] = "<a class=\"menu_blur\" style=\"height: 40px\" href=\"".URL."/modules.php?module=login&what=wernis&mode=payout\"><div style=\"padding-top: 10px\">".MEMBER_WERNIS_MODE_PAYOUT."</div></a>";
+ $content['payout_link'] = "<a class=\"menu_blur\" style=\"height: 40px\" href=\"{!URL!}/modules.php?module=login&what=wernis&mode=payout\"><div style=\"padding-top: 10px\">".MEMBER_WERNIS_MODE_PAYOUT."</div></a>";
} // END - if
// Is the withdraw mode active?
if (getConfig('wernis_withdraw_active') == "Y") {
// Add link
- $content['withdraw_link'] = "<a class=\"menu_blur\" style=\"height: 40px\" href=\"".URL."/modules.php?module=login&what=wernis&mode=withdraw\"><div style=\"padding-top: 10px\">".MEMBER_WERNIS_MODE_WITHDRAW."</div></a>";
+ $content['withdraw_link'] = "<a class=\"menu_blur\" style=\"height: 40px\" href=\"{!URL!}/modules.php?module=login&what=wernis&mode=withdraw\"><div style=\"padding-top: 10px\">".MEMBER_WERNIS_MODE_WITHDRAW."</div></a>";
} // END - if
// Mode chooser! ;-)
// 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?
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?
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!
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!
}
// 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);
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) {
// 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) {
// 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);
// 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",
} // 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
// 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",
} // 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
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
// 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 "<strong>".LANG_WARNING.":</strong> ";
+ OUTPUT_HTML("<strong>{!LANG_WARNING!}:</strong> ");
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 "<div>".LANG_WARNING.":</div> ".WARN_NULL_PASSWORD;
+ OUTPUT_HTML("<div>{!LANG_WARNING!}:</div> {!WARN_NULL_PASSWORD!}");
}
// Set dummy $_CONFIG array
RUN_FILTER('init');
// Set default 'what' value
- //* DEBUG: */ echo "-".$GLOBALS['module']."/".$GLOBALS['what']."-<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("-".$GLOBALS['module']."/".$GLOBALS['what']."-<br />");
if ((empty($GLOBALS['what'])) && (empty($GLOBALS['action'])) && ($CSS != 1) && ($CSS != -1)) {
if ($GLOBALS['module'] == "admin") {
// Set 'action' value to 'login' in admin menu
}
} 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 {
///////////////////////////////////////////////////
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
//
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);
}
}
} 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);
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__);
}
$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";
case "member":
$modCheck = $GLOBALS['module'];
if (!IS_ADMIN()) {
- $AND = " AND visible='Y' AND locked='N'";
+ $AND = " AND `visible`='Y' AND `locked`='N'";
}
break;
}
}
if ((!isset($NAV_DEPTH)) && (!$return)) {
$NAV_DEPTH = 0;
- $prefix = "<div class=\"you_are_here\">".YOU_ARE_HERE." <strong><a class=\"you_are_here\" href=\"".URL."/modules.php?module=".$GLOBALS['module'].$LINK_ADD."\">Home</a></strong>";
+ $prefix = "<div class=\"you_are_here\">{!YOU_ARE_HERE!} <strong><a class=\"you_are_here\" href=\"{!URL!}/modules.php?module=".$GLOBALS['module'].$LINK_ADD."\">Home</a></strong>";
} else {
if (!$return) $NAV_DEPTH++;
$prefix = "";
} // 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?
return $ret;
} elseif (((GET_EXT_VERSION("sql_patches") >= "0.2.3") && (getConfig('youre_here') == "Y")) || ((IS_ADMIN()) && ($modCheck == "admin"))) {
// Output HTML code
- $OUT = $prefix."<strong><a class=\"you_are_here\" href=\"".URL."/modules.php?module=".$modCheck."&".$type."=".$search.$LINK_ADD."\">".$ret."</a></strong>\n";
+ $OUT = $prefix."<strong><a class=\"you_are_here\" href=\"{!URL!}/modules.php?module=".$modCheck."&".$type."=".$search.$LINK_ADD."\">".$ret."</a></strong>\n";
// Can we close the you-are-here navigation?
//* DEBUG: */ echo __LINE__."*".$type."/".$GLOBALS['what']."*<br />\n";
$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']."*<br />\n";
if (SQL_NUMROWS($result_main) > 0) {
OUTPUT_HTML("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"".$MODE."_menu\">");
// 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) {
}
// Navigation link
- $content .= "<a name=\"menu\" class=\"menu_blur\" href=\"".URL."/modules.php?module=".$GLOBALS['module']."&what=".$sub_what.ADD_URL_DATA("")."\" target=\"_self\">";
+ $content .= "<a name=\"menu\" class=\"menu_blur\" href=\"{!URL!}/modules.php?module=".$GLOBALS['module']."&what=".$sub_what.ADD_URL_DATA("")."\" target=\"_self\">";
} else {
$content .= "<em>";
}
$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?
{
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 = "";
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 = "";
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;
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);
// 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
{
$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."*<br />\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);
}
$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?
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
$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
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
}
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... ;-)
$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... :-)
$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... :-)
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)
{
// 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";
}
if (($onlyRows) || ($lookFor == "userid")) {
// Count rows
//* DEBUG: */ echo "COUNT!<br />\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!<br />\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__);
}
}
} 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?
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__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},numRows=".SQL_NUMROWS($result_user).",points={$points}<br />\n";
} // 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__."(<font color=\"#0000aa\">".__LINE__."</font>):data={$data},ref_points={$ref_points},uid={$uid},depth={$GLOBALS['ref_level']},mode={$add_mode} - UPDATE! (".SQL_AFFECTEDROWS().")<br />\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__."(<font color=\"#0000aa\">".__LINE__."</font>):data={$data},ref_points={$ref_points},uid={$uid},depth={$GLOBALS['ref_level']},mode={$add_mode} - INSERTED! (".SQL_AFFECTEDROWS().")<br />\n";
} // END - if
// 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?
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$cacheArray['ref_level'][$uid]}<br />\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__."(<font color=\"#0000aa\">".__LINE__."</font>):updated=".SQL_AFFECTEDROWS()."<br />\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__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid}<br />\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
// 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);
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);
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
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
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
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
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
{
$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) {
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") {
}
// 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__);
}
//
}
//
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__);
}
}
$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
} // 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
// 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
// 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();
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
// Returns HTML code with an "<option> list" of all categories
function ADD_CATEGORY_OPTIONS ($mode) {
// Prepare WHERE statement
- $whereStatement = " WHERE visible='Y'";
+ $whereStatement = " WHERE `visible`='Y'";
if (IS_ADMIN()) $whereStatement = "";
// Initialize array...
);
// Get categories
- $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__);
if (SQL_NUMROWS($result) > 0) {
// ... and begin loading stuff
while (list($id, $cat) = SQL_FETCHROW($result)) {
$CATS['name'][] = $cat;
// Check which users are in this category
- $result_uids = SQL_QUERY_ESC("SELECT userid FROM `{!MYSQL_PREFIX!}_user_cats` WHERE cat_id=%s",
+ $result_uids = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE cat_id=%s",
array(bigintval($id)), __FILE__, __LINE__);
// Start adding all
$uid_cnt = 0;
while (list($ucat) = SQL_FETCHROW($result_uids)) {
- $result_ver = SQL_QUERY_ESC("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data`
+ $result_ver = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data`
WHERE userid=%s AND status='CONFIRMED' AND receive_mails > 0".PREPARE_SQL_HTML_HOLIDAY($mode)." LIMIT 1",
array(bigintval($ucat)), __FILE__, __LINE__);
$uid_cnt += SQL_NUMROWS($result_ver);
if ($mode == "html") $HTML = "Y";
// Add HTML mail
- SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_bonus`
+ SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_bonus`
(subject, text, receivers, points, time, data_type, timestamp, url, cat_id, target_send, mails_sent, html_msg)
VALUES ('%s','%s','%s','%s','%s','NEW', UNIX_TIMESTAMP(),'%s','%s','%s','%s','%s')",
array(
), __FILE__, __LINE__);
} else {
// Add regular mail
- SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_bonus`
+ SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_bonus`
(subject, text, receivers, points, time, data_type, timestamp, url, cat_id, target_send, mails_sent)
VALUES ('%s','%s','%s','%s','%s','NEW', UNIX_TIMESTAMP(),'%s','%s','%s','%s')",
array(
// Category given?
if ($cat > 0) {
// Select category
- $CAT_TABS = "LEFT JOIN `{!MYSQL_PREFIX!}_user_cats` AS c ON d.userid=c.userid";
+ $CAT_TABS = "LEFT JOIN `{!_MYSQL_PREFIX!}_user_cats` AS c ON d.userid=c.userid";
$CAT_WHERE = " AND c.cat_id=%s";
} // END - if
if ((EXT_IS_ACTIVE("html_mail")) && ($mode == "html")) {
// Only include HTML receivers
- $result = SQL_QUERY_ESC("SELECT d.userid FROM `{!MYSQL_PREFIX!}_user_data` AS d ".$CAT_TABS." WHERE d.status='CONFIRMED' AND d.html='Y'".$CAT_WHERE." ORDER BY d.%s %s LIMIT %s",
+ $result = SQL_QUERY_ESC("SELECT d.userid FROM `{!_MYSQL_PREFIX!}_user_data` AS d ".$CAT_TABS." WHERE d.status='CONFIRMED' AND d.html='Y'".$CAT_WHERE." ORDER BY d.%s %s LIMIT %s",
array($cat, getConfig('order_select'), getConfig('order_mode'), $receiver), __FILE__, __LINE__);
} else {
// Include all
- $result = SQL_QUERY_ESC("SELECT d.userid FROM `{!MYSQL_PREFIX!}_user_data` AS d ".$CAT_TABS." WHERE d.status='CONFIRMED'".$CAT_WHERE." ORDER BY d.%s %s LIMIT %s",
+ $result = SQL_QUERY_ESC("SELECT d.userid FROM `{!_MYSQL_PREFIX!}_user_data` AS d ".$CAT_TABS." WHERE d.status='CONFIRMED'".$CAT_WHERE." ORDER BY d.%s %s LIMIT %s",
array($cat, getConfig('order_select'), getConfig('order_mode'), $receiver), __FILE__, __LINE__);
}
// Try to find the entry
$result = SQL_QUERY_ESC("SELECT UNIX_TIMESTAMP(`inserted`) AS `stamp`
-FROM `{!MYSQL_PREFIX!}_user_stats_data`
+FROM `{!_MYSQL_PREFIX!}_user_stats_data`
WHERE userid=%s AND stats_type='%s' AND stats_data='%s'
LIMIT 1",
array(bigintval($uid), $type, $data), __FILE__, __LINE__);
// Does it exist?
if ((!USER_STATS_GET_TIMESTAMP($type, $data, $uid)) && (!is_array($data))) {
// Then insert it!
- SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_user_stats_data` (`userid`,`stats_type`,`stats_data`) VALUES (%s,'%s','%s')",
+ SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_stats_data` (`userid`,`stats_type`,`stats_data`) VALUES (%s,'%s','%s')",
array(bigintval($uid), $type, $data), __FILE__, __LINE__);
} elseif (is_array($data)) {
// Invalid data!
// Get refs from database
$result = SQL_QUERY_ESC("SELECT ur.id, ur.refid, ud.status, ud.last_online, ud.mails_confirmed, ud.emails_received".$ADD."
-FROM `{!MYSQL_PREFIX!}_user_refs` AS ur
-LEFT JOIN `{!MYSQL_PREFIX!}_user_points` AS up
+FROM `{!_MYSQL_PREFIX!}_user_refs` AS ur
+LEFT JOIN `{!_MYSQL_PREFIX!}_user_points` AS up
ON ur.refid=up.userid AND ur.level=0
-LEFT JOIN `{!MYSQL_PREFIX!}_user_data` AS ud
+LEFT JOIN `{!_MYSQL_PREFIX!}_user_data` AS ud
ON ur.refid=ud.userid
WHERE ur.userid=%s AND ur.level=%s
ORDER BY ur.refid ASC",
// Recuced the amount of received emails for the receipients for given email
function REDUCT_RECIPIENT_RECEIVED_MAILS ($column, $id, $count) {
// Search for mail in database
- $result = SQL_QUERY_ESC("SELECT `userid` FROM `{!MYSQL_PREFIX!}_user_links` WHERE `%s`=%s ORDER BY `userid` ASC LIMIT %s",
+ $result = SQL_QUERY_ESC("SELECT `userid` FROM `{!_MYSQL_PREFIX!}_user_links` WHERE `%s`=%s ORDER BY `userid` ASC LIMIT %s",
array($column, bigintval($id), $count), __FILE__, __LINE__);
// Are there entries?
} // END - while
// Now update all user accounts
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET `emails_received`=`emails_received`-1 WHERE `userid` IN (%s) LIMIT %s",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `emails_received`=`emails_received`-1 WHERE `userid` IN (%s) LIMIT %s",
array(implode(",", $UIDs), count($UIDs)), __FILE__, __LINE__);
} // END - if
// Do we need to send out bonus mails?
if (EXT_IS_ACTIVE("html_mail")) {
// 0 1 2 3 4 5 6 7 8 9 10 11
- $result_bonus = SQL_QUERY("SELECT id, subject, text, receivers, points, time, data_type, timestamp, url, cat_id, target_send, html_msg FROM `{!MYSQL_PREFIX!}_bonus` WHERE data_type='NEW' ORDER BY timestamp DESC", __FILE__, __LINE__);
+ $result_bonus = SQL_QUERY("SELECT id, subject, text, receivers, points, time, data_type, timestamp, url, cat_id, target_send, html_msg FROM `{!_MYSQL_PREFIX!}_bonus` WHERE data_type='NEW' ORDER BY timestamp DESC", __FILE__, __LINE__);
} else {
// 0 1 2 3 4 5 6 7 8 9 10
- $result_bonus = SQL_QUERY("SELECT id, subject, text, receivers, points, time, data_type, timestamp, url, cat_id, target_send FROM `{!MYSQL_PREFIX!}_bonus` WHERE data_type='NEW' ORDER BY timestamp DESC", __FILE__, __LINE__);
+ $result_bonus = SQL_QUERY("SELECT id, subject, text, receivers, points, time, data_type, timestamp, url, cat_id, target_send FROM `{!_MYSQL_PREFIX!}_bonus` WHERE data_type='NEW' ORDER BY timestamp DESC", __FILE__, __LINE__);
}
if (SQL_NUMROWS($result_bonus) > 0) {
$DATA['url'] = COMPILE_CODE($DATA['url']);
// Message is active in queue
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_bonus` SET data_type='QUEUE' WHERE id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_bonus` SET data_type='QUEUE' WHERE id=%s LIMIT 1",
array(bigintval($DATA['id'])), __FILE__, __LINE__);
// "Explode" all receivers into an array
foreach ($RECEIVERS as $key => $uid) {
// Load personal data
//* DEBUG: */ echo "*L:".__LINE__."/".$uid."*<br />";
- $result_user = SQL_QUERY_ESC("SELECT surname, family, email FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
+ $result_user = SQL_QUERY_ESC("SELECT surname, family, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
array(bigintval($uid)), __FILE__, __LINE__);
// Is his data available?
if (GET_EXT_VERSION("user") >= "0.1.4") {
// Update mails received for receiver
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET emails_received=emails_received+1 WHERE userid=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET emails_received=emails_received+1 WHERE userid=%s LIMIT 1",
array(bigintval($uid)), __FILE__, __LINE__);
} // END - if
//* DEBUG: */ echo "-L:".__LINE__."/".SELECTION_COUNT($dummy)."-<br />";
if (SELECTION_COUNT($dummy) == 0) {
// Queue reached!
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_bonus` SET data_type='SEND', target_send='0', receivers='' WHERE id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_bonus` SET data_type='SEND', target_send='0', receivers='' WHERE id=%s LIMIT 1",
array(bigintval($DATA['id'])), __FILE__, __LINE__);
//* DEBUG: */ echo "*L:".__LINE__."*<br />";
} // END - if
} elseif ($GLOBALS['pool_cnt'] >= getConfig('max_send')) {
// Update bonus pool
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_bonus` SET data_type='NEW', target_send=%s, receivers='%s' WHERE id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_bonus` SET data_type='NEW', target_send=%s, receivers='%s' WHERE id=%s LIMIT 1",
array(SELECTION_COUNT($dummy), implode(";", $dummy), bigintval($DATA['id'])), __FILE__, __LINE__);
//* DEBUG: */ echo "*L:".__LINE__."<pre>";
//* DEBUG: */ print_r($dummy);
// Check for freed mail orders to send out
if (EXT_IS_ACTIVE("html_mail")) {
// 0 1 2 3 4 5 6 7 8 9 10
- $result_main = SQL_QUERY("SELECT id, sender, subject, text, receivers, payment_id, timestamp, url, target_send, cat_id, html_msg FROM `{!MYSQL_PREFIX!}_pool` WHERE data_type='NEW' ORDER BY timestamp DESC", __FILE__, __LINE__);
+ $result_main = SQL_QUERY("SELECT id, sender, subject, text, receivers, payment_id, timestamp, url, target_send, cat_id, html_msg FROM `{!_MYSQL_PREFIX!}_pool` WHERE data_type='NEW' ORDER BY timestamp DESC", __FILE__, __LINE__);
} else {
// 0 1 2 3 4 5 6 7 8 9 10
- $result_main = SQL_QUERY("SELECT id, sender, subject, text, receivers, payment_id, timestamp, url, target_send, cat_id, id FROM `{!MYSQL_PREFIX!}_pool` WHERE data_type='NEW' ORDER BY timestamp DESC", __FILE__, __LINE__);
+ $result_main = SQL_QUERY("SELECT id, sender, subject, text, receivers, payment_id, timestamp, url, target_send, cat_id, id FROM `{!_MYSQL_PREFIX!}_pool` WHERE data_type='NEW' ORDER BY timestamp DESC", __FILE__, __LINE__);
}
// Reset variables
// Parse all mails
while ($DATA = SQL_FETCHROW($result_main)) {
// Set mail order as "active". That means it will be sent out
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_pool` SET data_type='ACTIVE' WHERE id=%s AND data_type='NEW' LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET data_type='ACTIVE' WHERE id=%s AND data_type='NEW' LIMIT 1",
array($DATA[0]), __FILE__, __LINE__);
// Check fetched data for HTML
// We can now send mails to them...
foreach ($RECEIVERS as $key => $uid) {
// Lookup user ID
- $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__);
// Is his data available?
SQL_FREERESULT($result_user);
// Do we have a stats entry?
- $result_stats = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s AND userid=%s AND timestamp_ordered='%s' LIMIT 1",
+ $result_stats = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s AND userid=%s AND timestamp_ordered='%s' LIMIT 1",
array($DATA[0], $DATA[1], $DATA[6]), __FILE__, __LINE__);
// If there's no stats entry add it!
//* DEBUG: */ echo "!L:".__LINE__."/".SQL_NUMROWS($result_stats)."!<br />";
if (SQL_NUMROWS($result_stats) == 0) {
// No entry was found, so we add him!
- SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_user_stats` (pool_id , userid, cat_id, payment_id, subject, url , max_rec , timestamp_ordered, timestamp_sstart) VALUES ('%s','%s','%s','%s','%s','%s','%s','%s' , UNIX_TIMESTAMP())",
+ SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_stats` (pool_id , userid, cat_id, payment_id, subject, url , max_rec , timestamp_ordered, timestamp_sstart) VALUES ('%s','%s','%s','%s','%s','%s','%s','%s' , UNIX_TIMESTAMP())",
array(bigintval($DATA[0]), bigintval($DATA[1]), bigintval($DATA[9]), bigintval($DATA[5]), $DATA[2], $DATA[7], $DATA[8], bigintval($DATA[6])), __FILE__, __LINE__);
// Receive it's ID for the links table
- $result_stats = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s AND userid=%s AND timestamp_ordered='%s' LIMIT 1",
+ $result_stats = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s AND userid=%s AND timestamp_ordered='%s' LIMIT 1",
array(bigintval($DATA[0]), bigintval($DATA[1]), bigintval($DATA[6])), __FILE__, __LINE__);
} // END - if
SEND_EMAIL($email, $DATA[2], $mailText, $HTML);
// Count sent mails...
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET emails_sent=emails_sent+1 WHERE userid=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET emails_sent=emails_sent+1 WHERE userid=%s LIMIT 1",
array(bigintval($DATA[1])), __FILE__, __LINE__);
if (GET_EXT_VERSION("user") >= "0.1.4") {
// Update mails received for receiver
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET emails_received=emails_received+1 WHERE userid=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET emails_received=emails_received+1 WHERE userid=%s LIMIT 1",
array(bigintval($uid)), __FILE__, __LINE__);
} // END - if
SEND_ADMIN_NOTIFICATION(ADMIN_SUBJ_SEND_DONE, "done-admin", $content, $uid);
// Get sender's data
- $result_sender = SQL_QUERY_ESC("SELECT surname, family, email FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
+ $result_sender = SQL_QUERY_ESC("SELECT surname, family, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
array(bigintval($DATA[1])), __FILE__, __LINE__);
// Is the sender found?
SQL_FREERESULT($result_sender);
// Set status to SEND because we completely send it away
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_pool` SET data_type='SEND', target_send='0', receivers='' WHERE id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET data_type='SEND', target_send='0', receivers='' WHERE id=%s LIMIT 1",
array(bigintval($DATA[0])), __FILE__, __LINE__);
// Update send-completed-time
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_stats` SET timestamp_send=UNIX_TIMESTAMP() WHERE pool_id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_stats` SET timestamp_send=UNIX_TIMESTAMP() WHERE pool_id=%s LIMIT 1",
array(bigintval($DATA[0])), __FILE__, __LINE__);
$LAST_SENT_ID = $DATA[0]; $GLOBALS['pool_cnt'] = 0;
// There are some mails left to send for next round, so we reset the status back to NEW (=still not fully delivered)
$ADD = "";
if ($GLOBALS['pool_cnt'] <= $DATA[8]) $ADD = ", target_send=target_send-".$GLOBALS['pool_cnt'];
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_pool` SET data_type='NEW', receivers='%s'".$ADD." WHERE id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET data_type='NEW', receivers='%s'".$ADD." WHERE id=%s LIMIT 1",
array(implode(";", $dummy), bigintval($DATA[0])), __FILE__, __LINE__);
//* DEBUG: */ echo"*EXIT/L:".__LINE__."*<br />";
// User does not exists so we have add the sender's points back to sender's account
if (($RECEIVERS[0] == "0") || (empty($RECEIVERS[0]))) {
// List was empty
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_pool` SET data_type='SEND' WHERE id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET data_type='SEND' WHERE id=%s LIMIT 1",
array(bigintval($DATA[0])), __FILE__, __LINE__);
} else {
// Is the userid set?
unset($dummy[$key]);
// Update receivers
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_pool` SET receivers='%s' WHERE id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET receivers='%s' WHERE id=%s LIMIT 1",
array(implode(";", $dummy), bigintval($DATA[0])), __FILE__, __LINE__);
}
}
);
// We have to pay back some points to the sender (we add them directly :-P)
- $result = SQL_QUERY_ESC("SELECT email FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s AND status='CONFIRMED' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND status='CONFIRMED' LIMIT 1",
array(bigintval($uid)), __FILE__, __LINE__);
$DATA[10] = $PB; $DATA[11] = $cnt_back[$uid];
// Load personal data 0 1 2 3 4 5 6
$result = SQL_QUERY_ESC("SELECT userid, email, gender, surname, family, last_update, joined
FROM
- "._MYSQL_PREFIX."_user_data
+ {!MYSQL_PREFIX!}_user_data
WHERE
(last_update < (UNIX_TIMESTAMP() - %s) AND last_update != 0 AND last_profile_sent < (UNIX_TIMESTAMP() - %s))
OR
SEND_EMAIL($DATA[1], PROFILE_OUTDATED, $msg);
// Update profile data
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET last_profile_sent=UNIX_TIMESTAMP(), notified='Y' WHERE userid=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET last_profile_sent=UNIX_TIMESTAMP(), notified='Y' WHERE userid=%s LIMIT 1",
array(bigintval($DATA[0])), __FILE__, __LINE__);
}
}
//* DEBUG: */ echo basename(__FILE__)."<br />\n";
// Reset accounts
-$result = SQL_QUERY("UPDATE `{!MYSQL_PREFIX!}_user_data` SET beg_points=0.00000 WHERE beg_points > 0",
+$result = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET beg_points=0.00000 WHERE beg_points > 0",
__FILE__, __LINE__);
//
BONUS_PURGE_EXPIRED_TURBO_BONUS();
// Reset accounts
-$result = SQL_QUERY("UPDATE `{!MYSQL_PREFIX!}_user_data` SET turbo_bonus=0, login_bonus=0, bonus_order=0, bonus_stats=0, bonus_ref=0",
+$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__);
//
// Update user profiles
if (GET_EXT_VERSION("order") >= "0.1.1") {
// Latest version
- $result_daily = SQL_QUERY("UPDATE `{!MYSQL_PREFIX!}_user_data` SET receive_mails=max_mails, mail_orders=0 WHERE receive_mails != max_mails", __FILE__, __LINE__);
+ $result_daily = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET receive_mails=max_mails, mail_orders=0 WHERE receive_mails != max_mails", __FILE__, __LINE__);
} else {
// Obsolete version
- $result_daily = SQL_QUERY("UPDATE `{!MYSQL_PREFIX!}_user_data` SET receive_mails=max_mails WHERE receive_mails != max_mails", __FILE__, __LINE__);
+ $result_daily = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET receive_mails=max_mails WHERE receive_mails != max_mails", __FILE__, __LINE__);
}
// Transfer points from locked_points to points
-$result_daily = SQL_QUERY("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE ref_payout=0 AND status='CONFIRMED' ORDER BY userid", __FILE__, __LINE__);
+$result_daily = SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE ref_payout=0 AND status='CONFIRMED' ORDER BY userid", __FILE__, __LINE__);
//* DEBUG: */ echo basename(__FILE__).":payout=0;daily|numRows=".SQL_NUMROWS($result_daily)."<br />\n";
if (SQL_NUMROWS($result_daily) > 0)
while (list($uid) = SQL_FETCHROW($result_daily))
{
//* DEBUG: */ echo basename(__FILE__).":uid={$uid}<br />\n";
- $result_points = SQL_QUERY_ESC("SELECT ref_depth, locked_points FROM `{!MYSQL_PREFIX!}_user_points`
+ $result_points = SQL_QUERY_ESC("SELECT ref_depth, locked_points FROM `{!_MYSQL_PREFIX!}_user_points`
WHERE userid=%s AND locked_points != 0.00000 ORDER BY ref_depth",
array(bigintval($uid)), __FILE__, __LINE__);
//* DEBUG: */ echo basename(__FILE__).":payout=0;points|numRows=".SQL_NUMROWS($result_points)."<br />\n";
while (list($dep, $locked) = SQL_FETCHROW($result_points))
{
//* DEBUG: */ echo basename(__FILE__).":uid={$uid},depth={$dep},locked={$locked}<br />\n";
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_points` SET points=points+%s, locked_points=0.00000
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_points` SET points=points+%s, locked_points=0.00000
WHERE userid=%s AND ref_depth=%d
LIMIT 1",
array($locked, bigintval($uid), $dep), __FILE__, __LINE__);
//* DEBUG: */ echo basename(__FILE__)."<br />\n";
// Check for holidays we need to enable and send email to user
-$result_main = SQL_QUERY("SELECT userid, holiday_activated FROM `{!MYSQL_PREFIX!}_user_data`
+$result_main = SQL_QUERY("SELECT userid, holiday_activated FROM `{!_MYSQL_PREFIX!}_user_data`
WHERE holiday_activated > 0 AND holiday_activated < UNIX_TIMESTAMP() AND holiday_active='N'
ORDER BY holiday_activated", __FILE__, __LINE__);
if (SQL_NUMROWS($result_main) > 0) {
// We have found at least one useraccount so let's check it...
- while(list($uid, $activated) = SQL_FETCHROW($result_main)) {
+ while (list($uid, $activated) = SQL_FETCHROW($result_main)) {
// Check if his holiday can be activated
- $result_holiday = SQL_QUERY_ESC("SELECT holiday_start, holiday_end FROM `{!MYSQL_PREFIX!}_user_holidays`
+ $result_holiday = SQL_QUERY_ESC("SELECT holiday_start, holiday_end FROM `{!_MYSQL_PREFIX!}_user_holidays`
WHERE userid=%s AND holiday_start <= UNIX_TIMESTAMP() AND holiday_end > UNIX_TIMESTAMP() LIMIT 1",
array(bigintval($uid)), __FILE__, __LINE__);
if (SQL_NUMROWS($result_holiday) == 1)
SEND_EMAIL($uid, HOLIDAY_MEMBER_ACTIVATED, $msg);
// Update account
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET holiday_active='Y'
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET holiday_active='Y'
WHERE userid=%s
LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__);
}
// Check for 100% klickrate mails
$result_bonus = SQL_QUERY("SELECT id, userid, subject, timestamp_ordered, clicks, url
-FROM `{!MYSQL_PREFIX!}_user_stats`
+FROM `{!_MYSQL_PREFIX!}_user_stats`
WHERE max_rec=clicks AND clicks>0 AND bonus_stats_active='N'
ORDER BY userid", __FILE__, __LINE__);
define('__STATS_BONUS', TRANSLATE_COMMA(getConfig('bonus_stats')));
// We found some mail orders...
- while(list($id, $uid, $subj, $stamp, $clicks, $url) = SQL_FETCHROW($result_bonus)) {
+ while (list($id, $uid, $subj, $stamp, $clicks, $url) = SQL_FETCHROW($result_bonus)) {
// Add points
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET bonus_stats=bonus_stats+%s WHERE userid=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET bonus_stats=bonus_stats+%s WHERE userid=%s LIMIT 1",
array(getConfig('bonus_stats'), bigintval($uid)), __FILE__, __LINE__);
// Prepare array
SEND_EMAIL($uid, BONUS_MEMBER_STATS_SUBJECT, $msg);
// Update database
- $result_update = SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_stats` SET bonus_stats_active='Y' WHERE id=%s LIMIT 1",
+ $result_update = SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_stats` SET bonus_stats_active='Y' WHERE id=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
}
if ((FILE_READABLE($file)) && (filesize($file) > 0)) {
switch (getConfig('css_php')) {
case "DIRECT":
- OUTPUT_HTML("<link rel=\"stylesheet\" type=\"text/css\" href=\"".URL."/theme/".GET_CURR_THEME()."/".$value."\" />");
+ OUTPUT_HTML("<link rel=\"stylesheet\" type=\"text/css\" href=\"{!URL!}/theme/".GET_CURR_THEME()."/".$value."\" />");
break;
case "FILE":
}
} else {
// Now we load all CSS files from css.php!
- OUTPUT_HTML("<link rel=\"stylesheet\" type=\"text/css\" href=\"".URL."/css.php", false);
+ OUTPUT_HTML("<link rel=\"stylesheet\" type=\"text/css\" href=\"{!URL!}/css.php", false);
if (isBooleanConstantAndTrue('mxchange_installing')) {
// Default theme first
$NEW_THEME = "default";
// Is the cookie set?
if (isSessionVariableSet('lead_uid')) {
// Is the user-account unlocked and valid?
- $result = SQL_QUERY_ESC("SELECT email FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s AND status='CONFIRMED' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND status='CONFIRMED' LIMIT 1",
array(bigintval(get_session('lead_uid'))), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Secure the ID number
}
} else {
// Maybe spider?
- $content['lead_email'] = WEBMASTER;
+ $content['lead_email'] = constant('WEBMASTER');
}
// Load the lead template
// Maybe he wants to confirm an email?
if ($url_mid > 0) {
// Normal-Mails
- $result = SQL_QUERY_ESC("SELECT link_type FROM `{!MYSQL_PREFIX!}_user_links` WHERE stats_id=%s AND userid=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE stats_id=%s AND userid=%s LIMIT 1",
array($url_mid, $url_uid), __FILE__, __LINE__);
$type = "mailid"; $DATA = $url_mid;
} elseif ($url_bid > 0) {
// Bonus-Mail
- $result = SQL_QUERY_ESC("SELECT link_type FROM `{!MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s AND userid=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s AND userid=%s LIMIT 1",
array($url_bid, $url_uid), __FILE__, __LINE__);
$type = "bonusid"; $DATA = $url_bid;
} else {
{
case "NORMAL":
// Is the stats ID valid?
- $result = SQL_QUERY_ESC("SELECT pool_id, url, subject FROM `{!MYSQL_PREFIX!}_user_stats` WHERE id=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT pool_id, url, subject FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE id=%s LIMIT 1",
array($url_mid), __FILE__, __LINE__);
break;
} // END - if
// Bonus-Mails
- $result = SQL_QUERY_ESC("SELECT id, url, subject FROM `{!MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT id, url, subject FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1",
array($url_bid), __FILE__, __LINE__);
break;
}
$EXTRA_TITLE = COMPILE_CODE($EXTRA_TITLE);
// Is the user's ID unlocked?
- $result = SQL_QUERY_ESC("SELECT status, gender, surname, family FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT status, gender, surname, family FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
array($url_uid), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
list($status, $gender, $sname, $fname) = SQL_FETCHROW($result);
switch ($ltype)
{
case "NORMAL":
- $result = SQL_QUERY_ESC("SELECT payment_id FROM `{!MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT payment_id FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s LIMIT 1",
array(bigintval($pool)), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1)
{
break;
case "BONUS":
- $result = SQL_QUERY_ESC("SELECT points, time FROM `{!MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT points, time FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1",
array($url_bid), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1)
{
// Was that mail a valid one?
if ($VALID) {
// If time is zero seconds we have a sponsor mail. 1 Second shall be set to avoid problems
- if (($time == "0") && ($payment > 0)) { $URL = URL; $time = "1"; }
+ if (($time == "0") && ($payment > 0)) { $URL = constant('URL'); $time = "1"; }
if (($time > 0) && (($payment > 0) || ($points > 0))) {
// He can confirm this mail!
// Export data into constants for the template
// Maybe he wants to confirm an email?
if ($url_mid > 0) {
- $result = SQL_QUERY_ESC("SELECT id, link_type FROM `{!MYSQL_PREFIX!}_user_links` WHERE stats_id=%s AND userid=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT id, link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE stats_id=%s AND userid=%s LIMIT 1",
array($url_mid, $url_uid), __FILE__, __LINE__);
$type = "mailid"; $DATA = $url_mid;
} elseif ($url_bid > 0) {
- $result = SQL_QUERY_ESC("SELECT id, link_type FROM `{!MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s AND userid=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT id, link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s AND userid=%s LIMIT 1",
array($url_bid, $url_uid), __FILE__, __LINE__);
$type = "bonusid"; $DATA = $url_bid;
}
switch ($ltype)
{
case "NORMAL":
- $result_mailid = SQL_QUERY_ESC("SELECT pool_id, userid, id FROM `{!MYSQL_PREFIX!}_user_stats` WHERE id=%s LIMIT 1",
+ $result_mailid = SQL_QUERY_ESC("SELECT pool_id, userid, id FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE id=%s LIMIT 1",
array($url_mid), __FILE__, __LINE__);
break;
case "BONUS":
- $result_mailid = SQL_QUERY_ESC("SELECT id, id, is_notify FROM `{!MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1",
+ $result_mailid = SQL_QUERY_ESC("SELECT id, id, is_notify FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1",
array($url_bid), __FILE__, __LINE__);
break;
}
if ($ltype == "BONUS") $sender = 0;
// Is the user's ID unlocked?
- $result = SQL_QUERY_ESC("SELECT status, gender, surname, family, ref_payout FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT status, gender, surname, family, ref_payout FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
array($url_uid), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Load data
if ($status == "CONFIRMED") {
// Update last activity
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET last_online=UNIX_TIMESTAMP(), last_module='mailid_top' WHERE userid=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET last_online=UNIX_TIMESTAMP(), last_module='mailid_top' WHERE userid=%s LIMIT 1",
array($url_uid), __FILE__, __LINE__);
// User has confirmed his account so we can procede...
switch ($ltype)
{
case "NORMAL":
- $result = SQL_QUERY_ESC("SELECT payment_id FROM `{!MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT payment_id FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s LIMIT 1",
array(bigintval($pool)), __FILE__, __LINE__);
// Entry found?
break;
case "BONUS":
- $result = SQL_QUERY_ESC("SELECT time, points FROM `{!MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT time, points FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1",
array(bigintval($pool)), __FILE__, __LINE__);
// Entry found?
switch ($ltype)
{
case "NORMAL":
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_stats` SET clicks=clicks + 1 WHERE id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_stats` SET clicks=clicks + 1 WHERE id=%s LIMIT 1",
array($url_mid), __FILE__, __LINE__);
// Update mediadata as well
break;
case "BONUS":
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_bonus` SET clicks=clicks + 1 WHERE id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_bonus` SET clicks=clicks + 1 WHERE id=%s LIMIT 1",
array($url_bid), __FILE__, __LINE__);
// Update mediadata as well
// Only when user extension = v0.1.2: Update mails-confirmed counter
if (GET_EXT_VERSION("user") >= "0.1.2") {
// Update counter
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET mails_confirmed=mails_confirmed + 1 WHERE userid=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET mails_confirmed=mails_confirmed + 1 WHERE userid=%s LIMIT 1",
array($url_uid), __FILE__, __LINE__);
// Update random confirmed as well?
if (GET_EXT_VERSION("user") >= "0.3.4") {
// Update second counter
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET rand_confirmed=rand_confirmed + 1 WHERE userid=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET rand_confirmed=rand_confirmed + 1 WHERE userid=%s LIMIT 1",
array($url_uid), __FILE__, __LINE__);
} // END - if
} // END - if
} // END - if
// Count down ref_payout value
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET ref_payout=ref_payout-1 WHERE userid=%s AND ref_payout > 0 LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET ref_payout=ref_payout-1 WHERE userid=%s AND ref_payout > 0 LIMIT 1",
array($url_uid), __FILE__, __LINE__);
// Add points
}
// Remove link from table
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_user_links` WHERE id=%s LIMIT 1",
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_links` WHERE id=%s LIMIT 1",
array(bigintval($lid)), __FILE__, __LINE__);
break;
// Check if logged in
if (IS_MEMBER()) {
// Is still logged in so we welcome him with his name
- $result = SQL_QUERY_ESC("SELECT surname, family FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT surname, family FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
array($GLOBALS['userid']), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Load surname and family's name and build the username
}
// The header file
-include (PATH."inc/header.php");
+require_once(PATH."inc/header.php");
// Modules are by default not valid!
$MOD_VALID = false; $check = "failed";
if ((getConfig('maintenance') == "Y") && (!IS_ADMIN()) && ($GLOBALS['module'] != "admin")) {
// Maintain mode is active and you are no admin
- addFatalMessage(LANG_DOWN_MAINTAINCE);
+ addFatalMessage(getMessage('LANG_DOWN_MAINTAINCE'));
} elseif (($link) && ($db) && (getTotalFatalErrors() == 0)) {
// Did we found the module listed in allowed modules and are we successfully connected?
$check = CHECK_MODULE($GLOBALS['module']);
}
} elseif (getTotalFatalErrors() == 0) {
// MySQL problems!
- addFatalMessage(MYSQL_ERRORS);
+ addFatalMessage(getMessage('MYSQL_ERRORS'));
}
if (($MOD_VALID) && (defined('__MODULE'))) {
} // END - if
// Next-to-end add the footer
-include (PATH."inc/footer.php");
+require_once(PATH."inc/footer.php");
//
?>
if ($ref != "".($ref + 0)."") {
if (EXT_IS_ACTIVE("nickname")) {
// Nickname in URL, so load the ID
- $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($ref), __FILE__, __LINE__);
// Load userid
// Is the refid valid?
if ($ref > 0) {
// Update ref counter
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET ref_clicks=ref_clicks+1 WHERE userid=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET ref_clicks=ref_clicks+1 WHERE userid=%s LIMIT 1",
array(bigintval($ref)), __FILE__, __LINE__);
} // END - if
} else {
if (!empty($t)) {
// Check for data
$result = SQL_QUERY_ESC("SELECT DISTINCT d.gender, d.surname, d.family, b.level, b.points
-FROM `{!MYSQL_PREFIX!}_user_data` AS d
-RIGHT JOIN `{!MYSQL_PREFIX!}_bonus_turbo` AS b
+FROM `{!_MYSQL_PREFIX!}_user_data` AS d
+RIGHT JOIN `{!_MYSQL_PREFIX!}_bonus_turbo` AS b
ON d.userid=b.userid
WHERE d.status='CONFIRMED' AND d.userid=%s AND b.%s=%s
LIMIT 1",
$VIEW = 1;
// for later things... ;-)
- $result = SQL_QUERY_ESC("SELECT url FROM `{!MYSQL_PREFIX!}_refbanner` WHERE id=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT url FROM `{!_MYSQL_PREFIX!}_refbanner` WHERE id=%s LIMIT 1",
array(bigintval($_GET['banner'])), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
list($url) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
- SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_refbanner` SET counter=counter+1 WHERE id=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_refbanner` SET counter=counter+1 WHERE id=%s LIMIT 1",
array(bigintval($_GET['banner'])), __FILE__, __LINE__);
$type = substr($url, -3);