// 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
// 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
-WHERE d.status='CONFIRMED' AND d.joined < (UNIX_TIMESTAMP() - %s) AND d.last_online < (UNIX_TIMESTAMP() - %s) AND d.ap_notified < (UNIX_TIMESTAMP() - %s)
+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__);
$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
-WHERE status='CONFIRMED' AND joined < (UNIX_TIMESTAMP() - %s) AND last_online < (UNIX_TIMESTAMP() - %s) AND ap_notified < (UNIX_TIMESTAMP() - %s)
+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",
array($since, $since, $time), __FILE__, __LINE__);
// Purge deleted tasks (no notification to admin)
SQL_QUERY_ESC("DELETE LOW_PRIORITY
FROM `{!_MYSQL_PREFIX!}_task_system`
-WHERE status='DELETED' AND task_created <= (UNIX_TIMESTAMP() - %s)",
+WHERE `status`='DELETED' AND task_created <= (UNIX_TIMESTAMP() - %s)",
array($since), __FILE__, __LINE__);
$DELETED = SQL_AFFECTEDROWS();
$time = bigintval(getConfig('ap_un_time'));
$result_uncon = SQL_QUERY_ESC("SELECT userid, email, joined
FROM `{!_MYSQL_PREFIX!}_user_data`
-WHERE status='UNCONFIRMED' AND joined < (UNIX_TIMESTAMP() - %s)
+WHERE `status`='UNCONFIRMED' AND joined < (UNIX_TIMESTAMP() - %s)
ORDER BY userid ASC",
array($time), __FILE__, __LINE__);
if (SQL_NUMROWS($result_uncon) > 0) {
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'
+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
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'
+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
LIMIT %d", array($DOUBLER_POINTS, $min, getConfig('doubler_max_sent')), __FILE__, __LINE__);
}
} 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__);
}
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[] = "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!)
// 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[] = "UPDATE `{!_MYSQL_PREFIX!}_task_system` SET `status`='SOLVED' WHERE `status`='CLOSED'";
// Enable CSS file?
$EXT_CSS = "Y";
return (((substr($URL, 0, 7) == "http://") || (substr($URL, 0, 8) == "https://")) && (strlen($URL) >= 12));
}
//
-function MEMBER_ACTION_LINKS($uid, $status="") {
+function MEMBER_ACTION_LINKS ($uid, $status = "") {
// Define all main targets
$TARGETS = array("del_user", "edit_user", "lock_user", "add_points", "sub_points");
// Create email link to admins's account
function ADMINS_CREATE_EMAIL_LINK($email, $mod="admin") {
- $locked = " AND status='CONFIRMED'";
+ $locked = " AND `status`='CONFIRMED'";
if (IS_ADMIN()) $locked = "";
if (strpos("@", $email) > 0) {
// Create email link
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);
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",
+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__);
list($cpoints) = SQL_FETCHROW($result_ref);
SQL_FREERESULT($result_ref);
$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
+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__);
list($refpoints) = SQL_FETCHROW($result_ref);
SQL_FREERESULT($result_ref);
// active = 0: account is deleted or locked
$result = SQL_QUERY_ESC("SELECT COUNT(userid) AS active
FROM `{!_MYSQL_PREFIX!}_user_data`
-WHERE userid=%s AND status='CONFIRMED'
+WHERE userid=%s AND `status`='CONFIRMED'
LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__);
list($active) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
$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))
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",
+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__);
list($refpoints) = SQL_FETCHROW($result_ref);
SQL_FREERESULT($result_ref);
// 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);
if ((isSessionVariableSet('sponsorid'))) && (isSessionVariableSet('sponsorpass')))) {
// Check cookies against database records...
$result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_data`
-WHERE id='%s' AND password='%s' AND status='CONFIRMED' LIMIT 1",
+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) {
// All is fine
$EMAIL = true;
// Okay, has changed then add status with UNCONFIRMED and new hash code
- $SQL .= " status='EMAIL', hash='%s',";
+ $SQL .= " `status`='EMAIL', hash='%s',";
// Generate hash code
$HASH = md5(session_id().":".$POST['email'].":".GET_REMOTE_ADDR().":".GET_USER_AGENT().":".time());
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
// Handle URLs which limit has depleted
function SURFBAR_HANDLE_DEPLETED_VIEWS () {
// Get all URLs
- $urlArray = SURFBAR_GET_URL_DATA("0", "views_max", "id", "ASC", "id", " AND views_allowed>0 AND status='ACTIVE'");
+ $urlArray = SURFBAR_GET_URL_DATA("0", "views_max", "id", "ASC", "id", " AND views_allowed>0 AND `status`='ACTIVE'");
// Do we have some entries?
if (count($urlArray) > 0) {
// Get amount from database
$result = SQL_QUERY_ESC("SELECT COUNT(id) AS cnt
FROM `{!_MYSQL_PREFIX!}_surfbar_urls`
-WHERE userid NOT IN (".implode(",", $UIDs['uid']).") AND status='%s'",
+WHERE userid NOT IN (".implode(",", $UIDs['uid']).") AND `status`='%s'",
array($status), __FILE__, __LINE__
);
$ADD = sprintf(" AND status IN('%s')", implode("','", $status));
} elseif (!empty($status)) {
// Only URLs with this status
- $ADD = sprintf(" AND status='%s'", $status);
+ $ADD = sprintf(" AND `status`='%s'", $status);
} elseif (is_array($exclude)) {
// Exclude URLs with these status
$ADD = sprintf(" AND status NOT IN('%s')", implode("','", $exclude));
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'
+WHERE u.userid NOT IN (%s,0) AND u.`status`='ACTIVE'
GROUP BY u.userid
ORDER BY u.userid ASC",
array($GLOBALS['userid']), __FILE__, __LINE__);
FROM `{!_MYSQL_PREFIX!}_surfbar_urls` AS u
INNER JOIN `{!_MYSQL_PREFIX!}_user_data` AS d
ON u.userid=d.userid
-WHERE u.status='ACTIVE'
+WHERE u.`status`='ACTIVE'
GROUP BY u.userid
ORDER BY u.userid ASC", __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! ---------
ON sbu.id=sbs.url_id
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."
+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__);
// Log last query
$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?
ON sbu.id=sbs.url_id
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."
+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
ORDER BY l.last_surfed ASC, sbu.id ASC
LIMIT %s,1",
ON sbu.id=sbs.url_id
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))
+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",
array($GLOBALS['userid'], bigintval($urlId)), __FILE__, __LINE__
);
if (!$JOBS_DONE) {
// New extensions or updates found
- $value = GET_TOTAL_DATA(GET_CURRENT_ADMIN_ID(), "task_system", "id", "assigned_admin", true, " AND status='NEW' AND task_type='EXTENSION_UPDATE'");
+ $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>");
// Check for all accounts
$SQLs[] = "SELECT DISTINCT d.userid, d.email, d.last_online
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.")
+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";
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[] = getMessage('TASK_ADMIN_LIST_PAYOUTS_WAITING');
$TITLEs[] = getMessage('TASK_ADMIN_LIST_PAYOUTS_WAITING_TITLE');
$SQLs[] = "SELECT ".$USE." AS points
FROM `{!_MYSQL_PREFIX!}_user_data`
-WHERE status='CONFIRMED' AND ".$USE.">0".$LAST."
+WHERE `status`='CONFIRMED' AND ".$USE.">0".$LAST."
ORDER BY points DESC, userid";
$WHATs[] = "list_bonus";
$DESCRs[] = getMessage('TASK_ADMIN_LIST_BONUS');
}
$SQLs[] = "SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data`
-WHERE status='CONFIRMED' AND beg_points>0".$LAST."
+WHERE `status`='CONFIRMED' AND beg_points>0".$LAST."
ORDER BY beg_points DESC, userid";
$WHATs[] = "list_beg";
$DESCRs[] = getMessage('TASK_ADMIN_LIST_BEG');
$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`";
+ $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');
$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[] = 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[] = 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[] = 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[] = 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[] = getMessage('TASK_ADMIN_LIST_SPONSOR_ORDERS');
$TITLEs[] = getMessage('TASK_ADMIN_LIST_SPONSOR_ORDERS_TITLE');
$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[] = getMessage('TASK_ADMIN_LIST_SURFBAR_URLS_PENDING');
$TITLEs[] = getMessage('TASK_ADMIN_LIST_SURFBAR_URLS_PENDING_TITLE');
// Create email link to user's account
function USER_CREATE_EMAIL_LINK($email, $mod="admin") {
// Show contact link only if user is confirmed by default
- $locked = " AND status='CONFIRMED'";
+ $locked = " AND `status`='CONFIRMED'";
// But admins shall always see it
if (IS_ADMIN()) $locked = "";
$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
if (!empty($SQL)) {
// The SQL command needs to be finisched here (only confirmed accounts!)
- $SQL .= ") AND status='CONFIRMED' ORDER BY last_online ASC";
+ $SQL .= ") AND `status`='CONFIRMED' ORDER BY last_online ASC";
// Prepare data for the template
define('__BEG_MIN_POINTS' , TRANSLATE_COMMA(getConfig('beg_points')));
// Only confirmed members shall receive birthday mails...
$result_birthday = SQL_QUERY_ESC("SELECT userid, email, birth_year
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."
+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__);
if (!empty($SQL)) {
// The SQL command needs to be finisched here (only confirmed accounts!)
- $SQL .= ") AND status='CONFIRMED' ORDER BY last_online ASC";
+ $SQL .= ") AND `status`='CONFIRMED' ORDER BY last_online ASC";
// Normal notification mails or bonus mails?
$MAIL_MODE = ((getConfig('bonus_notify_points') > 0) && ($MODE == "en") && (EXT_IS_ACTIVE("bonus")));
// 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`
-WHERE assigned_admin='%s' OR (assigned_admin='0' AND status='NEW')
+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...
}
// 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
// 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
}
} 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
// Check for accounts
$result = SQL_QUERY("SELECT userid, gender, surname, family, email, REMOTE_ADDR, refid, user_hash
FROM `{!_MYSQL_PREFIX!}_user_data`
-WHERE status='UNCONFIRMED'
+WHERE `status`='UNCONFIRMED'
ORDER BY userid ASC", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
ADD_DESCR("admin", __FILE__);
$SEL = 0;
-if (isset($_POST['edit']))
-{
+if (isset($_POST['edit'])) {
// Check if at least one module is selected
$SEL = SELECTION_COUNT($_POST['sel']);
- if ($SEL > 0)
- {
+ if ($SEL > 0) {
// Output header
$OUT = ""; $SW = 2;
// Edit selected modules
- foreach ($_POST['sel'] as $id => $sel)
- {
+ 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",
- array(bigintval($id)), __FILE__, __LINE__);
+ array(bigintval($id)), __FILE__, __LINE__);
list($mod, $title, $locked, $hidden, $admin, $mem) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
// Load main template
LOAD_TEMPLATE("admin_mods_edit");
- }
- else
- {
+ } else {
// Nothing selected
LOAD_TEMPLATE("admin_settings_saved", false, MODS_NOTHING_SELECTED);
- OUTPUT_HTML("<br />");
// Remove maybe confusing data
unset($_POST['edit']);
unset($_POST['change']);
}
-}
- elseif (isset($_POST['change']))
-{
+} elseif (isset($_POST['change'])) {
// Change modules
- foreach ($_POST['sel'] as $id => $sel)
- {
+ foreach ($_POST['sel'] as $id => $sel) {
// Secure ID number
$id = bigintval($id);
}
// Remove cache file if version matches
- if (GET_EXT_VERSION("cache") >= "0.1.2")
- {
+ if (GET_EXT_VERSION("cache") >= "0.1.2") {
if ($cacheInstance->loadCacheFile("mod_reg")) $cacheInstance->destroyCacheFile();
}
// Entries updated
LOAD_TEMPLATE("admin_settings_saved", false, MODS_CHANGED);
- OUTPUT_HTML("<br />");
}
-if ($SEL == 0)
-{
+if ($SEL == 0) {
// Load module data (We do not need to check if there's at least one...)
$result = SQL_QUERY("SELECT id, module, locked, hidden, admin_only, title, mem_only, clicks
FROM `{!_MYSQL_PREFIX!}_mod_reg`
ORDER BY module", __FILE__, __LINE__);
$OUT = ""; $SW = 2;
- while (list($id, $mod, $locked, $hidden, $admin, $title, $mem) = SQL_FETCHROW($result))
- {
+ while (list($id, $mod, $locked, $hidden, $admin, $title, $mem) = SQL_FETCHROW($result)) {
// Reset title to --- if it is NULL
if (empty($title)) $title = "---";
- if (($mod == "index") || ($mod == "login"))
- {
+ 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>";
}
}
// 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)) {
// 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
-WHERE d.status='CONFIRMED' AND d.joined < (UNIX_TIMESTAMP() - %s) AND d.last_online < (UNIX_TIMESTAMP() - %s) AND d.ap_notified < (UNIX_TIMESTAMP() - %s)
+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__);
// 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`
-WHERE status='CONFIRMED' AND beg_points > 0".$LAST."
+WHERE `status`='CONFIRMED' AND beg_points > 0".$LAST."
ORDER BY beg_points DESC, last_online DESC, userid",
array($ONLINE), __FILE__, __LINE__);
// 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`
-WHERE status='CONFIRMED' AND ".$USE." > 0".$LAST."
+WHERE `status`='CONFIRMED' AND ".$USE." > 0".$LAST."
ORDER BY points DESC, last_online DESC, userid",
array($ONLINE), __FILE__, __LINE__);
// Display message
LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
- OUTPUT_HTML("<br />");
} elseif ((isset($_POST['change'])) && (!empty($_POST['id']))) {
// Change all status
ADMIN_CHANGE_ACTIVATION_STATUS($_POST['id'], "countries", "is_active");
// Display message
LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
- OUTPUT_HTML("<br />");
}
// Load currenty setup country codes to list
}
// 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($MSG)) {
// Output message
LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
- OUTPUT_HTML("<br />");
}
}
// Output message
LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
- OUTPUT_HTML("<br />");
} elseif ((isset($_POST['edit'])) || (isset($_POST['del']))) {
// Load all data
$OUT = ""; $SW = 2;
switch ($_GET['type'])
{
case "your": // List only your own open (new) tasks
- $whereStatement = "assigned_admin='".GET_CURRENT_ADMIN_ID()."' AND status='NEW' AND task_type != 'EXTENSION_UPDATE'";
+ $whereStatement = "assigned_admin='".GET_CURRENT_ADMIN_ID()."' AND `status`='NEW' AND task_type != 'EXTENSION_UPDATE'";
break;
case "updates": // List only updates assigned to you
- $whereStatement = "assigned_admin=".GET_CURRENT_ADMIN_ID()." AND status='NEW' AND task_type = 'EXTENSION_UPDATE'";
+ $whereStatement = "assigned_admin=".GET_CURRENT_ADMIN_ID()." AND `status`='NEW' AND task_type = 'EXTENSION_UPDATE'";
break;
case "solved": // List only solved tasks assigned to you
- $whereStatement = "assigned_admin=".GET_CURRENT_ADMIN_ID()." AND status='SOLVED'";
+ $whereStatement = "assigned_admin=".GET_CURRENT_ADMIN_ID()." AND `status`='SOLVED'";
break;
case "unassigned": // List unassigned (but not deleted) tasks
break;
case "deleted": // List all deleted
- $whereStatement = "status='DELETED'";
+ $whereStatement = "`status`='DELETED'";
break;
case "closed": // List all closed
- $whereStatement = "assigned_admin=".GET_CURRENT_ADMIN_ID()." AND status='CLOSED'";
+ $whereStatement = "assigned_admin=".GET_CURRENT_ADMIN_ID()." AND `status`='CLOSED'";
break;
default: // Unknown type
// Is a WHERE statement already there?
if (!empty($whereStatement)) {
// Then append the status column
- $whereStatement .= sprintf(" AND status='%s'", SQL_ESCAPE(strip_tags(strtoupper($_GET['status']))));
+ $whereStatement .= sprintf(" AND `status`='%s'", SQL_ESCAPE(strip_tags(strtoupper($_GET['status']))));
} else {
// Start a new one
- $whereStatement = sprintf(" WHERE status='%s'", SQL_ESCAPE(strip_tags(strtoupper($_GET['status']))));
+ $whereStatement = sprintf(" WHERE `status`='%s'", SQL_ESCAPE(strip_tags(strtoupper($_GET['status']))));
}
} elseif (isset($_GET['mode'])) {
// Choose what we need to list
$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);
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!
// 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__);
}
} elseif (!$taskExt) {
if (EXT_IS_ACTIVE("task")) {
// Output warning message
- LOAD_TEMPLATE("admin_settings_saved", false, sprintf(EXTENSION_WARNING_EXT_INACTIVE, "task"));
- OUTPUT_HTML("<br />");
+ LOAD_TEMPLATE("admin_settings_saved", false, sprintf(getMessage('EXTENSION_WARNING_EXT_INACTIVE'), "task"));
}
// List selected tasks on overview when task management is not active
if (isset($_POST['ok'])) {
$result = SQL_QUERY("SELECT userid, email
FROM `{!_MYSQL_PREFIX!}_user_data`
-WHERE status='CONFIRMED' AND nl_receive='Y'
+WHERE `status`='CONFIRMED' AND nl_receive='Y'
ORDER BY userid ASC", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
// Members are available so we can send out the newsletter!
// 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__);
+ $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",
+ $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?
}
} 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
// Output message
LOAD_TEMPLATE("admin_settings_saved", false, $msg);
- OUTPUT_HTML("<br />");
} // END - if
// Initialize array
// 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`
-WHERE status='PENDING' AND id='%s' LIMIT 1",
- array($id), __FILE__, __LINE__);
+WHERE `status`='PENDING' AND id='%s' LIMIT 1",
+ array($id), __FILE__, __LINE__);
$refid = 0;
if (SQL_NUMROWS($result_main) == 1) {
// Load data and free memory
ON sp.id=so.payid
WHERE so.sponsorid='%s'
ORDER BY sp.pay_name",
- array($id), __FILE__, __LINE__);
+ array($id), __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
// Payment does exist
while (list($aid, $count, $ordered, $status, $pname, $prate, $pcurr) = SQL_FETCHROW($result))
SQL_FREERESULT($result_main);
// Unlock sponsor account
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET status='CONFIRMED'
-WHERE id='%s' AND status='PENDING' LIMIT 1",
- array($id), __FILE__, __LINE__);
+ 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)) {
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__);
+ array(getConfig('sponsor_ref_points'), bigintval($refid)), __FILE__, __LINE__);
// Whas that update fine?
if (SQL_AFFECTEDROWS() == 1) {
(points_amount - points_used) AS points, receive_warnings, ref_count AS refs
FROM `{!_MYSQL_PREFIX!}_sponsor_data`
WHERE id='%s' LIMIT 1",
- array(bigintval($refid)), __FILE__, __LINE__);
+ array(bigintval($refid)), __FILE__, __LINE__);
$REFERRAL = SQL_FETCHARRAY($result);
// Send warnings out?
// Send notification to referal
$REF_MSG = LOAD_EMAIL_TEMPLATE("sponsor_ref_notify", $REFERRAL);
- SEND_EMAIL($REFERRAL['email'], SPONSOR_REF_NOTIFY_SUBJ, $REF_MSG);
+ SEND_EMAIL($REFERRAL['email'], getMessage('SPONSOR_REF_NOTIFY_SUBJ'), $REF_MSG);
}
// Free memory
// So let's send the email away
$msg = LOAD_EMAIL_TEMPLATE("sponsor_unlocked", $content);
- SEND_EMAIL($email, SPONSOR_UNLOCKED_SUBJ, $msg);
+ SEND_EMAIL($email, getMessage('SPONSOR_UNLOCKED_SUBJ'), $msg);
}
} else {
// Nothing selected
}
// 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__);
+$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__);
if (SQL_NUMROWS($result) > 0) {
// Entries found so let's list them!
// List all URLs
$result = SQL_QUERY("SELECT id, userid, url, UNIX_TIMESTAMP(registered) AS registered
FROM `{!_MYSQL_PREFIX!}_surfbar_urls`
-WHERE status='PENDING'
+WHERE `status`='PENDING'
ORDER BY `id` ASC", __FILE__, __LINE__);
// Do we have some URLs left?
// Check for members who were active only this day
$result = SQL_QUERY_ESC("SELECT userid, ".$ADD.", last_online
FROM `{!_MYSQL_PREFIX!}_user_data`
-WHERE last_online >= %s AND status='CONFIRMED'
+WHERE last_online >= %s AND `status`='CONFIRMED'
ORDER BY last_online DESC LIMIT %s",
array(START_TDAY, getConfig('active_limit')), __FILE__, __LINE__);
$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));
}
// 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);
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`
-WHERE hash='%s' AND (status='UNCONFIRMED' OR status='EMAIL')
+WHERE hash='%s' AND (`status`='UNCONFIRMED' OR `status`='EMAIL')
LIMIT 1", array($_GET['hash']), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Sponsor found, load his data...
// 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'
-WHERE id='%s' AND hash='%s' AND status='UNCONFIRMED' LIMIT 1",
+ 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__);
// Check on success
}
} elseif ($SPONSOR['status'] == "EMAIL") {
// Changed email adress need to be confirmed
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET status='CONFIRMED'
-WHERE id='%s' AND hash='%s' AND status='EMAIL' LIMIT 1",
+ 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__);
// Check on success
// Check email
$result = SQL_QUERY_ESC("SELECT id, hash, status, remote_addr, gender, surname, family, sponsor_created
FROM `{!_MYSQL_PREFIX!}_sponsor_data`
-WHERE email='%s' AND (status='UNCONFIRMED' OR status='EMAIL') LIMIT 1",
+WHERE email='%s' AND (`status`='UNCONFIRMED' OR `status`='EMAIL') LIMIT 1",
array($_POST['email']), __FILE__, __LINE__);
// Entry found?
// Check email
$result = SQL_QUERY_ESC("SELECT id, hash, remote_addr, gender, surname, family, sponsor_created
FROM `{!_MYSQL_PREFIX!}_sponsor_data`
-WHERE email='%s' AND id='%s' AND status='CONFIRMED' LIMIT 1",
+WHERE email='%s' AND id='%s' AND `status`='CONFIRMED' LIMIT 1",
array($_POST['email'], bigintval($_POST['id'])), __FILE__, __LINE__);
// Entry found?
if (SQL_NUMROWS($result) == 1) {
} else {
// Cookie setup failed!
LOAD_TEMPLATE("admin_settings_saved", false, SPONSPOR_COOKIE_SETUP_FAILED);
- OUTPUT_HTML("<br />");
// Login formular and other links
LOAD_TEMPLATE("guest_sponsor_login");
// Status is not fine
$content = constant('SPONSOR_LOGIN_FAILED_'.strtoupper($status).'');
LOAD_TEMPLATE("admin_settings_saved", false, $content);
- OUTPUT_HTML("<br />");
// Login formular and other links
LOAD_TEMPLATE("guest_sponsor_login");
} else {
// Account missing or wrong pass! We shall not find this out for the "hacker folks"...
LOAD_TEMPLATE("admin_settings_saved", false, SPONSOR_LOGIN_FAILED_404_WRONG_PASS);
- OUTPUT_HTML("<br />");
// Login formular and other links
LOAD_TEMPLATE("guest_sponsor_login");
{
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__));
// 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__));
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__));
}
{!_MYSQL_PREFIX!}_user_data
WHERE
total_logins > 0 AND
- status='CONFIRMED'
+ `status`='CONFIRMED'
ORDER BY
total_logins DESC
LIMIT %s",
p.userid=d.userid
WHERE
p.points > 0 AND
- d.status='CONFIRMED'
+ d.`status`='CONFIRMED'
GROUP BY
p.userid
ORDER BY
r.userid=d.userid
WHERE
r.counter > 0 AND
- d.status='CONFIRMED'
+ d.`status`='CONFIRMED'
GROUP BY
r.userid
ORDER BY
// 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`
-WHERE beg_points > 0 AND status='CONFIRMED'".$LAST."
+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__);
// 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`
-WHERE ".$USE." > 0 AND status='CONFIRMED'".$LAST."
+WHERE ".$USE." > 0 AND `status`='CONFIRMED'".$LAST."
ORDER BY points DESC, last_online DESC, userid
LIMIT %s",
array($ONLINE, getConfig('bonus_ranks')), __FILE__, __LINE__);
$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."
+WHERE c.cat_id=%s AND c.userid != '%s' AND d.`status`='CONFIRMED' AND d.receive_mails > 0".$ADD."
ORDER BY d.%s %s",
array(
bigintval($_POST['cat']),
$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'
+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()
LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__);
if (SQL_NUMROWS($result_holiday) == 1) {
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",
+ $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")) {
if (empty($_POST['primera_nickname'])) {
// Nothing entered in Primus nickname
LOAD_TEMPLATE("admin_settings_saved", false, PRIMERA_MEMBER_EMPTY_USERNAME);
- OUTPUT_HTML("<br />");
} elseif (empty($_POST['primera_password'])) {
// Nothing entered in Primera password
LOAD_TEMPLATE("admin_settings_saved", false, PRIMERA_MEMBER_EMPTY_PASSWORD);
- OUTPUT_HTML("<br />");
} elseif (empty($_POST['amount'])) {
// Nothing entered in amount
LOAD_TEMPLATE("admin_settings_saved", false, PRIMERA_MEMBER_EMPTY_AMOUNT);
- OUTPUT_HTML("<br />");
} elseif ($_POST['amount'] != bigintval($_POST['amount'])) {
// Only numbers in amount!
LOAD_TEMPLATE("admin_settings_saved", false, PRIMERA_MEMBER_INVALID_AMOUNT);
- OUTPUT_HTML("<br />");
} elseif ($_POST['amount'] < getConfig('primera_min_payout')) {
// Not enougth entered!
LOAD_TEMPLATE("admin_settings_saved", false, sprintf(PRIMERA_MEMBER_AMOUNT_SMALLER_MIN, bigintval(getConfig('primera_min_payout'))));
- OUTPUT_HTML("<br />");
} elseif ($_POST['amount'] > $points) {
// Not enougth points left!
LOAD_TEMPLATE("admin_settings_saved", false, sprintf(PRIMERA_MEMBER_PAYOUT_POINTS_DEPLETED, bigintval($_POST['amount']), bigintval($points)));
- OUTPUT_HTML("<br />");
} else {
// All is fine here so do the payout
$success = PRIMERA_EXECUTE_PAYOUT($_POST['primera_nickname'], md5($_POST['primera_password']), $_POST['amount']);
} elseif ((GET_PRIMERA_ERROR_CODE() == "user_failed") || (GET_PRIMERA_ERROR_CODE() == "own_failed") || (GET_PRIMERA_ERROR_CODE() == "amount_failed") || (GET_PRIMERA_ERROR_CODE() == "api_amount_failed")) {
// Wrong login data
LOAD_TEMPLATE("admin_settings_saved", false, GET_PRIMERA_ERROR_MESSAGE());
- OUTPUT_HTML("<br />");
} else {
// Something went wrong
LOAD_TEMPLATE("admin_settings_saved", false, sprintf(PRIMERA_MEMBER_PAYOUT_FAILED, GET_PRIMERA_ERROR_MESSAGE()));
- OUTPUT_HTML("<br />");
}
}
break;
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']));
+ LOAD_TEMPLATE("admin_settings_saved", false, sprintf(getMessage('MEMBER_REFBACK_ERROR_MESSAGE'), $status['message']));
} else {
// No message found
- LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_REFBACK_ERROR_EMPTY_MESSAGE);
+ LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_REFBACK_ERROR_EMPTY_MESSAGE'));
}
} else {
// Percents out-of-bounds ;-)
- LOAD_TEMPLATE("admin_settings_saved", false, sprintf(MEMBER_REFBACK_ERROR_OUT_OF_BOUNDS, getConfig('refback_min_perc'), getConfig('refback_max_perc')));
+ LOAD_TEMPLATE("admin_settings_saved", false, sprintf(getMessage('MEMBER_REFBACK_ERROR_OUT_OF_BOUNDS'), getConfig('refback_min_perc'), getConfig('refback_max_perc')));
}
// Insert line
- OUTPUT_HTML("<br />");
} else {
// Read data from refback table
$content = GET_USER_REF_ENTRY($_POST['id']);
}
// 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);
// 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__);
}
if (empty($_POST['wds66_id'])) {
// Nothing entered in WDS66 user ID
LOAD_TEMPLATE("admin_settings_saved", false, WERNIS_MEMBER_EMPTY_USERNAME);
- OUTPUT_HTML("<br />");
} elseif (empty($_POST['wds66_password'])) {
// Nothing entered in WDS66 password
LOAD_TEMPLATE("admin_settings_saved", false, WERNIS_MEMBER_EMPTY_PASSWORD);
- OUTPUT_HTML("<br />");
} elseif (empty($_POST['amount'])) {
// Nothing entered in amount
LOAD_TEMPLATE("admin_settings_saved", false, WERNIS_MEMBER_EMPTY_AMOUNT);
- OUTPUT_HTML("<br />");
} elseif ($_POST['wds66_id'] != bigintval($_POST['wds66_id'])) {
// Only numbers in account ID!
LOAD_TEMPLATE("admin_settings_saved", false, WERNIS_MEMBER_INVALID_USERNAME);
- OUTPUT_HTML("<br />");
} elseif ($_POST['amount'] != bigintval($_POST['amount'])) {
// Only numbers in amount!
LOAD_TEMPLATE("admin_settings_saved", false, WERNIS_MEMBER_INVALID_AMOUNT);
- OUTPUT_HTML("<br />");
} else {
// Check input data depending on the mode and execute the requested mode
switch ($_GET['mode']) {
if ($_POST['amount'] < getConfig('wernis_min_withdraw')) {
// Not enougth entered!
LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_AMOUNT_SMALLER_MIN, bigintval(getConfig('wernis_min_withdraw'))));
- OUTPUT_HTML("<br />");
} else {
// All is fine here so do the withdraw
$success = WERNIS_EXECUTE_WITHDRAW($_POST['wds66_id'], md5($_POST['wds66_password']), $_POST['amount']);
} elseif ((GET_WERNIS_ERROR_CODE() == "user_failed") || (GET_WERNIS_ERROR_CODE() == "own_failed") || (GET_WERNIS_ERROR_CODE() == "amount_failed")) {
// Wrong login data
LOAD_TEMPLATE("admin_settings_saved", false, GET_WERNIS_ERROR_MESSAGE());
- OUTPUT_HTML("<br />");
} else {
// Something went wrong
LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_WITHDRAW_FAILED, GET_WERNIS_ERROR_MESSAGE()));
- OUTPUT_HTML("<br />");
}
}
break;
if ($_POST['amount'] < getConfig('wernis_min_payout')) {
// Not enougth entered!
LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_AMOUNT_SMALLER_MIN, bigintval(getConfig('wernis_min_payout'))));
- OUTPUT_HTML("<br />");
} elseif ($_POST['amount'] > $points) {
// Not enougth points left!
LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_PAYOUT_POINTS_DEPLETED, bigintval($_POST['amount']), bigintval($points)));
- OUTPUT_HTML("<br />");
} else {
// All is fine here so do the withdraw
$success = WERNIS_EXECUTE_PAYOUT($_POST['wds66_id'], $_POST['amount']);
} elseif ((GET_WERNIS_ERROR_CODE() == "user_failed") || (GET_WERNIS_ERROR_CODE() == "own_failed") || (GET_WERNIS_ERROR_CODE() == "amount_failed") || (GET_WERNIS_ERROR_CODE() == "api_amount_failed")) {
// Wrong login data
LOAD_TEMPLATE("admin_settings_saved", false, GET_WERNIS_ERROR_MESSAGE());
- OUTPUT_HTML("<br />");
} else {
// Something went wrong
LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_WITHDRAW_FAILED, GET_WERNIS_ERROR_MESSAGE()));
- OUTPUT_HTML("<br />");
}
}
break;
// 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`
-WHERE status='CONFIRMED'".$whereStatement1." AND beg_points > 0
+WHERE `status`='CONFIRMED'".$whereStatement1." AND beg_points > 0
ORDER BY beg_points DESC, userid
LIMIT %s",
array($whereStatement2), __FILE__, __LINE__);
if (($curr != getConfig('last_month')) && (getConfig('bonus_ranks') > 0) && ($CSS != 1)) {
// Extension "autopurge" is inactive or purging of inactive accounts is deactivated
- $whereStatement1 = "WHERE status='CONFIRMED'";
+ $whereStatement1 = "WHERE `status`='CONFIRMED'";
$whereStatement2 = bigintval(getConfig('bonus_ranks'));
// Shall I keep inactive members away from here? (mostly wanted in an "active-rallye" ...)
// Use last online stamp only when autopurge for inactive members is activated
if (getConfig('ap_inactive_since') > 0) {
// Okay, include last online timestamp
- $whereStatement1 = sprintf("WHERE status='CONFIRMED' AND last_online >= (UNIX_TIMESTAMP() - %s)", getConfig('ap_inactive_since'));
+ $whereStatement1 = sprintf("WHERE `status`='CONFIRMED' AND last_online >= (UNIX_TIMESTAMP() - %s)", getConfig('ap_inactive_since'));
$whereStatement2 = bigintval(getConfig('bonus_ranks'));
} // END - if
} // END - if
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
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";
// 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),
+WHERE `status`='CONFIRMED' AND receive_mails > 0 ".PREPARE_SQL_HTML_HOLIDAY($mode),
__FILE__, __LINE__);
// Get num rows
$uid_cnt = 0;
while (list($ucat) = SQL_FETCHROW($result_uids)) {
$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",
+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 ((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__);
}
);
// 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];
}
// 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)
// 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
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
+WHERE d.`status`='CONFIRMED' AND d.userid=%s AND b.%s=%s
LIMIT 1",
array(bigintval($_GET['uid']), $t, bigintval($_GET['d'])), __FILE__, __LINE__);