- $result = SQL_QUERY("SELECT pass_len, points_register, points_ref, least_cats, check_double_email, check_double_pass, admin_notify, url_tlock, test_text, max_tlength, test_subj, autosend_active, max_send, url_blacklist, auto_purge, auto_purge_active, last_update, unconfirmed, profile_lock, online_timeout, mad_timestamp, mad_count, profile_update, send_prof_update, resend_profile_update, code_length, patch_level, patch_ctime, guest_stats, ref_payout, activate_xchange, order_multi_page, display_refid, ip_timeout, allow_direct_pay, config
-FROM "._MYSQL_PREFIX."_config
-WHERE config=0
-LIMIT 1", __FILE__, __LINE__);
-
- if (SQL_NUMROWS($result) == 1) {
- // Load data when previous SQL query did not fail
- if (!is_resource($result)) {
- // 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();
-
- // 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");
-
- // Run daily reset
- require_once(PATH."inc/check-reset.php");
-
- // 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)) {
- if (empty($GLOBALS['module'])) $GLOBALS['module'] = "empty";
- if (empty($GLOBALS['what'])) $GLOBALS['what'] = GET_WHAT($GLOBALS['module']);
- if (empty($GLOBALS['action'])) $GLOBALS['action'] = GET_ACTION($GLOBALS['module'], $GLOBALS['what']);
+ $_CONFIG = merge_array($_CONFIG, LOAD_CONFIG());
+
+ // 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
+
+ // Create missing configuration file
+ if (!function_exists('GET_CURR_THEME')) {
+ // Load dummy theme functions
+ require_once(PATH."inc/theme-dummy.php");
+ } // END - if
+
+ // Session management
+ require_once(PATH."inc/session.php");
+
+ // Run daily reset
+ require_once(PATH."inc/check-reset.php");
+
+ // Load admin include file if he is admin
+ if (IS_ADMIN()) {
+ // Administrative functions
+ require_once(PATH."inc/modules/admin/admin-inc.php");
+ } // END - if
+ //* DEBUG: */ ADD_POINTS_REFSYSTEM("test", 36, 1000);
+ //* DEBUG: */ die();
+
+ // Get all values
+ if (($CSS != 1) && ($CSS != -1)) {
+ if (empty($GLOBALS['module'])) $GLOBALS['module'] = "empty";
+ if (empty($GLOBALS['what'])) $GLOBALS['what'] = GET_WHAT($GLOBALS['module']);
+ if (empty($GLOBALS['action'])) $GLOBALS['action'] = GET_ACTION($GLOBALS['module'], $GLOBALS['what']);
+ } else {
+ // Set action/what to empty
+ $GLOBALS['action'] = "";
+ $GLOBALS['what'] = "";
+ }
+
+ // Run the init filter chain
+ RUN_FILTER('init');
+
+ // Set default 'what' value
+ //* DEBUG: */ echo "-".$GLOBALS['module']."/".$GLOBALS['what']."-<br />\n";
+ if ((empty($GLOBALS['what'])) && (empty($GLOBALS['action'])) && ($CSS != 1) && ($CSS != -1)) {
+ if ($GLOBALS['module'] == "admin") {
+ // Set 'action' value to 'login' in admin menu
+ $GLOBALS['action'] = GET_ACTION($GLOBALS['module'], $GLOBALS['what']);
+ } elseif (($GLOBALS['module'] == "index") || ($GLOBALS['module'] == "login")) {
+ // Set 'what' value to 'welcome' in guest and member menu
+ $GLOBALS['what'] = "welcome";
+ if (getConfig('index_home') != "") $GLOBALS['what'] = getConfig('index_home');