// CFG: DEBUG-SQL (if enabled and DEBUG_MODE is enabled all SQL queries will be logged to debug.log)
define('DEBUG_SQL', false);
+// Default is not a frameset
+global $isFrameset;
+$isFrameset = false;
+
// Load library
require_once(PATH."inc/db/lib.php");
echo "<STRONG>".LANG_WARNING.":</STRONG> ".WARN_NULL_PASSWORD;
}
-// Init configuration arrays
-$_CONFIG = array(
- 'code_length' => 0
-);
-
// Check if this file is writeable or read-only and warn the user
if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndTrue('mxchange_installed'))) {
// Check for write-permission for config.php and inc directory
}
$EXT_CSS_FILES = array();
- // Load "databases" aka static arrays
- require_once(PATH."inc/databases.php"); // Several hard-coded databases (arrays, constants)
-
if ((!empty($MySQL['host'])) && (!empty($MySQL['login'])) && (!empty($MySQL['password'])) && (!empty($MySQL['dbase']))) {
// Connect to DB
global $link;
// Something went wrong
ADD_FATAL(FATAL_CANNOT_LOAD_CONFIG);
return;
- }
+ } // END - if
// Load the configuration
$_CONFIG = array_merge($_CONFIG, SQL_FETCHARRAY($result));
// Initialize include-file-pool
$INC_POOL = array();
- // Run daily reset
- if ((date("d", $_CONFIG['last_update']) != date("d", time()) || ((isBooleanConstantAndTrue('DEBUG_MODE')))) && (!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (!isset($_GET['register'])) && ($CSS != 1)) {
- // Do daily things in external PHP file but only when script is completely setup
- $INC_POOL[] = PATH."inc/reset/reset_daily.php";
-
- // Daily reset was run!
- define('__DAILY_RESET', "1");
- }
-
- // Load all extensions
- require_once(PATH."inc/load_extensions.php");
+ // Load "databases" aka static arrays
+ require_once(PATH."inc/databases.php");
// Loading patching system is required here...
require_once(PATH."inc/patch-system.php"); // Initialize patch system
// Functions which are related to themes
require_once(PATH."inc/theme-manager.php");
- // Initialize session management
- require_once(PATH."inc/session.php");
+ // Run daily reset
+ // 01 2 2 2 3321 1 2 21 1 2 21 1 2 21 1 2 21 1 10
+ if ((date("d", $_CONFIG['last_update']) != date("d", time())) && (!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (!isset($_GET['register'])) && ($CSS != 1)) {
+ // Do daily things in external PHP file but only when script is completely setup
+ $INC_POOL = array();
+ $INC_POOL[] = sprintf("%sinc/reset/reset_daily.php", PATH);
+
+ // Daily reset was run!
+ define('__DAILY_RESET', true);
+
+ // Add more includes
+ RESET_ADD_INCLUDES();
+
+ // Run the full reset scripts
+ foreach ($INC_POOL as $incFile) {
+ require_once($incFile);
+ } // END - foreach
+ } // END - if
// Load admin include file if he is admin
if (IS_ADMIN()) {
// Administrative functions
require_once(PATH."inc/modules/admin/admin-inc.php");
- }
+ } // END - if
// Get all values
if (($CSS != 1) && ($CSS != -1)) {
UPDATE_ONLINE_LIST(get_session('PHPSESSID'), $GLOBALS['module'], $GLOBALS['action'], $GLOBALS['what']);
// Load theme name
- $CurrTheme = GET_CURR_THEME();
+ $currTheme = GET_CURR_THEME();
// Set default 'what' value
//* DEBUG */ echo "-".$GLOBALS['module']."/".$GLOBALS['what']."-<br />\n";
// Free memory
SQL_FREERESULT($result);
+
+ // Generate random number
+ if (isset($GLOBALS['userid'])) {
+ define('RAND_NUMBER', GEN_RANDOM_CODE(10, mt_rand(10000,32766), $GLOBALS['userid'], ""));
+ } else {
+ define('RAND_NUMBER', GEN_RANDOM_CODE(10, mt_rand(10000,32766), 0, ""));
+ }
} else {
// Wrong database?
ADD_FATAL(WRONG_DB_SELECTED);
// Include required files
require_once(PATH."inc/databases.php");
require_once(PATH."inc/theme-manager.php");
- require_once(PATH."inc/load_extensions.php");
- require_once(PATH."inc/session.php");
// Check if we are in installation routine
$installPhp = basename($_SERVER['PHP_SELF']);