// Is the admin logged-in and no sql_patches installed?
if ((IS_ADMIN()) && (!EXT_IS_ACTIVE('sql_patches'))) {
// Extension 'sql_patches' is missing!
- LOAD_URL("modules.php?module=admin&sql_patches=1");
+ LOAD_URL('modules.php?module=admin&sql_patches=1');
} else {
// Default redirect
- LOAD_URL("modules.php?module=admin");
+ LOAD_URL('modules.php?module=admin');
}
} else {
// You have to install first!
// Check for new holiday extension
if (GET_EXT_VERSION('holiday') >= '0.1.3') {
// Include only users with no active holiday
- $EXCLUDE_LIST .= " AND d.holiday_active='N'";
+ $EXCLUDE_LIST .= " AND d.`holiday_active`='N'";
} // END - if
// Check for all accounts
//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, ": LOAD!");
if ($logout === true) {
// Then redirect to logout
- LOAD_URL("modules.php?module=admin&logout=1&".$EXT_LOAD_MODE."=sql_patches");
+ LOAD_URL('modules.php?module=admin&logout=1&' . $EXT_LOAD_MODE . '=sql_patches');
} else {
// Add temporary filter
REGISTER_FILTER('shutdown', 'REDIRECT_TO_LOGOUT_SQL_PATCHES', true, true);
if ((EXT_GET_CURR_NAME() == 'sql_patches') && (($load_mode == 'register') || ($load_mode == 'remove'))) {
// Then redirect to logout
//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, ": LOAD!");
- LOAD_URL("modules.php?module=admin&logout=1&".$load_mode."=sql_patches");
+ LOAD_URL('modules.php?module=admin&logout=1&' . $load_mode . '=sql_patches');
} // END - if
}
if ((!isInstalled()) || (isInstalling()) || (empty($ext_name))) return false;
// Not active is the default
- $active = "N";
+ $active = 'N';
// Check cache
if (isset($GLOBALS['cache_array']['extensions']['ext_active'][$ext_name])) {
// Is the element set?
if (isset($GLOBALS['ext_load_mode'])) {
// Redirect here
- LOAD_URL("modules.php?module=admin&logout=1&".$GLOBALS['ext_load_mode']."=sql_patches");
+ LOAD_URL('modules.php?module=admin&logout=1&' . $GLOBALS['ext_load_mode'] . '=sql_patches');
} // END - if
// This should not happen!
- DEBUG_LOG(__FUNCTION__, __LINE__, "Cannot auto-logout because no extension load-mode has been set.");
+ DEBUG_LOG(__FUNCTION__, __LINE__, 'Cannot auto-logout because no extension load-mode has been set.');
}
// Filter for auto-activation of a extension
// Don't de-refer our own links!
if (substr($URL, 0, strlen(URL)) != URL) {
// De-refer this link
- $URL = "modules.php?module=loader&url=".encodeString(compileUriCode($URL));
+ $URL = 'modules.php?module=loader&url=' . encodeString(compileUriCode($URL));
} // END - if
// Return link
// Translate Uni*-like gender to human-readable
function TRANSLATE_GENDER ($gender) {
// Default
- $ret = "!{$gender}!";
+ $ret = '!' . $gender . '!';
// Male/female or company?
switch ($gender) {
- case "M": $ret = getMessage('GENDER_M'); break;
- case "F": $ret = getMessage('GENDER_F'); break;
- case "C": $ret = getMessage('GENDER_C'); break;
+ case 'M': $ret = getMessage('GENDER_M'); break;
+ case 'F': $ret = getMessage('GENDER_F'); break;
+ case 'C': $ret = getMessage('GENDER_C'); break;
default:
// Log unknown gender
DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Unknown gender %s detected.", $gender));
}
return $ret;
}
+
//
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) {
switch ($status)
{
- case "UNCONFIRMED":
- case "CONFIRMED":
- case "LOCKED":
+ case 'UNCONFIRMED':
+ case 'CONFIRMED':
+ case 'LOCKED':
$ret = getMessage(sprintf("ACCOUNT_%s", $status));
break;
- case "":
+ case '':
case null:
$ret = getMessage('ACCOUNT_DELETED');
break;
$ret = $GLOBALS['cache_array']['language'];
} elseif (!empty($lang)) {
// Check if main language file does exist
- if (FILE_READABLE(constant('PATH')."inc/language/".$lang.".php")) {
+ if (FILE_READABLE(constant('PATH').'inc/language/'.$lang.'.php')) {
// Okay found, so let's update cookies
SET_LANGUAGE($lang);
}
set_session('mx_lang', $lang);
}
//
-function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID="0") {
+function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID='0') {
global $DATA, $_CONFIG;
// Make sure all template names are lowercase!
$template = strtolower($template);
// Default 'nickname' if extension is not installed
- $nick = "---";
+ $nick = '---';
// Prepare IP number and User Agent
$REMOTE_ADDR = GET_REMOTE_ADDR();
// Language definitions
define('ADMIN_ORDER_SETTINGS', "Einstellungen - Mailbuchung");
define('ADMIN_ORDER_MISC_SETTINGS', "Weitere Einstellungen");
-define('ORDER_MAX_ORDER_SELECT', "Wie viele Mailbuchungen sollen die Mitglieder maximal versenden können?");
-define('ORDER_MIN_RECEIVER_PER_ORDER', "Minimale Empfänger pro Mailbuchung");
+define('ADMIN_ORDER_MAX_ORDER_SELECT', "Wie viele Mailbuchungen sollen die Mitglieder maximal versenden können?");
+define('ADMIN_ORDER_MIN_RECEIVER_PER_ORDER', "Minimale Empfänger pro Mailbuchung");
define('ADMIN_ORDER_MAX', "So viele wie möglich.");
define('ADMIN_ORDER_ORDER', "So viele wie auf Empfang eingestellt.");
-define('ORDER_ALLOWED_RECEIVE', "Sie können heute noch <u>%s</u> von <u>%s</u> Mailbuchungen aufgeben.");
-define('ORDER_ALLOWED_MAX', "Sie können solange Mailbuchungen aufgeben, bis alle Mitglieder nicht mehr empfangsbereit sind.");
-define('ORDER_ALLOWED_UNKNOWN', "Fehler in Konfiguration erkannt! Bitte den Administrator benachrichtigen.");
+define('MEMBER_ORDER_ALLOWED_RECEIVE', "Sie können heute noch <u>%s</u> von <u>%s</u> Mailbuchungen aufgeben.");
+define('MEMBER_ORDER_ALLOWED_MAX', "Sie können solange Mailbuchungen aufgeben, bis alle Mitglieder nicht mehr empfangsbereit sind.");
+define('MEMBER_ORDER_ALLOWED_UNKNOWN', "Fehler in Konfiguration erkannt! Bitte den Administrator benachrichtigen.");
define('ADMIN_ORDER_SELECTION_COLUMN', "Tabellenspalte, nach der umsortiert werden soll");
define('ADMIN_ORDER_SELECTION_MODE', "Sortierreihenfolge");
define('ADMIN_ORDER_SELECTION_SETTINGS', "Auswahlverfahren der Empfänger");
// Unlock account
ADD_SQL(SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data`
-SET holiday_active='N', holiday_activated='0'
+SET `holiday_active`='N', holiday_activated='0'
WHERE userid=%s LIMIT 1", array(bigintval($content['userid'])), __FUNCTION__, __LINE__, false));
// Prepare array
require($INC);
}
-function ORDER_SELECT_OPTION_LIST($default) {
+function ORDER_SELECT_OPTION_LIST ($default) {
// Currenty the list is hardcoded...
- $LIST = array('userid', "zip", 'country', 'email', "birth_year", "last_online", "ref_clicks", "total_logins", "mail_orders");
+ $LIST = array('userid', 'zip', 'country', 'email', 'birth_year', 'last_online', 'ref_clicks', 'total_logins', 'mail_orders');
$OUT = '';
foreach ($LIST as $item) {
$selected = '';
if ($item == $default) $selected = ' selected="selected"';
- $OUT .= "<option value=\"".$item."\"".$selected.">{--ORDER_SELECT_COLUMN_".strtoupper($item)."--}</option>\n";
- }
+ $OUT .= '<option value="' . $item . '"' . $selected . '>{--ORDER_SELECT_COLUMN_' . strtoupper($item) . '--}</option>';
+ } // END - foreach
// Return the output
return $OUT;
if (EXT_IS_ACTIVE('beg')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('beg_uid')."";
if (EXT_IS_ACTIVE('bonus')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('bonus_uid')."";
if (EXT_IS_ACTIVE('doubler')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('doubler_uid')."";
- if (GET_EXT_VERSION('holiday') >= '0.1.3') $EXCLUDE_LIST .= " AND d.holiday_active='N'";
+ if (GET_EXT_VERSION('holiday') >= '0.1.3') $EXCLUDE_LIST .= " AND d.`holiday_active`='N'";
// Check for all accounts
ADD_SQL("SELECT DISTINCT d.userid, d.email, d.last_online
list($uid) = SQL_FETCHROW($result);
// Rewrite email address to contact link
- $email = "{!URL!}/modules.php?module=".$mod."&what=user_contct&uid=".bigintval($uid);
+ $email = '{!URL!}/modules.php?module=' . $mod . '&what=user_contct&uid=' . bigintval($uid);
} // END - if
// Free memory
$refid = 0;
// Is the extension version fine?
- if (GET_EXT_VERSION('user') >= "0.3.4") {
+ if (GET_EXT_VERSION('user') >= '0.3.4') {
// Get all user ids
$totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", 'userid', "status", true, " AND `rand_confirmed` >= ".getConfig('user_min_confirmed')."");
// Add last_login if available
$lastOnline = '';
if (GET_EXT_VERSION('sql_patches') >= '0.2.8') {
- $lastOnline = ", last_login";
+ $lastOnline = ', last_login';
} // END - if
// Init array
$content = array(
- 'password' => "",
- 'userid' => "",
+ 'password' => '',
+ 'userid' => '',
'last_online' => 0,
'last_login' => 0,
- 'hash' => ""
+ 'hash' => ''
);
// Check login data
// Procedure to checking for login data
if (($GLOBALS['bonus_payed']) && (EXT_IS_ACTIVE('bonus'))) {
// Bonus added (just displaying!)
- $URL = "modules.php?module=chk_login&mode=bonus";
+ $URL = 'modules.php?module=chk_login&mode=bonus';
} else {
// Bonus not added
- $URL = "modules.php?module=chk_login&mode=login";
+ $URL = 'modules.php?module=chk_login&mode=login';
}
} else {
// Cannot update counter!
- $URL = "modules.php?module=index&what=login&login=".getCode('CNTR_FAILED');
+ $URL = 'modules.php?module=index&what=login&login='.getCode('CNTR_FAILED');
}
} else {
// Cookies not setable!
- $URL = "modules.php?module=index&what=login&login=".getCode('NO_COOKIES');
+ $URL = 'modules.php?module=index&what=login&login='.getCode('NO_COOKIES');
}
} elseif (GET_EXT_VERSION('sql_patches') >= '0.6.1') {
// Update failture counter
array($uid), __FUNCTION__, __LINE__);
// Wrong password!
- $URL = "modules.php?module=index&what=login&login=".getCode('WRONG_PASS');
+ $URL = 'modules.php?module=index&what=login&login='.getCode('WRONG_PASS');
}
} elseif ((($probe_nickname) && (!empty($content['userid']))) || ($content['userid'] == $uid)) {
// Other account status?
}
// Construct URL
- $URL = "modules.php?module=index&what=login&login=".$errorCode;
+ $URL = 'modules.php?module=index&what=login&login='.$errorCode;
} else {
// ID not found!
- $URL = "modules.php?module=index&what=login&login=".getCode('WRONG_ID');
+ $URL = 'modules.php?module=index&what=login&login='.getCode('WRONG_ID');
}
// Return URL
// Try to send a new password for the given user account
function USER_DO_NEW_PASSWORD ($email, $uid) {
// Compile email when found in address (only secure chars!)
- if (!empty($email)) $email = str_replace("{DOT}", '.', $email);
+ if (!empty($email)) $email = str_replace('{DOT}', '.', $email);
// Init result and error
$errorCode = '';
array($email), __FUNCTION__, __LINE__);
} else {
// Userid not set!
- DEBUG_LOG(__FUNCTION__, __LINE__, "Userid is not set! BUG!");
+ DEBUG_LOG(__FUNCTION__, __LINE__, 'Userid is not set! BUG!');
$errorCode = getCode('WRONG_ID');
}
// This data is valid, so we create a new pass... :-)
list($uid, $status) = SQL_FETCHROW($result);
- if ($status == "CONFIRMED") {
+ 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",
array(generateHash($NEW_PASS), $uid), __FUNCTION__, __LINE__);
// Prepare data and message for email
- $msg = LOAD_EMAIL_TEMPLATE("new-pass", array('new_pass' => $NEW_PASS), $uid);
+ $msg = LOAD_EMAIL_TEMPLATE('new-pass', array('new_pass' => $NEW_PASS), $uid);
// ... and send it away
SEND_EMAIL($uid, getMessage('GUEST_NEW_PASSWORD'), $msg);
$errorCode = GEN_ERROR_CODE_FROM_ACCOUNT_STATUS($status);
// Load URL
- LOAD_URL("modules.php?module=index&what=login&login=".$errorCode);
+ LOAD_URL('modules.php?module=index&what=login&login='.$errorCode);
}
} else {
// ID or email is wrong
- LOAD_TEMPLATE('admin_settings_saved', false, "<span class=\"guest_failed\">{--GUEST_WRONG_ID_EMAIL--}</span>");
+ LOAD_TEMPLATE('admin_settings_saved', false, '<span class="guest_failed">{--GUEST_WRONG_ID_EMAIL--}</span>');
}
// Return the error code
$UIDs[] = $content['userid'];
} else {
// Send normal notification mail to the members
- $message = LOAD_EMAIL_TEMPLATE("beg_".$MODE."_notify", array(), $content['userid']);
+ $message = LOAD_EMAIL_TEMPLATE('beg_' . $MODE . '_notify', array(), $content['userid']);
SEND_EMAIL($content['email'], $subject, $message);
}
} // END - while
$RECEIVER = implode(';', $UIDs);
// Prepare URL
- $URL = "modules.php?module=index&what=login";
+ $URL = 'modules.php?module=index&what=login';
// Insert mail
ADD_BONUS_MAIL_TO_QUEUE($subject, $message, $RECEIVER, getConfig('beg_notify_bonus'), getConfig('beg_notify_wait'), $URL, 0, 'normal', SQL_NUMROWS($result_main));
$subject = constant('BONUS_RALLYE_'.strtoupper($MODE).'_NOTIFY');
// Load message body for bonus mails
- $message = LOAD_EMAIL_TEMPLATE("bonus_en_notify_body", '', "{PER}uid{PER}");
+ $message = LOAD_EMAIL_TEMPLATE('bonus_en_notify_body', '', '{PER}uid{PER}');
$RECEIVER = ''; $UIDs = array();
// Check for accounts to be notified
$UIDs[] = $content['userid'];
} else {
// Send normal notification mail to the members
- $message = LOAD_EMAIL_TEMPLATE("bonus_".$MODE."_notify", array(), $content['userid']);
+ $message = LOAD_EMAIL_TEMPLATE('bonus_' . $MODE . '_notify', array(), $content['userid']);
SEND_EMAIL($content['email'], $subject, $message);
}
} // END - while
$RECEIVER = implode(';', $UIDs);
// Prepare URL
- $URL = "modules.php?module=index&what=login";
+ $URL = 'modules.php?module=index&what=login';
// Insert mail
ADD_BONUS_MAIL_TO_QUEUE($subject, $message, $RECEIVER, getConfig('bonus_notify_points'), getConfig('bonus_notify_wait'), $URL, 0, 'normal', SQL_NUMROWS($result_main));
$done = changeDataInFile(constant('PATH')."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0);
if ($done === true) {
// Registering is done
- LOAD_URL("modules.php?module=admin&register=done");
+ LOAD_URL('modules.php?module=admin&register=done');
} else {
$ret = getMessage('ADMIN_CANNOT_COMPLETE');
}
break;
- case "failed":
+ case 'failed':
$ret = getMessage('ADMIN_REGISTER_FAILED');
break;
- case "already":
+ case 'already':
default:
- if ($ret == "already") {
+ if ($ret == 'already') {
// Admin does already exists!
$ret = getMessage('ADMIN_LOGIN_ALREADY_REG');
} else {
// Any other kind will be logged and interpreted as 'done'
DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown return code %s from CHECK_ADMIN_LOGIN() and interpreted as 'done'!", $ret));
// @TODO Why is this set to 'done'?
- $ret = "done";
+ $ret = 'done';
}
// Admin still not registered?
changeDataInFile(constant('PATH')."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0);
// Load URL for login
- LOAD_URL("modules.php?module=admin");
+ LOAD_URL('modules.php?module=admin');
} // END - if
break;
}
}
// Whas that action okay?
- if ($ret != "done") {
- // Fixes another "Notice"
+ if ($ret != 'done') {
+ // Fixes another notice
if (REQUEST_ISSET_POST(('login'))) {
define('__LOGIN_VALUE', REQUEST_POST('login'));
} else {
define('__LOGIN_VALUE', '');
}
- // Yet-another "Notice" fix
- if ((IS_FORM_SENT()) && (REQUEST_POST('ok') == "***")) {
+ // Yet-another notice-fix
+ if ((IS_FORM_SENT()) && (REQUEST_POST('ok') == '***')) {
// No login entered?
if (!REQUEST_ISSET_POST(('login'))) $loginMessage = getMessage('ADMIN_NO_LOGIN');
if (strlen(REQUEST_POST('pass')) < 4) $passwdMessage = getMessage('ADMIN_SHORT_PASS');
// Output error messages
- define('__MSG_LOGIN', LOAD_TEMPLATE("admin_login_msg", true, $loginMessage));
- define('__MSG_PASS', LOAD_TEMPLATE("admin_login_msg", true, $passwdMessage));
+ define('__MSG_LOGIN', LOAD_TEMPLATE('admin_login_msg', true, $loginMessage));
+ define('__MSG_PASS', LOAD_TEMPLATE('admin_login_msg', true, $passwdMessage));
// Reset variables
$loginMessage = ''; $passwdMessage = '';
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_NOT_REGISTERED'));
// Load register template
- LOAD_TEMPLATE("admin_reg_form");
+ LOAD_TEMPLATE('admin_reg_form');
}
} elseif (REQUEST_ISSET_GET(('reset_pass'))) {
// Is the form submitted?
LOAD_TEMPLATE('admin_settings_saved', false, $OUT);
} elseif (REQUEST_ISSET_GET(('hash'))) {
// Output form for hash validation
- LOAD_TEMPLATE("admin_validate_reset_hash_form", false, REQUEST_GET('hash'));
+ LOAD_TEMPLATE('admin_validate_reset_hash_form', false, REQUEST_GET('hash'));
} elseif ((REQUEST_ISSET_POST(('validate_hash'))) && (REQUEST_ISSET_POST(('login'))) && (REQUEST_ISSET_POST(('hash')))) {
// Validate the login data and hash
$valid = ADMIN_VALIDATE_RESET_LINK_HASH_LOGIN(REQUEST_POST('hash'), REQUEST_POST('login'));
);
// Validation okay so display form for final password change
- LOAD_TEMPLATE("admin_reset_password_form", false, $content);
+ LOAD_TEMPLATE('admin_reset_password_form', false, $content);
} else {
// Cannot validate the login data and hash
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_VALIDATION_RESET_LOGIN_HASH_FAILED'));
$OUT = ADMIN_RESET_PASSWORD(REQUEST_POST('login'), REQUEST_POST('pass1'));
// Output result
- LOAD_TEMPLATE("admin_reset_pass_done", false, $OUT);
+ LOAD_TEMPLATE('admin_reset_pass_done', false, $OUT);
} else {
// Validation failed
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_VALIDATION_RESET_LOGIN_HASH_FAILED2'));
}
} else {
// Output reset password form
- LOAD_TEMPLATE("admin_send_reset_link");
+ LOAD_TEMPLATE('admin_send_reset_link');
}
} elseif ((!isSessionVariableSet('admin_login')) || (!isSessionVariableSet('admin_md5')) || (!isSessionVariableSet('admin_last')) || (!isSessionVariableSet('admin_to')) || ((get_session('admin_last') + bigintval(get_session('admin_to')) * 3600 * 24) < time())) {
// At leat one administrator account was created
if ((isSessionVariableSet('admin_login')) && (isSessionVariableSet('admin_md5')) && (isSessionVariableSet('admin_last')) && (isSessionVariableSet('admin_to'))) {
// Timeout for last login, we have to logout first!
- LOAD_URL("modules.php?module=admin&logout=1");
+ LOAD_URL('modules.php?module=admin&logout=1');
} // END - if
if (REQUEST_ISSET_GET(('register'))) {
// Registration of first admin is done
- if (REQUEST_GET('register') == "done") LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_REGISTER_DONE'));
+ if (REQUEST_GET('register') == 'done') LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_REGISTER_DONE'));
} // END - if
// Check if the admin has submitted data or not
if ((IS_FORM_SENT()) && ((!REQUEST_ISSET_POST(('login'))) || (!REQUEST_ISSET_POST(('pass'))) || (strlen(REQUEST_POST('pass')) < 4))) {
- REQUEST_SET_POST('ok', "***");
+ REQUEST_SET_POST('ok', '***');
} // END - if
- if ((IS_FORM_SENT()) && (REQUEST_POST('ok') != "***")) {
+ if ((IS_FORM_SENT()) && (REQUEST_POST('ok') != '***')) {
// All required data was entered so we check his account
$ret = CHECK_ADMIN_LOGIN(REQUEST_POST('login'), REQUEST_POST('pass'));
// Which status do we have?
switch ($ret)
{
- case "done": // Admin and password are okay, so we log in now
+ case 'done': // Admin and password are okay, so we log in now
// Construct URL and redirect
- $URL = "modules.php?module=admin&";
+ $URL = 'modules.php?module=admin&';
// Rewrite overview module
- if ($GLOBALS['what'] == "overview") {
+ if ($GLOBALS['what'] == 'overview') {
$GLOBALS['action'] = GET_ACTION($GLOBALS['module'], $GLOBALS['what']);
} // END - if
// Add data to URL
- if (!empty($GLOBALS['what'])) $URL .= "what=".$GLOBALS['what'];
- elseif (!empty($GLOBALS['action'])) $URL .= "action=".$GLOBALS['action'];
- elseif (REQUEST_ISSET_GET('area')) $URL .= "area=".REQUEST_GET('area');
+ if (!empty($GLOBALS['what'])) $URL .= 'what='.$GLOBALS['what'];
+ elseif (!empty($GLOBALS['action'])) $URL .= 'action='.$GLOBALS['action'];
+ elseif (REQUEST_ISSET_GET('area')) $URL .= 'area='.REQUEST_GET('area');
// Load URL
LOAD_URL($URL);
break;
- case "404": // Administrator login not found
+ case '404': // Administrator login not found
REQUEST_SET_POST('ok', $ret);
$ret = getMessage('ADMIN_NOT_FOUND');
destroyAdminSession();
case 'pass': // Wrong password
REQUEST_SET_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>]';
destroyAdminSession();
break;
// Error detected?
// @TODO Rewrite all these constants
- if ($ret != "done") {
+ if ($ret != 'done') {
if (REQUEST_ISSET_POST(('login'))) {
define('__LOGIN_VALUE', REQUEST_POST('login'));
} else {
if (!REQUEST_ISSET_POST(('login'))) $loginMessage = getMessage('ADMIN_NO_LOGIN');
// An error comes back from login?
- if ((!empty($ret)) && (REQUEST_POST('ok') == "404")) $loginMessage = $ret;
+ if ((!empty($ret)) && (REQUEST_POST('ok') == '404')) $loginMessage = $ret;
// No password entered?
if (!REQUEST_ISSET_POST(('pass'))) $passwdMessage = getMessage('ADMIN_NO_PASS');
if ((!empty($ret)) && (REQUEST_POST('ok') == 'pass')) $passwdMessage = $ret;
// Load message template
- define('__MSG_LOGIN', LOAD_TEMPLATE("admin_login_msg", true, $loginMessage));
- define('__MSG_PASS' , LOAD_TEMPLATE("admin_login_msg", true, $passwdMessage));
+ define('__MSG_LOGIN', LOAD_TEMPLATE('admin_login_msg', true, $loginMessage));
+ define('__MSG_PASS' , LOAD_TEMPLATE('admin_login_msg', true, $passwdMessage));
// Reset variables
unset($loginMessage);
// Load login form
if (!empty($GLOBALS['what'])) {
// Restore old what value
- $content = array('target' => "what", 'value' => $GLOBALS['what']);
+ $content = array('target' => 'what', 'value' => $GLOBALS['what']);
} elseif (!empty($GLOBALS['action'])) {
- if ($GLOBALS['action'] != "logout") {
+ if ($GLOBALS['action'] != 'logout') {
// Restore old action value
- $content = array('target' => "action", 'value' => $GLOBALS['action']);
+ $content = array('target' => 'action', 'value' => $GLOBALS['action']);
} else {
// Set default values
- $content = array('target' => "action", 'value' => "login");
+ $content = array('target' => 'action', 'value' => 'login');
}
} elseif (REQUEST_ISSET_GET('area')) {
// Restore old area value
- $content = array('target' => "area", 'value' => REQUEST_GET('area'));
+ $content = array('target' => 'area', 'value' => REQUEST_GET('area'));
} else {
// Set default values
- $content = array('target' => "action", 'value' => "login");
+ $content = array('target' => 'action', 'value' => 'login');
}
// Load login form template
- LOAD_TEMPLATE("admin_login_form", false, $content);
+ LOAD_TEMPLATE('admin_login_form', false, $content);
} // END - if
} elseif (REQUEST_ISSET_GET(('logout'))) {
// Only try to remove cookies
LOAD_TEMPLATE(sprintf("admin_logout_%s_remove", $remove));
} else {
// Logged out normally
- LOAD_TEMPLATE("admin_logout");
+ LOAD_TEMPLATE('admin_logout');
}
} else {
// Something went wrong here...
- LOAD_TEMPLATE('admin_settings_saved', false, "<div class=\"admin_fatal\">{--ADMIN_LOGOUT_FAILED--}</div>");
+ LOAD_TEMPLATE('admin_settings_saved', false, '<div class="admin_fatal">{--ADMIN_LOGOUT_FAILED--}</div>');
// Add fatal message
addFatalMessage(__FILE__, __LINE__, getMessage('CANNOT_UNREG_SESS'));
$ret = CHECK_ADMIN_COOKIES(get_session('admin_login'), get_session('admin_md5'));
switch ($ret)
{
- case "done":
+ case 'done':
// Check for access control line of current menu entry
$GLOBALS['acl_allow'] = runFilterChain('check_admin_acl');
// When type of admin menu is not set fallback to old menu system
- if (!isConfigEntrySet('admin_menu')) setConfigEntry('admin_menu', "OLD");
+ if (!isConfigEntrySet('admin_menu')) setConfigEntry('admin_menu', 'OLD');
- // Check for version and switch between old menu system and new "intelligent menu system"
- if ((ADMIN_CHECK_MENU_MODE() == "NEW") && (INCLUDE_READABLE("inc/modules/admin/lasys-inc.php"))) {
+ // Check for version and switch between old menu system and new intelligent menu system
+ if ((ADMIN_CHECK_MENU_MODE() == 'NEW') && (INCLUDE_READABLE('inc/modules/admin/lasys-inc.php'))) {
// Default area is the entrance, of course
- $area = "entrance";
+ $area = 'entrance';
// Check for similar URL variable
if (REQUEST_ISSET_GET('area')) $area = REQUEST_GET('area');
- // Load "logical-area menu-system" file
- LOAD_INC_ONCE("inc/modules/admin/lasys-inc.php");
+ // Load logical-area menu-system file
+ LOAD_INC_ONCE('inc/modules/admin/lasys-inc.php');
- // Create new-style menu system will "logical areas"
+ // Create new-style menu system will logical areas
ADMIN_LOGICAL_AREA_SYSTEM($area, $act, $GLOBALS['what']);
} else {
// This little call constructs the whole default old and lacky menu system
}
break;
- case "404": // Administrator login not found
+ case '404': // Administrator login not found
REQUEST_SET_POST('ok', $ret);
destroyAdminSession();
addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_NOT_FOUND'));
if (REQUEST_ISSET_POST(('no'))) {
// Do not logout now
- LOAD_URL("admin.php");
-} elseif ((REQUEST_ISSET_POST(('yes'))) && ($GLOBALS['action'] == "logout")) {
+ LOAD_URL('admin.php');
+} elseif ((REQUEST_ISSET_POST(('yes'))) && ($GLOBALS['action'] == 'logout')) {
// Redirect to logout link
- LOAD_URL("modules.php?module=admin&logout=1");
+ LOAD_URL('modules.php?module=admin&logout=1');
}
// Load logout form template
-LOAD_TEMPLATE("admin_logout_form");
+LOAD_TEMPLATE('admin_logout_form');
//
?>
if (!empty($id)) {
// Reload to prices...
- LOAD_URL("modules.php?module=admin&what=config_rallye_prices&rallye=".$id);
+ LOAD_URL('modules.php?module=admin&what=config_rallye_prices&rallye='.$id);
} else {
// Problem detected...
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('RALLYE_PROBLEM_CREATE'));
}
// Prepare some constants for the template
-define('_AUTO_ADD_OPTIONS', ADD_OPTION_LINES("/ARRAY/", array('Y','N'), array(YES, NO )));
-define('_ACTIVE_OPTIONS' , ADD_OPTION_LINES("/ARRAY/", array('N','Y'), array(NO , YES)));
-define('_NOTIFY_OPTIONS' , ADD_OPTION_LINES("/ARRAY/", array('Y','N'), array(YES, NO )));
+define('_AUTO_ADD_OPTIONS', ADD_OPTION_LINES('/ARRAY/', array('Y','N'), array(YES, NO )));
+define('_ACTIVE_OPTIONS' , ADD_OPTION_LINES('/ARRAY/', array('N','Y'), array(NO , YES)));
+define('_NOTIFY_OPTIONS' , ADD_OPTION_LINES('/ARRAY/', array('Y','N'), array(YES, NO )));
// Starting day
-define('_START_SEC' , ADD_SELECTION("sec" , "0" , "start"));
-define('_START_MIN' , ADD_SELECTION("min" , "0" , "start"));
-define('_START_HOUR' , ADD_SELECTION("hour" , date("G", time()), "start"));
-define('_START_DAY' , ADD_SELECTION("day" , date("d", time()), "start"));
-define('_START_MONTH', ADD_SELECTION("month", date("m", time()), "start"));
-define('_START_YEAR' , ADD_SELECTION("year" , date('Y', time()), "start"));
+define('_START_SEC' , ADD_SELECTION('sec' , '0' , 'start'));
+define('_START_MIN' , ADD_SELECTION('min' , '0' , 'start'));
+define('_START_HOUR' , ADD_SELECTION('hour' , date('G', time()), 'start'));
+define('_START_DAY' , ADD_SELECTION('day' , date('d', time()), 'start'));
+define('_START_MONTH', ADD_SELECTION('month', date('m', time()), 'start'));
+define('_START_YEAR' , ADD_SELECTION('year' , date('Y', time()), 'start'));
// Calcualte ending date
-$D = date("d", time() + (getConfig('one_day') * 7));
-$M = date("m", time() + (getConfig('one_day') * 7));
+$D = date('d', time() + (getConfig('one_day') * 7));
+$M = date('m', time() + (getConfig('one_day') * 7));
$Y = date('Y', time() + (getConfig('one_day') * 7));
// Ending day
-define('_END_SEC' , ADD_SELECTION("sec" , "0" , "end"));
-define('_END_MIN' , ADD_SELECTION("min" , "0" , "end"));
-define('_END_HOUR' , ADD_SELECTION("hour" , date("G", time()), "end"));
-define('_END_DAY' , ADD_SELECTION("day" , $D , "end"));
-define('_END_MONTH', ADD_SELECTION("month", $M , "end"));
-define('_END_YEAR' , ADD_SELECTION("year" , $Y , "end"));
+define('_END_SEC' , ADD_SELECTION('sec' , '0' , 'end'));
+define('_END_MIN' , ADD_SELECTION('min' , '0' , 'end'));
+define('_END_HOUR' , ADD_SELECTION('hour' , date('G', time()), 'end'));
+define('_END_DAY' , ADD_SELECTION('day' , $D , 'end'));
+define('_END_MONTH', ADD_SELECTION('month', $M , 'end'));
+define('_END_YEAR' , ADD_SELECTION('year' , $Y , 'end'));
// Transfer (maybe found) templates into constant for the template
define('_TEMPLATES', RALLYE_TEMPLATE_SELECTION());
// Load template
-LOAD_TEMPLATE("admin_add_rallye");
+LOAD_TEMPLATE('admin_add_rallye');
//
?>
// Update user's account
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data`
-SET holiday_active='N', holiday_activated='0'
+SET `holiday_active`='N', holiday_activated='0'
WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__);
// Remove holiday
LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('ADMIN_SPONSOR_DELETED'), bigintval(REQUEST_GET('id'))));
} elseif (REQUEST_ISSET_POST(('no'))) {
// Do not delete him...
- LOAD_URL("modules.php?module=admin&what=list_sponsor&id=".bigintval(REQUEST_GET('id')));
+ LOAD_URL('modules.php?module=admin&what=list_sponsor&id='.bigintval(REQUEST_GET('id')));
} else {
// Load data
list ($email, $gender, $sname, $fname) = SQL_FETCHROW($result);
define('__UID' , bigintval(REQUEST_GET('id')));
// Display form
- LOAD_TEMPLATE("admin_del_sponsor");
+ LOAD_TEMPLATE('admin_del_sponsor');
}
} else {
// Sponsor not found!
// Show next link
if (EXT_IS_ACTIVE('task')) {
- LOAD_TEMPLATE("admin_next_link", false, array(
- 'url' => "modules.php?module=admin&what=list_task",
+ LOAD_TEMPLATE('admin_next_link', false, array(
+ 'url' => 'modules.php?module=admin&what=list_task',
'title' => getMessage('ADMIN_EXT_REGISTER_NEXT_LINK')
));
} else {
- LOAD_TEMPLATE("admin_next_link", false, array(
- 'url' => "modules.php?module=admin",
+ LOAD_TEMPLATE('admin_next_link', false, array(
+ 'url' => 'modules.php?module=admin',
'title' => getMessage('ADMIN_EXT_REGISTER_NEXT_LINK')
));
}
// Do we need to update cache file?
- if ((EXT_IS_ACTIVE('cache')) && ($GLOBALS['cache_mode'] != "no")) {
+ // @TODO Rewrite this to a filter
+ if ((EXT_IS_ACTIVE('cache')) && ($GLOBALS['cache_mode'] != 'no')) {
// Remove cache file (will be auto-created again!)
- if ($GLOBALS['cache_instance']->loadCacheFile("config")) $GLOBALS['cache_instance']->destroyCacheFile();
- if ($GLOBALS['cache_instance']->loadCacheFile("extensions", true)) $GLOBALS['cache_instance']->destroyCacheFile();
- if ($GLOBALS['cache_instance']->loadCacheFile("modreg")) $GLOBALS['cache_instance']->destroyCacheFile();
+ if ($GLOBALS['cache_instance']->loadCacheFile('config')) $GLOBALS['cache_instance']->destroyCacheFile();
+ if ($GLOBALS['cache_instance']->loadCacheFile('extensions', true)) $GLOBALS['cache_instance']->destroyCacheFile();
+ if ($GLOBALS['cache_instance']->loadCacheFile('modreg')) $GLOBALS['cache_instance']->destroyCacheFile();
} // END - if
- } elseif (GET_EXT_VERSION($ext_name) != "") {
+ } elseif (GET_EXT_VERSION($ext_name) != '') {
// Notify the admin that we have a problem here...
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_REG_FAILED_ALREADY'));
} else {
// Extension was not found in task management
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_REG_FAILED_ID_404'));
}
- } elseif ($task_found == "0") {
+ } elseif ($task_found == '0') {
// No longer assigned or old task
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_REG_FAILED_ASSIGED'));
} else {
if (EXT_IS_ACTIVE('beg')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('beg_uid')."";
if (EXT_IS_ACTIVE('bonus')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('bonus_uid')."";
if (EXT_IS_ACTIVE('doubler')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('doubler_uid')."";
-if (GET_EXT_VERSION('holiday') >= '0.1.3') $EXCLUDE_LIST .= " AND d.holiday_active='N'";
+if (GET_EXT_VERSION('holiday') >= '0.1.3') $EXCLUDE_LIST .= " AND d.`holiday_active`='N'";
// 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
ADMIN_CHANGE_ACTIVATION_STATUS(REQUEST_POST('id'), "countries", "is_active");
// Show next link
- LOAD_TEMPLATE("admin_next_link", false, array(
- 'url' => "modules.php?module=admin&what=list_country",
+ LOAD_TEMPLATE('admin_next_link', false, array(
+ 'url' => 'modules.php?module=admin&what=list_country',
'title' => getMessage('ADMIN_COUNTRY_ACTIVATION_NEXT_LINK')
));
} elseif (((REQUEST_ISSET_POST('edit')) || (REQUEST_ISSET_POST('delete'))) && (REQUEST_ISSET_POST(('id')))) {
if (count(REQUEST_POST('id')) > 0) {
if (REQUEST_ISSET_POST('edit')) {
// Edit template
- $row = "admin_list_country_edit_row";
+ $row = 'admin_list_country_edit_row';
$post = 'modify';
- $class = "admin_submit";
+ $class = 'admin_submit';
$submit = getMessage('ADMIN_COUNTRY_EDIT_NOW');
$title = getMessage('ADMIN_COUNTRY_EDIT_TITLE');
- $reset = "<input type=\"reset\" class=\"admin_reset\" value=\"{!UNDO_SELECTIONS!}\" /> *\n";
+ $reset = '<input type="reset" class="admin_reset" value="{!UNDO_SELECTIONS!}" /> *';
} else {
// Delete template
- $row = "admin_list_country_del_row";
+ $row = 'admin_list_country_del_row';
$post = 'remove';
- $class = "admin_delete";
+ $class = 'admin_delete';
$submit = getMessage('ADMIN_COUNTRY_DELETE_NOW');
$title = getMessage('ADMIN_COUNTRY_DELETE_TITLE');
$reset = '';
if ($post == 'modify') {
// Generate default selection in edit-mode
- $content['status'] = ADD_OPTION_LINES("/ARRAY/", array("Y","N"), array(YES, NO ), $status);
+ $content['status'] = ADD_OPTION_LINES('/ARRAY/', array('Y', 'N'), array(getMessage('YES'), getMessage('NO')), $status);
} else {
// Only display status when in delete-mode
$content['status'] = TRANSLATE_YESNO($status);
define('__COUNTRY_RESET' , $reset);
// Load main template
- LOAD_TEMPLATE("admin_list_country_form");
+ LOAD_TEMPLATE('admin_list_country_form');
}
} else {
// Shall we modify / remove entries now?
if ((REQUEST_ISSET_POST(('modify'))) && (REQUEST_ISSET_POST(('id')))) {
// Modify
foreach (REQUEST_POST('id') as $id => $sel) {
- ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_countries` SET code='".REQUEST_POST('code', $id)."', descr='".REQUEST_POST('descr', $id)."', is_active='".REQUEST_POST('is_active', $id)."' WHERE id='".$id."' LIMIT 1");
+ ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_countries` SET `code`='".REQUEST_POST('code', $id)."', `descr`='".REQUEST_POST('descr', $id)."', `is_active`='".REQUEST_POST('is_active', $id)."' WHERE `id`='".$id."' LIMIT 1");
}
// Create message
$message = getMessage('ADMIN_COUNTRIES_MODIFIED');
} elseif ((REQUEST_ISSET_POST('remove')) && (REQUEST_ISSET_POST(('id')))) {
// Remove
- $IDs = implode(",", array_keys(REQUEST_POST('id')));
- ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_countries` WHERE id IN (".$IDs.") LIMIT ".count(REQUEST_POST('id'))."");
+ $IDs = implode(',', array_keys(REQUEST_POST('id')));
+ ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_countries` WHERE `id` IN (".$IDs.") LIMIT ".count(REQUEST_POST('id'))."");
// Create message
$message = getMessage('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;
);
// Load row template and switch colors
- $OUT .= LOAD_TEMPLATE("admin_list_country_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('admin_list_country_row', true, $content);
$SW = 3 - $SW;
}
SQL_FREERESULT($result);
} else {
// No code setup so far (not possible by this software! 'DE' for 'Deutschland' is default
- $OUT = LOAD_TEMPLATE("admin_list_country_no_row", true);
+ $OUT = LOAD_TEMPLATE('admin_list_country_no_row', true);
}
// Add list to constant for the template
define('__COUNTRY_ROWS', $OUT);
// Include add template
- define('__ADD_COUNTRY_FORM', LOAD_TEMPLATE("admin_add_country", true));
+ define('__ADD_COUNTRY_FORM', LOAD_TEMPLATE('admin_add_country', true));
// Load main template
- LOAD_TEMPLATE("admin_list_country");
+ LOAD_TEMPLATE('admin_list_country');
}
//
array(bigintval(REQUEST_GET('id'))), __FILE__, __LINE__);
} elseif (REQUEST_ISSET_POST(('no'))) {
// No don't lock / unlock now!
- LOAD_URL("modules.php?module=admin&what=list_sponsor&id=".bigintval(REQUEST_GET('id')));
+ LOAD_URL('modules.php?module=admin&what=list_sponsor&id='.bigintval(REQUEST_GET('id')));
} else {
// Create header and text messages
- if ($status == "CONFIRMED") {
+ if ($status == 'CONFIRMED') {
// Messages when sponsor's account is confirmed
define('__HEADER_MESSAGE', getMessage('SPONSOR_LOCK_SPONSOR_HEADER'));
define('__TEXT_MESSAGE' , getMessage('SPONSOR_LOCK_SPONSOR_TEXT'));
}
// Create email link
- define('__EMAIL_LINK', "<a href=\"mailto:".$email."\">{!__GENDER!} {!__SURNAME!} {!__FAMILY!}</a>");
+ define('__EMAIL_LINK', '<a href="mailto:' . $email . '">{!__GENDER!} {!__SURNAME!} {!__FAMILY!}</a>');
// Display form
- LOAD_TEMPLATE("admin_lock_sponsor");
+ LOAD_TEMPLATE('admin_lock_sponsor');
}
} else {
// Cannot change status on unconfirmed or pending accounts!
$MODE = 'member';
} else {
// Matching line not found!
- LOAD_URL("modules.php?module=index&what=login");
+ LOAD_URL('modules.php?module=index&what=login');
}
// Free memory
SQL_FREERESULT($result);
} else {
// He is no longer logged in
- LOAD_URL("modules.php?module=index&what=login");
+ LOAD_URL('modules.php?module=index&what=login');
}
}
$url = constant('URL');
// Decode URL if set in GET parameters
- if (REQUEST_ISSET_GET(('url'))) $url = decodeString(str_replace(" ", "+", compileUriCode(urldecode(REQUEST_GET('url')))));
+ if (REQUEST_ISSET_GET(('url'))) $url = decodeString(str_replace(' ', '+', compileUriCode(urldecode(REQUEST_GET('url')))));
// Use URL from POST data if set
if (REQUEST_ISSET_POST(('url'))) $url = REQUEST_POST('url');
if (REQUEST_ISSET_GET(('frame'))) $frame = REQUEST_GET(('frame'));
switch ($frame)
{
- case "":
+ case '':
switch ($MODE)
{
case 'member':
// Build frameset
define('__ORDER_VALUE', bigintval(REQUEST_GET('order')));
define('__URL_VALUE' , DEREFERER($url));
- LOAD_TEMPLATE("member_order_frametester");
+ LOAD_TEMPLATE('member_order_frametester');
break;
case 'guest':
define('__URL_VALUE' , DEREFERER($url));
- LOAD_TEMPLATE("guest_frametester");
+ LOAD_TEMPLATE('guest_frametester');
break;
}
break;
- case "test_top":
- LOAD_TEMPLATE('admin_settings_saved', false, "<div class=\"guest_done\">{--GUEST_FRAMETESTER_TOP--}</span>");
+ case 'test_top':
+ LOAD_TEMPLATE('admin_settings_saved', false, '<div class="guest_done">{--GUEST_FRAMETESTER_TOP--}</span>');
break;
- case "back": // Back buttom
- LOAD_TEMPLATE("member_order_back", false, REQUEST_GET('order'));
+ case 'back': // Back buttom
+ LOAD_TEMPLATE('member_order_back', false, REQUEST_GET('order'));
break;
- case "send": // Send mail away
- LOAD_TEMPLATE("member_order_send", false, REQUEST_GET('order'));
+ case 'send': // Send mail away
+ LOAD_TEMPLATE('member_order_send', false, REQUEST_GET('order'));
break;
}
} else {
// Go away...
- LOAD_URL("modules.php?module=login");
+ LOAD_URL('modules.php?module=login');
}
//
?>
}
// A simple redirect...
-LOAD_URL("modules.php?module=admin");
+LOAD_URL('modules.php?module=admin');
//
?>
if (IS_MEMBER()) {
// Login immidiately...
- $URL = "modules.php?module=login";
-} elseif ((IS_FORM_SENT()) && ("".$uid."" != "".REQUEST_POST('id')."")) {
+ $URL = 'modules.php?module=login';
+} elseif ((IS_FORM_SENT()) && (''.$uid.'' != ''.REQUEST_POST('id').'')) {
// Invalid input (no nickname extension installed but nickname entered)
$errorCode = getCode('EXTENSION_PROBLEM');
} elseif (IS_FORM_SENT()) {
// Display login form with resend-password form
if (EXT_IS_ACTIVE('nickname')) {
- LOAD_TEMPLATE("guest_nickname_login");
+ LOAD_TEMPLATE('guest_nickname_login');
} else {
- LOAD_TEMPLATE("guest_login");
+ LOAD_TEMPLATE('guest_login');
}
// Was an URL constructed?
// URL was constructed
if (getTotalFatalErrors()) {
// Fatal errors!
- LOAD_INC_ONCE("inc/fatal_errors.php");
+ LOAD_INC_ONCE('inc/fatal_errors.php');
} else {
// Load URL
LOAD_URL($URL);
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'",
+WHERE d.`holiday_active`='Y'",
__FILE__, __LINE__);
list($holiday) = SQL_FETCHROW($result);
if (empty($holiday)) $holiday = 0;
// Some security stuff...
if (!defined('__SECURITY')) {
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+ $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4).'/security.php';
require($INC);
} elseif ((!EXT_IS_ACTIVE('sponsor'))) {
addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'sponsor');
switch (REQUEST_GET('mode'))
{
case 'activate' : $MODE = 'activate'; break; // Activation link requested
- case "lost_pass": $MODE = "lost_pass"; break; // Request new password
+ case 'lost_pass': $MODE = 'lost_pass'; break; // Request new password
}
} // END - if
$SPONSOR['pay'] = TRANSLATE_COMMA($SPONSOR['pay']);
// Unconfirmed account or changed email address?
- if ($SPONSOR['status'] == "UNCONFIRMED") {
+ 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",
- array(bigintval($SPONSOR['id']), REQUEST_GET('hash')), __FILE__, __LINE__);
+ array(bigintval($SPONSOR['id']), REQUEST_GET('hash')), __FILE__, __LINE__);
// Check on success
if (SQL_AFFECTEDROWS() == 1) {
// Prepare mail and send it to the sponsor
- $message = LOAD_EMAIL_TEMPLATE("sponsor_pending", $SPONSOR);
+ $message = LOAD_EMAIL_TEMPLATE('sponsor_pending', $SPONSOR);
SEND_EMAIL($SPONSOR['email'], getMessage('SPONSOR_ACCOUNT_PENDING_SUBJ'), $message);
// Send email to admin
- SEND_ADMIN_NOTIFICATION(getMessage('ADMIN_NEW_SPONSOR'), "admin_sponsor_pending", $SPONSOR);
+ SEND_ADMIN_NOTIFICATION(getMessage('ADMIN_NEW_SPONSOR'), 'admin_sponsor_pending', $SPONSOR);
// Sponsor account set to pending
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SPONSOR_ACCOUNT_IS_PENDING'));
// Could not unlock account!
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SPONSOR_ACCOUNT_PENDING_FAILED'));
}
- } elseif ($SPONSOR['status'] == "EMAIL") {
+ } 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",
- array(bigintval($SPONSOR['id']), REQUEST_GET('hash')), __FILE__, __LINE__);
+ array(bigintval($SPONSOR['id']), REQUEST_GET('hash')), __FILE__, __LINE__);
// Check on success
if (SQL_AFFECTEDROWS() == 1) {
$SPONSOR['sponsor_created'] = MAKE_DATETIME($SPONSOR['sponsor_created']);
// Prepare email and send it to the sponsor
- if ($SPONSOR['status'] == "UNCONFIRMED") {
+ if ($SPONSOR['status'] == 'UNCONFIRMED') {
// Unconfirmed accounts
- $msg_sponsor = LOAD_EMAIL_TEMPLATE("sponsor_activate", $SPONSOR);
+ $msg_sponsor = LOAD_EMAIL_TEMPLATE('sponsor_activate', $SPONSOR);
} else {
// Confirmed email address
- $msg_sponsor = LOAD_EMAIL_TEMPLATE("sponsor_email", $SPONSOR);
+ $msg_sponsor = LOAD_EMAIL_TEMPLATE('sponsor_email', $SPONSOR);
}
SEND_EMAIL(REQUEST_POST('email'), SPONSOR_ACTIVATION_LINK_SUBJ, $msg_sponsor);
SQL_FREERESULT($result);
} else {
// Load form
- LOAD_TEMPLATE("guest_sponsor_activate");
+ LOAD_TEMPLATE('guest_sponsor_activate');
}
-} elseif ($MODE == "lost_pass") {
+} elseif ($MODE == 'lost_pass') {
// Send new password
if (IS_FORM_SENT()) {
// Check submitted data
FROM `{!_MYSQL_PREFIX!}_sponsor_data`
WHERE email='%s' AND id='%s' AND `status`='CONFIRMED' LIMIT 1",
array(REQUEST_POST('email'), bigintval(REQUEST_POST('id'))), __FILE__, __LINE__);
+
// Entry found?
if (SQL_NUMROWS($result) == 1) {
// Unconfirmed sponsor account found so let's load the requested data
$SPONSOR['password'] = GEN_PASS();
// Prepare email and send it to the sponsor
- $msg_sponsor = LOAD_EMAIL_TEMPLATE("sponsor_lost", $SPONSOR);
+ $msg_sponsor = LOAD_EMAIL_TEMPLATE('sponsor_lost', $SPONSOR);
SEND_EMAIL(REQUEST_POST('email'), SPONSOR_LOST_PASSWORD_SUBJ, $msg_sponsor);
// Update password
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__);
+ array(md5($SPONSOR['password']), bigintval($SPONSOR['id'])), __FILE__, __LINE__);
// Output message
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SPONSOR_LOST_PASSWORD_SENT'));
SQL_FREERESULT($result);
} else {
// Load form
- LOAD_TEMPLATE("guest_sponsor_lost");
+ LOAD_TEMPLATE('guest_sponsor_lost');
}
} elseif (IS_FORM_SENT()) {
// Check status and login data ...
$result = SQL_QUERY_ESC("SELECT status FROM `{!_MYSQL_PREFIX!}_sponsor_data`
WHERE id='%s' AND password='%s' LIMIT 1",
array(bigintval(REQUEST_POST('sponsorid')), md5(REQUEST_POST('pass'))), __FILE__, __LINE__);
+
if (SQL_NUMROWS($result) == 1) {
// Okay, first login data check passed, now has he/she an approved (CONFIRMED) account?
list($status) = SQL_FETCHROW($result);
- if ($status == "CONFIRMED") {
+ if ($status == 'CONFIRMED') {
// Is confirmed so both is fine and we can continue with login procedure
$login = ((set_session('sponsorid' , bigintval(REQUEST_POST('sponsorid')))) &&
(set_session('sponsorpass', md5(REQUEST_POST('pass')) ))
);
- if ($login) {
+ if ($login === true) {
// Cookie setup successfull so we can forward to sponsor area
- LOAD_URL("modules.php?module=sponsor");
+ LOAD_URL('modules.php?module=sponsor');
} else {
// Cookie setup failed!
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SPONSPOR_COOKIE_SETUP_FAILED'));
// Login formular and other links
- LOAD_TEMPLATE("guest_sponsor_login");
+ LOAD_TEMPLATE('guest_sponsor_login');
}
} else {
// Status is not fine
LOAD_TEMPLATE('admin_settings_saved', false, $content);
// Login formular and other links
- LOAD_TEMPLATE("guest_sponsor_login");
+ LOAD_TEMPLATE('guest_sponsor_login');
}
} else {
- // Account missing or wrong pass! We shall not find this out for the "hacker folks"...
+ // Account missing or wrong pass! We shall not find this out for the "cracker folks"...
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SPONSOR_LOGIN_FAILED_404_WRONG_PASS'));
// Login formular and other links
- LOAD_TEMPLATE("guest_sponsor_login");
+ LOAD_TEMPLATE('guest_sponsor_login');
}
// Free memory
SQL_FREERESULT($result);
} else {
// Login formular and other links
- LOAD_TEMPLATE("guest_sponsor_login");
+ LOAD_TEMPLATE('guest_sponsor_login');
}
//
require($INC);
} elseif (!EXT_IS_ACTIVE('sql_patches')) {
// The extension 'sql_patches' *MUST* be activated or you have lot's of problems!
- LOAD_URL("admin.php");
+ LOAD_URL('admin.php');
}
// Load adverstising template
-define('__GUEST_ADVERT', LOAD_TEMPLATE("guest_advert", true));
+define('__GUEST_ADVERT', LOAD_TEMPLATE('guest_advert', true));
// Generate a tableset for the menu title and content
-LOAD_TEMPLATE("guest_header");
+LOAD_TEMPLATE('guest_header');
// Add code-message here
handleCodeMessage();
// Some of you needs this to be extracted into a template... ???
-LOAD_TEMPLATE("guest_menu_td");
+LOAD_TEMPLATE('guest_menu_td');
// When no what value is provided take the "home" value
if (empty($GLOBALS['what'])) $GLOBALS['what'] = getConfig('index_home');
} // END - if
// TDs between menu and content
-LOAD_TEMPLATE("guest_menu_content");
+LOAD_TEMPLATE('guest_menu_content');
// Disable block-mode by default
$GLOBALS['block_mode'] = false;
if ((getConfig('guest_menu') == 'Y') || (!EXT_IS_ACTIVE('sql_patches', true))) {
// Right side of content (hint: a good place for 120x600 skyscraper banner!)
- LOAD_TEMPLATE("guest_content_footer");
+ LOAD_TEMPLATE('guest_content_footer');
// Some advertising stuff?
- LOAD_TEMPLATE("guest_advert2");
+ LOAD_TEMPLATE('guest_advert2');
OUTPUT_HTML(" </td>
</tr>");
// Goto TOP template
- LOAD_TEMPLATE("guest_goto_top");
+ LOAD_TEMPLATE('guest_goto_top');
} // END - if
// Footer template (Thanx to Mr. Glaus!)
-LOAD_TEMPLATE("guest_footer");
+LOAD_TEMPLATE('guest_footer');
//
?>
}
// Display message and exit here
- LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('HOLIDAY_MEMBER_ORDER'), MAKE_DATETIME($stamp, "1")));
+ LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('HOLIDAY_MEMBER_ORDER'), MAKE_DATETIME($stamp, '1')));
return;
}
}
SQL_FREERESULT($result1);
SQL_FREERESULT($result2);
-if (IS_FORM_SENT())
-{
+if (IS_FORM_SENT()) {
// Check holiday request...
$START = mktime(0, 0, 0, REQUEST_POST('start_month'), REQUEST_POST('start_day'), REQUEST_POST('start_year'));
$END = mktime(0, 0, 0, REQUEST_POST('end_month') , REQUEST_POST('end_day') , REQUEST_POST('end_year') );
// Activate holiday system
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data`
-SET holiday_active='N', holiday_activated=UNIX_TIMESTAMP()
+SET `holiday_active`='N', holiday_activated=UNIX_TIMESTAMP()
WHERE userid=%s LIMIT 1",
array(getUserId()), __FILE__, __LINE__);
define('_END_YEAR' , REQUEST_POST('end_year'));
// Send mail to member
- $msg = LOAD_EMAIL_TEMPLATE("member_holiday_request", REQUEST_POST('comments'), getUserId());
+ $msg = LOAD_EMAIL_TEMPLATE('member_holiday_request', REQUEST_POST('comments'), getUserId());
SEND_EMAIL(getUserId(), getMessage('HOLIDAY_MEMBER_SUBJECT'), $msg);
// Send mail to all admins
- SEND_ADMIN_NOTIFICATION(getMessage('HOLIDAY_ADMIN_SUBJECT'), "admin_holiday_request", REQUEST_POST('comments'), getUserId());
+ SEND_ADMIN_NOTIFICATION(getMessage('HOLIDAY_ADMIN_SUBJECT'), 'admin_holiday_request', REQUEST_POST('comments'), getUserId());
// 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','{--HOLIDAY_ADMIN_SUBJECT--}','%s', UNIX_TIMESTAMP())",
- array(getUserId(), $msg), __FILE__, __LINE__);
+ array(getUserId(), $msg), __FILE__, __LINE__);
// Display message
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('HOLIDAY_IS_ACTIVATED_NOW'));
}
// Holiday shall be ended now
-if (REQUEST_ISSET_POST(('stop')))
-{
+if (REQUEST_ISSET_POST(('stop'))) {
// Okay, end the holiday here...
$result = SQL_QUERY_ESC("SELECT holiday_active, holiday_activated FROM `{!_MYSQL_PREFIX!}_user_data`
WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
list($active, $locked) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
- if (($active == 'Y') && (($locked + getConfig('holiday_lock')) < time()))
- {
+ if (($active == 'Y') && (($locked + getConfig('holiday_lock')) < time())) {
// Load data
$result = SQL_QUERY_ESC("SELECT holiday_start, holiday_end FROM `{!_MYSQL_PREFIX!}_user_holidays`
WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) == 1)
- {
+ if (SQL_NUMROWS($result) == 1) {
// Data was found
list($start, $end) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
// Deactivate it now
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data`
-SET holiday_active='N', holiday_activated='0'
+SET `holiday_active`='N', holiday_activated='0'
WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
// Remove entry
WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
// Send email to admin
- SEND_ADMIN_NOTIFICATION(getMessage('HOLIDAY_ADMIN_DEAC_SUBJ'), "admin_holiday_deactivated", array(), getUserId());
+ SEND_ADMIN_NOTIFICATION(getMessage('HOLIDAY_ADMIN_DEAC_SUBJ'), 'admin_holiday_deactivated', array(), getUserId());
// Display message to user
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('HOLIDAY_MEMBER_DEACTIVATED_NOW'));
}
// If something is wrong or link in menu is just clicked display form
-if ((!IS_FORM_SENT()) && (!REQUEST_ISSET_POST(('stop'))))
-{
+if ((!IS_FORM_SENT()) && (!REQUEST_ISSET_POST(('stop'))) {
// Check if user is in holiday...
$result = SQL_QUERY_ESC("SELECT holiday_active, holiday_activated FROM `{!_MYSQL_PREFIX!}_user_data`
WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
SQL_FREERESULT($result);
// Check for lock
- if (($locked + getConfig('holiday_lock')) < time())
- {
+ if (($locked + getConfig('holiday_lock')) < time()) {
// User can deactivate his holiday request
switch ($active)
{
// Load starting and ending date
$result = SQL_QUERY_ESC("SELECT holiday_start, holiday_end FROM `{!_MYSQL_PREFIX!}_user_holidays`
WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) == 1)
- {
+ if (SQL_NUMROWS($result) == 1) {
// Data was found
list($start, $end) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
// Prepare it for the template
- define('__HOLIDAY_START', MAKE_DATETIME($start , "3"));
- define('__HOLIDAY_END' , MAKE_DATETIME($end , "3"));
- define('__HOLIDAY_LOCK' , MAKE_DATETIME($locked, "1"));
+ define('__HOLIDAY_START', MAKE_DATETIME($start , '3'));
+ define('__HOLIDAY_END' , MAKE_DATETIME($end , '3'));
+ define('__HOLIDAY_LOCK' , MAKE_DATETIME($locked, '1'));
// Load template
- LOAD_TEMPLATE("member_holiday_deactivate");
- }
- else
- {
+ LOAD_TEMPLATE('member_holiday_deactivate');
+ } else {
// Free memory
SQL_FREERESULT($result);
// Remove entry and reload URL
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data`
-SET holiday_active='N'
+SET `holiday_active`='N'
WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
- LOAD_URL("modules.php?module=login&what=holiday");
+ LOAD_URL('modules.php?module=login&what=holiday');
return;
}
break;
case 'N': // Display activation form
// Starting day
- define('_START_DAY' , ADD_SELECTION("day" , date("d", (time() + getConfig('one_day'))), "start"));
- define('_START_MONTH', ADD_SELECTION("month", date("m", (time() + getConfig('one_day'))), "start"));
- define('_START_YEAR' , ADD_SELECTION("year" , date('Y', (time() + getConfig('one_day'))), "start"));
+ define('_START_DAY' , ADD_SELECTION('day' , date('d', (time() + getConfig('one_day'))), 'start'));
+ define('_START_MONTH', ADD_SELECTION('month', date('m', (time() + getConfig('one_day'))), 'start'));
+ define('_START_YEAR' , ADD_SELECTION('year' , date('Y', (time() + getConfig('one_day'))), 'start'));
// Calcualte ending date
- $D = date("d", time() + getConfig('one_day') + (getConfig('one_day') * getConfig('holiday_max')));
- $M = date("m", time() + getConfig('one_day') + (getConfig('one_day') * getConfig('holiday_max')));
+ $D = date('d', time() + getConfig('one_day') + (getConfig('one_day') * getConfig('holiday_max')));
+ $M = date('m', time() + getConfig('one_day') + (getConfig('one_day') * getConfig('holiday_max')));
$Y = date('Y', time() + getConfig('one_day') + (getConfig('one_day') * getConfig('holiday_max')));
// Ending day
- define('_END_DAY' , ADD_SELECTION("day" , $D, "end"));
- define('_END_MONTH', ADD_SELECTION("month", $M, "end"));
- define('_END_YEAR' , ADD_SELECTION("year" , $Y, "end"));
+ define('_END_DAY' , ADD_SELECTION('day' , $D, 'end'));
+ define('_END_MONTH', ADD_SELECTION('month', $M, 'end'));
+ define('_END_YEAR' , ADD_SELECTION('year' , $Y, 'end'));
// Copy value from configuration
define('__HOLIDAY_MAX', getConfig('holiday_max'));
// Output form
- LOAD_TEMPLATE("member_holiday_form");
+ LOAD_TEMPLATE('member_holiday_form');
break;
}
} else {
// Class was found and loaded
if (IS_FORM_SENT()) {
// 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(REQUEST_POST('html'), getUserId()), __FILE__, __LINE__);
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('MEMBER_SETTINGS_SAVED'));
} else {
}
// Base URL for redirection (both cases)
-$URL = "modules.php?module=index&msg=";
+$URL = 'modules.php?module=index&msg=';
if (destroy_user_session()) {
// Remove theme cookie as well
- set_session("mxchange_theme", '');
+ set_session('mxchange_theme', '');
// Logout completed
$URL .= getCode('LOGOUT_DONE');
}
// ID is received so we can redirect the user, used points will be added when he send's out the mail
- $URL = "modules.php?module=frametester&order=".$id."";
+ $URL = 'modules.php?module=frametester&order=' . $id;
} elseif ($MAX_SEND == 0) {
// Not enougth receivers found which can receive mails
$URL = 'modules.php?module=login&what=order&msg=' . getCode('MORE_RECEIVERS2');
$URL = 'modules.php?module=login&what=order&msg=' . getCode('NO_RECS_LEFT');
}
}
-} elseif (REQUEST_POST('receiver') == "0") {
+} elseif (REQUEST_POST('receiver') == '0') {
// Not enougth receivers selected
$URL = 'modules.php?module=login&what=order&msg=' . getCode('MORE_RECEIVERS1');
} elseif (($ALLOWED == 0) && (getConfig('order_max_full') == 'ORDER')) {
// No more mail orders allowed
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('MEMBER_ORDER_ALLOWED_EXHAUSTED'));
-} elseif (($links < getConfig('unconfirmed')) && ($mmails == "1")) {
+} 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__);
if (SQL_NUMROWS($result_cats) > 0) {
);
// Enable HTML checking
+ // @TODO Rewrite this to a filter
$HTML = ''; $HOLIDAY = false; $HOL_STRING = '';
- if ((EXT_IS_ACTIVE('html_mail')) && (REQUEST_POST('html') == 'Y')) $HTML = " AND html='Y'";
+ if ((EXT_IS_ACTIVE('html_mail')) && (REQUEST_POST('html') == 'Y')) $HTML = " AND `html`='Y'";
if (GET_EXT_VERSION('holiday') >= '0.1.3') {
// Extension's version is fine
- $HOLIDAY = true; $HOL_STRING = " AND holiday_active='N'";
+ $HOLIDAY = true; $HOL_STRING = " AND `holiday_active`='N'";
} // END - if
// ... and begin loading stuff
$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) {
switch (getConfig('order_max_full'))
{
case 'MAX': // He is allowed to send as much as possible
- define('ORDER_MAX_VALUE', getMessage('ORDER_ALLOWED_MAX'));
+ define('ORDER_MAX_VALUE', getMessage('MEMBER_ORDER_ALLOWED_MAX'));
break;
case 'ORDER': // He is allowed to send as much as he setup the receiving value
- define('ORDER_MAX_VALUE', sprintf(getMessage('ORDER_ALLOWED_RECEIVE'), $ALLOWED, $MAXI));
+ define('ORDER_MAX_VALUE', sprintf(getMessage('MEMBER_ORDER_ALLOWED_RECEIVE'), $ALLOWED, $MAXI));
break;
default: // Unknown/invalid
DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown order_mas_full config detected.", getConfig('order_max_full')));
- define('ORDER_MAX_VALUE', getMessage('ORDER_ALLOWED_UNKNOWN'));
+ define('ORDER_MAX_VALUE', getMessage('MEMBER_ORDER_ALLOWED_UNKNOWN'));
break;
}
} elseif (!IS_MEMBER()) {
LOAD_URL('modules.php?module=index');
} elseif ((!EXT_IS_ACTIVE('mailid')) && (!IS_ADMIN())) {
- LOAD_URL("modules.php?module=login");
+ LOAD_URL('modules.php?module=login');
}
// Add description as navigation point
// Load data
$content = SQL_FETCHARRAY($result_data);
- // "Translate some data
+ // Translate some data
$content['subject'] = COMPILE_CODE($content['subject']);
$content['text'] = COMPILE_CODE($content['text']);
- $content['timestamp'] = MAKE_DATETIME($content['timestamp'], "2");
+ $content['timestamp'] = MAKE_DATETIME($content['timestamp'], '2');
$content['category'] = GET_CATEGORY($content['cat_id']);
$content['points'] = TRANSLATE_COMMA($content['points']);
$content['is_notify'] = TRANSLATE_YESNO($content['is_notify']);
// Get timestamp from insert
$content['user_status'] = sprintf(getMessage('MEMBER_MAIL_BONUS_CONFIRMED_ON'),
- MAKE_DATETIME(USER_STATS_GET_TIMESTAMP('bonusid', $content['id']), "2")
+ MAKE_DATETIME(USER_STATS_GET_TIMESTAMP('bonusid', $content['id']), '2')
);
// Display it depending on mail (data) type
- LOAD_TEMPLATE("member_mail_bonus_".strtolower($content['data_type']), false, $content);
+ LOAD_TEMPLATE('member_mail_bonus_'.strtolower($content['data_type']), false, $content);
// Free result
SQL_FREERESULT($result_data);
// Load data
$content = SQL_FETCHARRAY($result_data);
- // "Translate some data
+ // Translate some data
$content['subject'] = COMPILE_CODE($content['subject']);
$content['text'] = COMPILE_CODE($content['text']);
- $content['timestamp'] = MAKE_DATETIME($content['timestamp'], "2");
+ $content['timestamp'] = MAKE_DATETIME($content['timestamp'], '2');
$content['category'] = GET_CATEGORY($content['cat_id']);
$content['points'] = TRANSLATE_COMMA($content['points']);
$content['time'] = CREATE_FANCY_TIME($content['time']);
// Get timestamp from insert
$content['user_status'] = sprintf(getMessage('MEMBER_MAIL_NORMAL_CONFIRMED_ON'),
- MAKE_DATETIME(USER_STATS_GET_TIMESTAMP('mailid', $content['id']), "2")
+ MAKE_DATETIME(USER_STATS_GET_TIMESTAMP('mailid', $content['id']), '2')
);
// Display it depending on mail (data) type
- LOAD_TEMPLATE("member_mail_normal_".strtolower($content['data_type']), false, $content);
+ LOAD_TEMPLATE('member_mail_normal_'.strtolower($content['data_type']), false, $content);
// Free result
SQL_FREERESULT($result_data);
$cat = ''; $result_data = false;
switch ($type)
{
- case "NORMAL":
+ 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
$type = 'mailid'; $DATA = $id; $PROBLEM = getMessage('NORMAL_MAIL_PROBLEM');
break;
- case "BONUS":
+ case 'BONUS':
$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 = getMessage('BONUS_MAIL_PROBLEM');
'type' => $type,
'subject' => $subject,
'sender' => $sender,
- 'stamp' => MAKE_DATETIME($timestamp, "2"),
+ 'stamp' => MAKE_DATETIME($timestamp, '2'),
'cat' => GET_CATEGORY($cat),
'points' => TRANSLATE_COMMA($pay),
);
// Load row template
if (getConfig('show_points_unconfirmed') == 'Y') {
- $OUT .= LOAD_TEMPLATE("member_unconfirmed_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('member_unconfirmed_row', true, $content);
} else {
- $OUT .= LOAD_TEMPLATE("member_unconfirmed_row_nopoints", true, $content);
+ $OUT .= LOAD_TEMPLATE('member_unconfirmed_row_nopoints', true, $content);
}
// Count points
// Display points or not?
if (getConfig('show_points_unconfirmed') == 'Y') {
- $OUT .= LOAD_TEMPLATE("member_unconfirmed_404", true, $content);
+ $OUT .= LOAD_TEMPLATE('member_unconfirmed_404', true, $content);
} else {
- $OUT .= LOAD_TEMPLATE("member_unconfirmed_404_nopoints", true, $content);
+ $OUT .= LOAD_TEMPLATE('member_unconfirmed_404_nopoints', true, $content);
}
}
// Load main template
if (getConfig('show_points_unconfirmed') == 'Y') {
- LOAD_TEMPLATE("member_unconfirmed_table");
+ LOAD_TEMPLATE('member_unconfirmed_table');
} else {
- LOAD_TEMPLATE("member_unconfirmed_table_nopoints");
+ LOAD_TEMPLATE('member_unconfirmed_table_nopoints');
}
} else {
// No mails left to confirm... :)
$URL = 'modules.php?module=index';
} elseif (!REQUEST_ISSET_GET(('order'))) {
// You cannot call this module directly!
- $URL = "modules.php?module=login&what=order";
+ $URL = 'modules.php?module=login&what=order';
}
// When URL is empty nothing bad happend here
// Auto-send is active
define('ADMIN_AUTOSEND', getMessage('ADMIN_AUTOSEND_ACTIVE'));
define('MEMBER_AUTOSEND', getMessage('MEMBER_AUTOSEND_ACTIVE'));
- $type = "NEW";
+ $type = 'NEW';
} else {
// Auto-send is inactive
define('ADMIN_AUTOSEND', getMessage('ADMIN_AUTOSEND_INACTIVE'));
define('MEMBER_AUTOSEND', getMessage('MEMBER_AUTOSEND_INACTIVE'));
- $type = "ADMIN";
+ $type = 'ADMIN';
}
// Update sending pool
// Update used points
$add = '';
- if (getConfig('order_max_full') == 'ORDER') $add = ", mail_orders=mail_orders+1";
+ if (getConfig('order_max_full') == 'ORDER') $add = ', mail_orders=mail_orders+1';
SUB_POINTS('order', getUserId(), $USED);
// Prepare content
);
// Send an email to the user
- $msg_mem = LOAD_EMAIL_TEMPLATE("order-member", $content, getUserId());
+ $msg_mem = LOAD_EMAIL_TEMPLATE('order-member', $content, getUserId());
SEND_EMAIL($email, getMessage('MEMBER_NEW_QUEUE'), $msg_mem);
// Notify admins about this
- SEND_ADMIN_NOTIFICATION(getMessage('ADMIN_NEW_QUEUE'), "order-admin", $content, getUserId());
+ SEND_ADMIN_NOTIFICATION(getMessage('ADMIN_NEW_QUEUE'), 'order-admin', $content, getUserId());
// Output back bottom
- LOAD_TEMPLATE("member_order-back", false);
+ LOAD_TEMPLATE('member_order-back', false);
} else {
- // Matching line not found or already "placed" in send queue
- LOAD_URL("modules.php?module=login");
+ // Matching line not found or already 'placed' in send queue
+ LOAD_URL('modules.php?module=login');
}
} else {
// Redirect...
if (isAdminRegistered()) {
// Redirect
// @TODO Why does this lead into an endless loop but we still need it???
- // @TODO Commented out LOAD_URL("admin.php");
+ // @TODO Commented out LOAD_URL('admin.php');
} // END - if
}
$ret = getMessage('_CATEGORY_404');
// Is the category id set?
- if ($cid == "0") {
+ if ($cid == '0') {
// No category
$ret = getMessage('_CATEGORY_NONE');
} elseif ($cid > 0) {
} else {
// Return title and price
list($t, $p) = SQL_FETCHROW($result);
- $ret = $t." / ".TRANSLATE_COMMA($p)." {!POINTS!}";
+ $ret = $t.' / '.TRANSLATE_COMMA($p).' {!POINTS!}';
}
}
}
// Get (basicly) the price of given payment id
-function GET_PAY_POINTS ($pid, $lookFor = "price") {
- $ret = "-1";
+function GET_PAY_POINTS ($pid, $lookFor = 'price') {
+ $ret = '-1';
$result = SQL_QUERY_ESC("SELECT %s FROM `{!_MYSQL_PREFIX!}_payments` WHERE id=%s LIMIT 1",
array($lookFor, $pid), __FUNCTION__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
}
// Remove a receiver's ID from $receivers and add a link for him to confirm
-function REMOVE_RECEIVER (&$receivers, $key, $uid, $pool_id, $stats_id="", $bonus=false) {
+function REMOVE_RECEIVER (&$receivers, $key, $uid, $pool_id, $stats_id='', $bonus=false) {
// Default is not removed
- $ret = "failed";
+ $ret = 'failed';
// Is the userid valid?
if ($uid > 0) {
// Is there already a line for this user available?
if ($stats_id > 0) {
// 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'; }
+ $type = 'NORMAL'; $rowName = 'stats_id';
+ if ($bonus) { $type = 'BONUS'; $rowName = 'bonus_id'; }
// Try to look the entry up
$result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_links` WHERE %s='%s' AND userid=%s AND link_type='%s' LIMIT 1",
// So we add one!
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_links` (%s, userid, link_type) VALUES ('%s','%s','%s')",
array($rowName, $stats_id, bigintval($uid), $type), __FUNCTION__, __LINE__);
- $ret = "done";
+ $ret = 'done';
} else {
// Already found
- $ret = "already";
+ $ret = 'already';
}
// Free memory
}
// Calculate sum (default) or count records of given criteria
-function GET_TOTAL_DATA ($search, $tableName, $lookFor = "id", $whereStatement = 'userid', $countRows = false, $add = "") {
+function GET_TOTAL_DATA ($search, $tableName, $lookFor = 'id', $whereStatement = 'userid', $countRows = false, $add = '') {
$ret = 0;
- //* DEBUG: */ echo $search."/".$tableName."/".$lookFor."/".$whereStatement."/".$add."<br />\n";
- if ((empty($search)) && ($search != "0")) {
+ //* DEBUG: */ echo $search.'/'.$tableName.'/'.$lookFor.'/'.$whereStatement.'/'.$add.'<br />\n';
+ if ((empty($search)) && ($search != '0')) {
// Count or sum whole table?
if ($countRows === true) {
// Count whole table
SQL_FREERESULT($result);
// Fix empty values
- if ((empty($ret)) && ($lookFor != "counter") && ($lookFor != "id") && ($lookFor != 'userid')) {
+ if ((empty($ret)) && ($lookFor != 'counter') && ($lookFor != 'id') && ($lookFor != 'userid')) {
// Float number
- $ret = "0.00000";
- } elseif ("".$ret."" == "") {
+ $ret = '0.00000';
+ } elseif (''.$ret.'' == '') {
// Fix empty result
- $ret = "0";
+ $ret = '0';
}
// Return value
return $ret;
}
-// "Getter fro ref level percents
+// Getter fro ref level percents
function GET_REF_LEVEL_PERCENTS ($level) {
// Default is zero
$per = 0;
* add_mode = Add points only to $uid or also refs? (WARNING! Changing "ref" to "direct"
* for default value will cause no referal will get points ever!!!)
*/
-function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify=false, $rid="0", $locked=false, $add_mode="ref") {
+function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify=false, $rid='0', $locked=false, $add_mode='ref') {
//* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
global $DATA;
$add_mode = strtolower($add_mode);
// When $uid = 0 add points to jackpot
- if ($uid == "0") {
+ if ($uid == '0') {
// Add points to jackpot
ADD_JACKPOT($points);
return;
}
// Default is 'normal' points
- $data = "points";
+ $data = 'points';
// Which points, locked or normal?
- if ($locked) $data = "locked_points";
+ 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",
);
// Load email template
- $msg = LOAD_EMAIL_TEMPLATE("confirm-referal", $content, bigintval($uid));
+ $msg = LOAD_EMAIL_TEMPLATE('confirm-referal', $content, bigintval($uid));
SEND_EMAIL($email, THANX_REFERRAL_ONE, $msg);
} elseif (($send_notify) && ($ref == 0) && (!$locked) && ($add_mode == "direct") && (!defined('__POINTS_VALUE'))) {
);
// Load message
- $msg = LOAD_EMAIL_TEMPLATE("add-points", $content, $uid);
+ $msg = LOAD_EMAIL_TEMPLATE('add-points', $content, $uid);
// And sent it away
SEND_EMAIL($email, getMessage('SUBJECT_DIRECT_PAYMENT'), $msg);
}
// Maybe there's another ref?
- if (($ref > 0) && ($points > 0) && ($ref != $uid) && ($add_mode == "ref")) {
+ if (($ref > 0) && ($points > 0) && ($ref != $uid) && ($add_mode == 'ref')) {
// Then let's credit him here...
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$ref},points={$points} - ADVANCE!<br />\n";
ADD_POINTS_REFSYSTEM(sprintf("%s_ref:%s", $subject, $GLOBALS['ref_level']), $ref, $points, $send_notify, $ref, $locked);
} elseif ((($ref == $uid) || ($ref == 0)) && (GET_EXT_VERSION('cache') >= '0.1.2')) {
// Remove cache here
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ref={$ref} - CACHE!<br />\n";
- rebuildCacheFiles("refsystem", "refsystem");
+ rebuildCacheFiles('refsystem', 'refsystem');
}
// "Walk" back here
// Get ID number from administrator's login name
function GET_ADMIN_ID ($login) {
// By default no admin is found
- $ret = "-1";
+ $ret = '-1';
// Check cache
if (isset($GLOBALS['cache_array']['admins']['aid'][$login])) {
// Get password hash from administrator's login name
function GET_ADMIN_HASH ($aid) {
// By default an invalid hash is returned
- $ret = "-1";
+ $ret = '-1';
if (isset($GLOBALS['cache_array']['admins']['password'][$aid])) {
// Check cache
// Set cache
$GLOBALS['cache_array']['admins']['password'][$aid] = $ret;
- }
+ } // END - if
// Free result
SQL_FREERESULT($result);
//
function GET_ADMIN_LOGIN ($aid) {
// By default a non-existent login is returned (other functions react on this!)
- $ret = "***";
+ $ret = '***';
if (isset($GLOBALS['cache_array']['admins']['login'][$aid])) {
// Get cache
// Get email address of admin id
function GET_ADMIN_EMAIL ($aid) {
// By default an invalid emails is returned
- $ret = "***";
+ $ret = '***';
if (isset($GLOBALS['cache_array']['admins']['email'][$aid])) {
// Get cache
// Get default ACL of admin id
function GET_ADMIN_DEFAULT_ACL ($aid) {
// By default an invalid ACL value is returned
- $ret = "***";
+ $ret = '***';
// Is sql_patches there and was it found in cache?
if (!EXT_IS_ACTIVE('sql_patches')) {
// Not found, which is bad, so we need to allow all
- $ret = "allow";
+ $ret = 'allow';
} elseif (isset($GLOBALS['cache_array']['admins']['def_acl'][$aid])) {
// Use cache
$ret = $GLOBALS['cache_array']['admins']['def_acl'][$aid];
return $ret;
}
//
-function ADD_OPTION_LINES ($table, $id, $name, $default="", $special="", $where="") {
+function ADD_OPTION_LINES ($table, $id, $name, $default='', $special='', $where='') {
$ret = '';
- if ($table == "/ARRAY/") {
+ if ($table == '/ARRAY/') {
// Selection from array
if (is_array($id) && is_array($name) && count($id) == count($name)) {
// Both are arrays
foreach ($id as $idx => $value) {
- $ret .= "<option value=\"".$value."\"";
+ $ret .= '<option value="' . $value . '"';
if ($default == $value) $ret .= ' selected="selected"';
- $ret .= ">".$name[$idx]."</option>\n";
+ $ret .= '>' . $name[$idx] . '</option>';
} // END - foreach
} // END - if
} else {
// Data from database
- $SPEC = ", ".$id;
- if (!empty($special)) $SPEC = ", ".$special;
+ $SPEC = ', '.$id;
+ if (!empty($special)) $SPEC = ', '.$special;
$ORDER = $name.$SPEC;
if ($table == 'country') $ORDER = $special;
$result = SQL_QUERY_ESC("SELECT %s, %s".$SPEC." FROM `{!_MYSQL_PREFIX!}_%s` ".$where." ORDER BY %s",
// @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
while (list($value, $title, $add) = SQL_FETCHROW($result)) {
if (empty($special)) $add = '';
- $ret .= "<option value=\"".$value."\"";
+ $ret .= '<option value="' . $value . '"';
if ($default == $value) $ret .= ' selected="selected"';
- if (!empty($add)) $add = " (".$add.")";
- $ret .= ">".$title.$add."</option>\n";
+ if (!empty($add)) $add = ' ('.$add.')';
+ $ret .= '>' . $title . $add . '</option>';
} // END - while
// Free memory
SQL_FREERESULT($result);
} else {
// No data found
- $ret = "<option value=\"x\">{--SELECT_NONE--}</option>\n";
+ $ret = '<option value="x">{--SELECT_NONE--}</option>';
}
}
} // END - if
// Check total amount of users
- $totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", 'userid', "status", true, " AND max_mails > 0");
+ $totalUsers = GET_TOTAL_DATA('CONFIRMED', 'user_data', 'userid', 'status', true, ' AND max_mails > 0');
if ($totalUsers >= getConfig('activate_xchange')) {
// Activate System
SET_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!}_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"
));
runFilterChain('run_sqls');
// Rebuild caches
- rebuildCacheFiles("config", "config");
- rebuildCacheFiles("modreg", "modreg");
+ // @TODO Rewrite this to a filter
+ rebuildCacheFiles('config', 'config');
+ rebuildCacheFiles('modreg', 'modreg');
} // END - if
}
+
//
-function DELETE_USER_ACCOUNT($uid, $reason)
-{
+function DELETE_USER_ACCOUNT ($uid, $reason) {
$points = 0;
$result = SQL_QUERY_ESC("SELECT (SUM(p.points) - d.used_points) AS points
FROM `{!_MYSQL_PREFIX!}_user_points` AS p
//
function META_DESCRIPTION ($mod, $wht) {
// Exclude admin and member's area
- if (($mod != 'admin') && ($mod != "login")) {
+ if (($mod != 'admin') && ($mod != 'login')) {
// Construct dynamic description
- $DESCR = "{!MAIN_TITLE!} ".trim(getConfig('title_middle'))." ".ADD_DESCR('guest', "what-".$wht, true);
+ $DESCR = '{!MAIN_TITLE!} '.trim(getConfig('title_middle')).' '.ADD_DESCR('guest', 'what-'.$wht, true);
// Output it directly
- OUTPUT_HTML("<meta name=\"description\" content=\"".$DESCR."\" />");
+ OUTPUT_HTML('<meta name="description" content="' . $DESCR . '" />');
} // END - if
// Remove depth
//
function SUB_JACKPOT($points) {
// First failed
- $ret = "-1";
+ $ret = '-1';
// Get current points
$result = SQL_QUERY("SELECT points FROM `{!_MYSQL_PREFIX!}_jackpot` WHERE ok='ok' LIMIT 1", __FUNCTION__, __LINE__);
// Free memory
SQL_FREERESULT($result);
}
-//
+
+// Checks wether the extension demo is actuve and the admin login is demo (password needs to be demo, too!)
function IS_DEMO () {
return ((EXT_IS_ACTIVE('demo')) && (get_session('admin_login') == 'demo'));
}
switch ($modCheck)
{
case 'admin':
- $wht = "overview";
+ $wht = 'overview';
break;
- case "login":
+ case 'login':
case 'index':
- $wht = "welcome";
- if (($modCheck == 'index') && (getConfig('index_home') != "")) $wht = getConfig('index_home');
+ $wht = 'welcome';
+ if (($modCheck == 'index') && (getConfig('index_home') != '')) $wht = getConfig('index_home');
break;
default:
}
// Update config entries
-function UPDATE_CONFIG ($entries, $values, $updateMode="") {
+function UPDATE_CONFIG ($entries, $values, $updateMode='') {
// Do not update config in CSS mode
- if (($GLOBALS['output_mode'] == "1") || ($GLOBALS['output_mode'] == -1)) {
+ if (($GLOBALS['output_mode'] == '1') || ($GLOBALS['output_mode'] == -1)) {
return;
} // END - if
if (($values[$idx] + 0) === $values[$idx]) {
// Number detected
$all .= sprintf("%s=%s,", $entry, (float)$values[$idx]);
- } elseif ($values[$idx] == "UNIX_TIMESTAMP()") {
+ } elseif ($values[$idx] == 'UNIX_TIMESTAMP()') {
// Function UNIX_TIMESTAMP() detected
$all .= sprintf("%s=%s,", $entry, $values[$idx]);
} else {
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):entries={$entries},affectedRows={$affectedRows}<br />\n";
// Rebuild cache
- rebuildCacheFiles("config", "config");
+ rebuildCacheFiles('config', 'config');
}
// Prepares an SQL statement part for HTML mail and/or holiday depency
$MORE = '';
// HTML mail?
- if ($mode == 'html') $MORE = " AND html='Y'";
+ if ($mode == 'html') $MORE = " AND `html`='Y'";
if (GET_EXT_VERSION('holiday') >= '0.1.3') {
// Add something for the holiday extension
- $MORE .= " AND holiday_active='N'";
+ $MORE .= " AND `holiday_active`='N'";
} // END - if
// Return result
$OUT = '';
foreach ($CATS['id'] as $key => $value) {
if (strlen($CATS['name'][$key]) > 20) $CATS['name'][$key] = substr($CATS['name'][$key], 0, 17)."...";
- $OUT .= " <option value=\"".$value."\">".$CATS['name'][$key]." (".$CATS['uids'][$key]." {--USER_IN_CAT--})</option>\n";
+ $OUT .= ' <option value="' . $value . '">' . $CATS['name'][$key] . ' (' . $CATS['uids'][$key] . ' {--USER_IN_CAT--})</option>';
} // END - foreach
} else {
// No cateogries are defined yet
- $OUT = "<option class=\"member_failed\">{!MEMBER_NO_CATS!}</option>\n";
+ $OUT = '<option class="member_failed">{!MEMBER_NO_CATS!}</option>';
}
// Return HTML code
// HTML extension active?
if (EXT_IS_ACTIVE('html_mail')) {
// No HTML by default
- $HTML = "N";
+ $HTML = 'N';
// HTML mode?
- if ($mode == 'html') $HTML = "Y";
+ if ($mode == 'html') $HTML = 'Y';
// Add HTML mail
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_bonus`
// Exclude users in holiday?
if (GET_EXT_VERSION('holiday') >= '0.1.3') {
// Add something for the holiday extension
- $CAT_WHERE .= " AND d.holiday_active='N'";
+ $CAT_WHERE .= " AND d.`holiday_active`='N'";
} // 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), __FUNCTION__, __LINE__);
} else {
// Include all
// Do we have nickname extension installed?
if (EXT_IS_ACTIVE('nickname')) {
- $add = ", ud.nickname";
+ $add = ', ud.nickname';
} // END - if
// Get refs from database
// Fetch all entries
while ($row = SQL_FETCHARRAY($result)) {
// Get total points of this user
- $row['points'] = GET_TOTAL_DATA($row['refid'], "user_points", "points") - GET_TOTAL_DATA($row['refid'], "user_data", "used_points");
+ $row['points'] = GET_TOTAL_DATA($row['refid'], 'user_points', 'points') - GET_TOTAL_DATA($row['refid'], 'user_data', 'used_points');
// Get unconfirmed mails
- $row['unconfirmed'] = GET_TOTAL_DATA($row['refid'], "user_links", "id", 'userid', true);
+ $row['unconfirmed'] = GET_TOTAL_DATA($row['refid'], 'user_links', 'id', 'userid', true);
// Init clickrate with zero
$row['clickrate'] = 0;
// 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`
-WHERE holiday_activated > 0 AND holiday_activated < UNIX_TIMESTAMP() AND holiday_active='N'
+WHERE holiday_activated > 0 AND holiday_activated < UNIX_TIMESTAMP() AND `holiday_active`='N'
ORDER BY holiday_activated",
__FILE__, __LINE__);
// Update account
ADD_SQL(SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data`
-SET holiday_active='Y'
+SET `holiday_active`='Y'
WHERE userid=%s
LIMIT 1",
array(bigintval($content['userid'])), __FILE__, __LINE__, false));
} // END - if
// Test session if index.php or modules.php is loaded
-if ((basename($_SERVER['PHP_SELF']) == "index.php") || (basename($_SERVER['PHP_SELF']) == "modules.php") || (isInstalling())) {
+if ((basename($_SERVER['PHP_SELF']) == 'index.php') || (basename($_SERVER['PHP_SELF']) == 'modules.php') || (isInstalling())) {
if (count($_SESSION) > 0) {
// Session variables accepted!
define('__COOKIES', true);
<tr>
<td width="10" class="seperator"> </td>
<td align="center" width="275" colspan="3">
- {--ORDER_MAX_ORDER_SELECT--}
+ {--ADMIN_ORDER_MAX_ORDER_SELECT--}
</td>
<td width="10" class="seperator"> </td>
</tr>
<tr>
<td width="10" class="seperator"> </td>
<td align="right" width="275">
- {--ORDER_MIN_RECEIVER_PER_ORDER--}:</td>
+ {--ADMIN_ORDER_MIN_RECEIVER_PER_ORDER--}:</td>
<td width="10" class="seperator"> </td>
<td align="center" width="275"><input type="input"
name="order_min" class="admin_normal" value="{!__MIN_VALUE!}"
<tr>
<td width="10" class="seperator"> </td>
<td align="center" width="275" colspan="3">
- {--ORDER_MAX_ORDER_SELECT--}</td>
+ {--ADMIN_ORDER_MAX_ORDER_SELECT--}</td>
<td width="10" class="seperator"> </td>
</tr>
<tr>
<tr>
<td width="10" class="seperator"> </td>
<td align="center" width="275">{--ADMIN_ORDER_MAX--}: <input
- type="radio" name="order_max_full" class="admin_normal" value="MAX"{!__MAX_DEFAULT!}>
+ type="radio" name="order_max_full" class="admin_normal" value="MAX"{!__MAX_DEFAULT!} />
</td>
<td width="10" class="seperator"> </td>
<td align="center" width="275">{--ADMIN_ORDER_ORDER--}: <input
- type="radio" name="order_max_full" class="admin_normal" value="ORDER"{!__ORDER_DEFAULT!}>
+ type="radio" name="order_max_full" class="admin_normal" value="ORDER"{!__ORDER_DEFAULT!} />
</td>
<td width="10" class="seperator"> </td>
</tr>
<tr>
<td width="10" class="seperator"> </td>
<td align="right" width="275">
- {--ORDER_MIN_RECEIVER_PER_ORDER--}:
+ {--ADMIN_ORDER_MIN_RECEIVER_PER_ORDER--}:
</td>
<td width="10" class="seperator"> </td>
<td align="center" width="275">
<td width="10" class="admin_footer seperator"> </td>
</tr>
</table>
-</form>
\ No newline at end of file
+</form>