}
// 01 2 2 2 3321 1 2 21 1 2 21 1 2 21 1 2 21 1 1 1 2 210
-if ((date("d", $_CONFIG['last_update']) != date("d", time())) && (!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (!isset($_GET['register'])) && ($CSS != 1) && (!isBooleanConstantAndTrue('DEBUG_MODE'))) {
+if ((date("d", $_CONFIG['last_update']) != date("d", time())) && (!defined('mxchange_installing')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (!isset($_GET['register'])) && ($CSS != 1) && (!defined('DEBUG_MODE'))) {
// Do daily things in external PHP file but only when script is completely setup
// Daily reset was run!
define('__DAILY_RESET', true);
define('SERVER_URL', "http://www.mxchange.org");
// This current patch level
-define('CURR_SVN_REVISION', "376");
+define('CURR_SVN_REVISION', "377");
// Take a prime number which is long (if you know a longer one please try it out!)
define('_PRIME', 591623);
global $cacheArray, $_CONFIG;
// Extensions are all inactive during installation
- if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing')) || (empty($ext_name))) return false;
+ if ((!defined('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing')) || (empty($ext_name))) return false;
// Not active is the default
$active = "N";
$ret = false;
// Extensions are all inactive during installation
- if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing'))) return "";
+ if ((!defined('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing'))) return "";
//* DEBUG: */ echo __FUNCTION__.": ext_name={$ext_name}<br />\n";
// Is the cache written?
// Add surrounding HTML comments to help finding bugs faster
$ret = "<!-- Template ".$template." - Start -->\n".$ret."<!-- Template ".$template." - End -->\n";
- } elseif ((IS_ADMIN()) || ((isBooleanConstantAndTrue('mxchange_installing')) && (!isBooleanConstantAndTrue('mxchange_installed')))) {
+ } elseif ((IS_ADMIN()) || ((isBooleanConstantAndTrue('mxchange_installing')) && (!defined('mxchange_installed')))) {
// Only admins shall see this warning or when installation mode is active
$ret = "<br /><SPAN class=\"guest_failed\">".TEMPLATE_404."</SPAN><br />
(".basename($file).")<br />
global $_CONFIG;
// Is the reset set or old sql_patches?
- if ((!isBooleanConstantAndTrue('__DAILY_RESET')) || (EXT_VERSION_IS_OLDER("sql_patches", "0.4.5"))) {
+ if ((!defined('__DAILY_RESET')) || (EXT_VERSION_IS_OLDER("sql_patches", "0.4.5"))) {
// Then abort here
return array();
} // END - if
// Remember title in constant for the template
define('__PAGE_TITLE', html_entity_decode($TITLE));
- } elseif ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndTrue('admin_registered'))) {
+ } elseif ((!defined('mxchange_installed')) || (!defined('admin_registered'))) {
// Load language file because it was missing in installation finalizer step... *sigh*
require_once(sprintf("%sinc/language/install_%s.php",
PATH,
}
// Is MXChange installed or no admin registered so far?
-if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndTrue('admin_registered')))
+if ((!defined('mxchange_installed')) || (!defined('admin_registered')))
{
// Set URL for FORM actions
define('__BURL_ACTION', $burl);
if (isBooleanConstantAndTrue('warn_no_pass')) OUTPUT_HTML(" selected=\"selected\"");
OUTPUT_HTML(">".YES."</OPTION>
<OPTION value=\"false\"");
- if (!isBooleanConstantAndTrue('warn_no_pass')) OUTPUT_HTML(" selected=\"selected\"");
+ if (!defined('warn_no_pass')) OUTPUT_HTML(" selected=\"selected\"");
OUTPUT_HTML(">".NO."</OPTION>
</SELECT>
</TD>
if (isBooleanConstantAndTrue('WRITE_FOOTER')) OUTPUT_HTML(" selected=\"selected\"");
OUTPUT_HTML(">".YES."</OPTION>
<OPTION value=\"false\"");
- if (!isBooleanConstantAndTrue('WRITE_FOOTER')) OUTPUT_HTML(" selected=\"selected\"");
+ if (!defined('WRITE_FOOTER')) OUTPUT_HTML(" selected=\"selected\"");
OUTPUT_HTML(">".NO."</OPTION>
</SELECT>
</TD>
break;
case "finalize": // Write captured data to files
- if ((!empty($_POST['finalize'])) && (!isBooleanConstantAndTrue('mxchange_installed'))) {
+ if ((!empty($_POST['finalize'])) && (!defined('mxchange_installed'))) {
// You have submitted data then we have to reset the fatal messages
$FATAL = array(); $SQLs = array();
$ADD = "";
// Skip loading extensions
-if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing'))) return;
+if ((!defined('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing'))) return;
// Load default sql_patches extension if present
if (FILE_READABLE(PATH."inc/extensions/ext-sql_patches.php")) {
// Fix "deleted" cookies in PHP4 (PHP5 does remove them, PHP4 sets them to deleted!)
FIX_DELETED_COOKIES(array('admin_login', 'admin_md5', 'admin_last', 'admin_to'));
-if (!isBooleanConstantAndTrue('admin_registered')) {
+if (!defined('admin_registered')) {
// Admin is not registered so we have to inform the user
if ((isset($_POST['ok'])) && ((empty($_POST['login'])) || (empty($_POST['pass'])) || (strlen($_POST['pass']) < 4))) $_POST['ok'] = "***";
if ((isset($_POST['ok'])) && ($_POST['ok'] != "***")) {
$ret = "done";
}
- if (!isBooleanConstantAndTrue('admin_registered')) {
+ if (!defined('admin_registered')) {
// Write to config that registration is done
admin_WriteData(PATH."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0);
}
// Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!isBooleanConstantAndTrue('__DAILY_RESET')) || ($_CONFIG['beg_rallye'] == "N")) return;
+if (($CSS == 1) || (!defined('__DAILY_RESET')) || ($_CONFIG['beg_rallye'] == "N")) return;
// Get current month (2 digits)
$curr = date("m", time());
}
// Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!isBooleanConstantAndTrue('__DAILY_RESET'))) return;
+if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
// Get current month (2 digits)
$curr = date("m", time());
}
// Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!isBooleanConstantAndTrue('__DAILY_RESET'))) return;
+if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
// Get current month (2 digits)
$curr = date("m", time());
require_once(PATH."inc/language.php");
// Check if the user setups his MySQL stuff...
-if ((empty($MySQL['login'])) && (!isBooleanConstantAndTrue('mxchange_installing')) && (!isset($_GET['installing'])) && (isBooleanConstantAndTrue('mxchange_installed'))) {
+if ((empty($MySQL['login'])) && (!defined('mxchange_installing')) && (!isset($_GET['installing'])) && (isBooleanConstantAndTrue('mxchange_installed'))) {
// No login entered and outside installation mode
echo "<STRONG>".LANG_WARNING.":</STRONG> ";
if (isBooleanConstantAndTrue('mxchange_installed')) {
// Please run the installation script (maybe again)
die(DIE_RUN_INSTALL_MYSQL);
}
-} elseif ((!isBooleanConstantAndTrue('mxchange_installing')) && (!isset($_GET['installing'])) && (empty($MySQL['password'])) && (isBooleanConstantAndTrue('warn_no_pass'))) {
+} elseif ((!defined('mxchange_installing')) && (!isset($_GET['installing'])) && (empty($MySQL['password'])) && (isBooleanConstantAndTrue('warn_no_pass'))) {
// No database password entered!!!
echo "<STRONG>".LANG_WARNING.":</STRONG> ".WARN_NULL_PASSWORD;
}
// Check if this file is writeable or read-only and warn the user
-if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndTrue('mxchange_installed'))) {
+if ((!defined('mxchange_installing')) && (isBooleanConstantAndTrue('mxchange_installed'))) {
// Check for write-permission for config.php and inc directory
if (empty($GLOBALS['module'])) $GLOBALS['module'] = "index";
if (($GLOBALS['module'] != "admin") && (isBooleanConstantAndTrue('admin_registered')) && (!isset($_SERVER['WINDIR']))) {
}
// Double-check installation mode
- if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndTrue('admin_registered'))) {
+ if ((!defined('mxchange_installed')) || (!defined('admin_registered'))) {
// Check for file permissions
if (!is_INCWritable("config")) {
ADD_FATAL(CONFIG_IS_WRITE_PROTECTED);
// Any fatal messages?
if (!is_array($FATAL)) $FATAL = array();
-if (((sizeof($FATAL) > 0) || (!empty($FATAL[0]))) && (isBooleanConstantAndTrue('mxchange_installed')) && (!isBooleanConstantAndTrue('mxchange_installing')) && ($CSS != "1"))
+if (((sizeof($FATAL) > 0) || (!empty($FATAL[0]))) && (isBooleanConstantAndTrue('mxchange_installed')) && (!defined('mxchange_installing')) && ($CSS != "1"))
{
// One or more fatal error(s) occur during connect...
include (PATH."inc/header.php");
$ret = "major";
// Check if script is installed if not return a "done" to prevent some errors
- if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing')) || (!isBooleanConstantAndTrue('admin_registered'))) return "done";
+ if ((!defined('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing')) || (!defined('admin_registered'))) return "done";
// Check if cache is latest version
$locked = "Y"; $hidden = "N"; $admin = "N"; $mem = "N"; $found = false;
}
// Now a mail to the user and that's all...
- $msg = LOAD_EMAIL_TEMPLATE("del-user", $reason, $uid);
+ $msg = LOAD_EMAIL_TEMPLATE("del-user", array('text' => $reason), $uid);
SEND_EMAIL($uid, ADMIN_DEL_ACCOUNT, $msg);
// Ok, delete the account!
}
// Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!isBooleanConstantAndTrue('__DAILY_RESET')) || ($_CONFIG['beg_rallye'] == "Y")) return;
+if (($CSS == 1) || (!defined('__DAILY_RESET')) || ($_CONFIG['beg_rallye'] == "Y")) return;
// Reset accounts
$result = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_user_data SET beg_points=0.00000 WHERE beg_points > 0",
}
// Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!isBooleanConstantAndTrue('__DAILY_RESET'))) return;
+if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
// Reset accounts
$result = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_user_data SET turbo_bonus=0, login_bonus=0, bonus_order=0, bonus_stats=0, bonus_ref=0",
}
// Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!isBooleanConstantAndTrue('__DAILY_RESET'))) return;
+if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
//
?>
}
// Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || ((!isBooleanConstantAndTrue('__DAILY_RESET')) && ($_CONFIG['holiday_mode'] == "RESET"))) return;
+if (($CSS == 1) || ((!defined('__DAILY_RESET')) && ($_CONFIG['holiday_mode'] == "RESET"))) return;
// 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
);
// Add stylesheet for installation
-if ((basename($_SERVER['PHP_SELF']) == "install.php") || (!isBooleanConstantAndTrue('mxchange_installed')) || (isset($_GET['installing']))) $STYLES[] = "install.css";
+if ((basename($_SERVER['PHP_SELF']) == "install.php") || (!defined('mxchange_installed')) || (isset($_GET['installing']))) $STYLES[] = "install.css";
// When no CSS output-mode is set, set it to file-output
if (empty($_CONFIG['css_php'])) $_CONFIG['css_php'] = "FILE";
// Fix it to default
$ret = "default";
} // END - if
- } elseif ((!isBooleanConstantAndTrue('mxchange_installed')) && ((isBooleanConstantAndTrue('mxchange_installing')) || ($CSS == true)) && ((!empty($_GET['theme'])) || (!empty($_POST['theme'])))) {
+ } elseif ((!defined('mxchange_installed')) && ((isBooleanConstantAndTrue('mxchange_installing')) || ($CSS == true)) && ((!empty($_GET['theme'])) || (!empty($_POST['theme'])))) {
// Prepare FQFN for checking
$theme = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($_GET['theme']));