]> git.mxchange.org Git - mailer.git/commitdiff
Global variables rewritten
authorRoland Häder <roland@mxchange.org>
Sat, 28 Feb 2009 13:00:32 +0000 (13:00 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 28 Feb 2009 13:00:32 +0000 (13:00 +0000)
82 files changed:
admin.php
agb.php
beg.php
birthday_confirm.php
click.php
confirm.php
css.php
debug.php
doubler.php
img.php
inc/check-reset.php
inc/db/lib-mysql3.php
inc/extensions.php
inc/extensions/ext-autopurge.php
inc/extensions/ext-bonus.php
inc/extensions/ext-cache.php
inc/extensions/ext-newsletter.php
inc/extensions/ext-profile.php
inc/extensions/ext-rallye.php
inc/extensions/ext-sql_patches.php
inc/filters.php
inc/footer.php
inc/functions.php
inc/gen_refback.php
inc/header.php
inc/libs/admins_functions.php
inc/libs/cache_functions.php
inc/libs/nickname_functions.php
inc/libs/rallye_functions.php
inc/libs/refback_functions.php
inc/libs/theme_functions.php
inc/load_extensions.php
inc/loader/load_cache-admin.php
inc/loader/load_cache-config.php
inc/loader/load_cache-modreg.php
inc/loader/load_cache-refdepths.php
inc/loader/load_cache-refsystem.php
inc/loader/load_cache-them.php
inc/mails/_mails.php
inc/mails/beg_mails.php
inc/mails/birthday_mails.php
inc/mails/bonus_mails.php
inc/modules/admin/admin-inc.php
inc/modules/admin/overview-inc.php
inc/modules/admin/what-admins_add.php
inc/modules/admin/what-admins_edit.php
inc/modules/admin/what-admins_mails.php
inc/modules/admin/what-config_admins.php
inc/modules/admin/what-config_cache.php
inc/modules/admin/what-config_mods.php
inc/modules/admin/what-config_points.php
inc/modules/admin/what-extensions.php
inc/modules/admin/what-theme_check.php
inc/monthly/monthly_beg.php
inc/monthly/monthly_bonus.php
inc/monthly/monthly_newsletter.php
inc/monthly/monthly_surfbar.php
inc/mysql-connect.php
inc/mysql-manager.php
inc/reset/reset_beg.php
inc/reset/reset_bonus.php
inc/reset/reset_daily.php
inc/reset/reset_engine.php
inc/reset/reset_holiday.php
inc/reset/reset_surfbar.php
inc/reset/reset_yoomedia.php
inc/stylesheet.php
inc/weekly/weekly_surfbar.php
index.php
install.php
js.php
lead-confirm.php
login.php
mailid.php
mailid_top.php
modules.php
ref.php
show_bonus.php
sponsor_confirm.php
sponsor_ref.php
surfbar.php
view.php

index f4c3d824cfb4394fd3f2aed13f8af644127a743b..c60d0823e7c7211ab20be3055895559962196b16 100644 (file)
--- a/admin.php
+++ b/admin.php
@@ -41,7 +41,7 @@ $GLOBALS['action'] = "";
 
 // Set module
 $GLOBALS['module'] = "admin";
 
 // Set module
 $GLOBALS['module'] = "admin";
-$CSS = -1;
+$GLOBALS['output_mode'] = -1;
 
 // Load the required file(s)
 require("inc/config.php");
 
 // Load the required file(s)
 require("inc/config.php");
diff --git a/agb.php b/agb.php
index c44da3e8c997f0a9b4936aca6597f1faa0f4119a..c5f79b55f4837f4ecc59ab73f5a67ed07fda1603 100644 (file)
--- a/agb.php
+++ b/agb.php
@@ -39,7 +39,7 @@ global $what, $action;
 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 
 // Set module
 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 
 // Set module
-$GLOBALS['module'] = "agb"; $CSS = -1;
+$GLOBALS['module'] = "agb"; $GLOBALS['output_mode'] = -1;
 
 // Load the required file(s)
 require("inc/config.php");
 
 // Load the required file(s)
 require("inc/config.php");
diff --git a/beg.php b/beg.php
index ae27b8168f4450c241d1426caba25d3333b17ff6..efa0cd53639c91cdb98a6241d15edb2212448649 100644 (file)
--- a/beg.php
+++ b/beg.php
@@ -42,7 +42,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 // Set module
 $GLOBALS['module'] = "beg";
 $GLOBALS['refid']  = 0;
 // Set module
 $GLOBALS['module'] = "beg";
 $GLOBALS['refid']  = 0;
-$CSS = -1;
+$GLOBALS['output_mode'] = -1;
 $msg = null;
 
 // Load the required file(s)
 $msg = null;
 
 // Load the required file(s)
index cfbbb60f2de45073fbcac36e6ba69e68f39f6283..d93bc3a0aa83e3a890a9d770c4f66c0ed7539922 100644 (file)
@@ -39,7 +39,7 @@ global $what, $action;
 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 
 // Set module
 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 
 // Set module
-$GLOBALS['module'] = "birthday_confirm"; $CSS = -1;
+$GLOBALS['module'] = "birthday_confirm"; $GLOBALS['output_mode'] = -1;
 
 // Load the required file(s)
 require("inc/config.php");
 
 // Load the required file(s)
 require("inc/config.php");
index 94d68602c7d97420e0f240dc2a875a85a1a311c8..e7c7e4d04b2ad2fad530cd4c51df0d4bc3e42147 100644 (file)
--- a/click.php
+++ b/click.php
@@ -39,7 +39,7 @@ global $what, $action;
 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 
 // Set module
 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 
 // Set module
-$GLOBALS['module'] = "click"; $CSS = -1;
+$GLOBALS['module'] = "click"; $GLOBALS['output_mode'] = -1;
 
 // Load the required file(s)
 require("inc/config.php");
 
 // Load the required file(s)
 require("inc/config.php");
index ef0b7d9169d4faeadaf1cbc5bc7e3163558117cc..8a8ac8106d2c3fe81ad6737b0a9a10823d253fa2 100644 (file)
@@ -39,7 +39,7 @@ global $what, $action;
 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 
 // Set module to confirm
 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 
 // Set module to confirm
-$GLOBALS['module'] = "confirm"; $CSS = -1;
+$GLOBALS['module'] = "confirm"; $GLOBALS['output_mode'] = -1;
 
 // Load the required file(s)
 require("inc/config.php");
 
 // Load the required file(s)
 require("inc/config.php");
diff --git a/css.php b/css.php
index 9efdc9588be4fbfcf49f22d4dd7e0652010767f2..03eb704d1a10abc9c070aeb582c864137a832c8e 100644 (file)
--- a/css.php
+++ b/css.php
@@ -38,17 +38,17 @@ define('_OB_CACHING', "old");
 require("inc/libs/security_functions.php");
 
 // Init "action" and "what"
 require("inc/libs/security_functions.php");
 
 // Init "action" and "what"
-global $what, $action, $footer;
+global $what, $action;
 
 // Footer is disabled in CSS mode
 
 // Footer is disabled in CSS mode
-$footer = "-1";
+$GLOBALS['footer_sent'] = "-1";
 
 // Init variables
 $GLOBALS['what'] = "";
 $GLOBALS['action'] = "";
 
 // This is a CSS file loader!
 
 // Init variables
 $GLOBALS['what'] = "";
 $GLOBALS['action'] = "";
 
 // This is a CSS file loader!
-$CSS = "1";
+$GLOBALS['output_mode'] = "1";
 $GLOBALS['module'] = "css";
 
 // Set header
 $GLOBALS['module'] = "css";
 
 // Set header
index 2466faa8585cfda18f1f181cdc4960f234b4ed4f..dcbc274a9c0d4707982c217dfaffb0233cbe7e91 100644 (file)
--- a/debug.php
+++ b/debug.php
@@ -40,7 +40,7 @@ $GLOBALS['what'] = "";
 $GLOBALS['action'] = "";
 
 // Set module and fake "CSS mode"
 $GLOBALS['action'] = "";
 
 // Set module and fake "CSS mode"
-$GLOBALS['module'] = "debug"; $CSS = -1;
+$GLOBALS['module'] = "debug"; $GLOBALS['output_mode'] = -1;
 
 // Load the required file(s)
 require("inc/config.php");
 
 // Load the required file(s)
 require("inc/config.php");
index fb92ccfbd4d42ec769e6123dde6a73eecec8dcbf..9a4815704453ec8f5f0990e5d9805ad46dd9aa31 100644 (file)
@@ -43,7 +43,7 @@ $GLOBALS['action'] = "";
 // Set module
 $GLOBALS['module'] = "doubler";
 $GLOBALS['refid'] = 0;
 // Set module
 $GLOBALS['module'] = "doubler";
 $GLOBALS['refid'] = 0;
-$CSS = 0;
+$GLOBALS['output_mode'] = 0;
 
 // Load the required file(s)
 require("inc/config.php");
 
 // Load the required file(s)
 require("inc/config.php");
diff --git a/img.php b/img.php
index 4a6c77dd70819a24dc704281dbb6c6fb17bba65b..cf410ccdb14ba007296e0cdf4cab79469575be86 100644 (file)
--- a/img.php
+++ b/img.php
@@ -39,7 +39,7 @@ global $what, $action;
 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 
 // Set module
 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 
 // Set module
-$GLOBALS['module'] = "img"; $CSS = -1;
+$GLOBALS['module'] = "img"; $GLOBALS['output_mode'] = -1;
 
 // Load the required file(s)
 require("inc/config.php");
 
 // Load the required file(s)
 require("inc/config.php");
index 88335c12cce072a487cc0d14249df36b98cf7ac4..44e0944eb0d7783731eac96028d75b8d2b49a9d4 100644 (file)
@@ -37,8 +37,8 @@ if (!defined('__SECURITY')) {
        require($INC);
 }
 
        require($INC);
 }
 
-// 01    2              3             32        2         3321    12        3                     32    2                    21    1                        2                    21    1                        2                  21    1      2                 21    1         10
-if ((date("d", getConfig('last_update')) != date("d", time())) && ((!defined('mxchange_installing')) || (!mxchange_installing)) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (!isset($_GET['register'])) && ($CSS != 1)) {
+// 01    2              3             32        2         3321    12        3                     32    2                    21    1                        2                    21    1                        2                  21    1      2                 21    1                            10
+if ((date("d", getConfig('last_update')) != date("d", time())) && ((!defined('mxchange_installing')) || (!mxchange_installing)) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (!isset($_GET['register'])) && ($GLOBALS['output_mode'] != 1)) {
        // Do daily things in external PHP file but only when script is completely setup
        // Daily reset was run!
        define('__DAILY_RESET', true);
        // Do daily things in external PHP file but only when script is completely setup
        // Daily reset was run!
        define('__DAILY_RESET', true);
index 50b7189f8358b768cbee03da7fc8115b129c3c5e..ea128166a729c5e3632e70da4df57ee9be7915d2 100644 (file)
@@ -39,7 +39,7 @@ if (!defined('__SECURITY')) {
 
 // SQL queries
 function SQL_QUERY ($sql_string, $F, $L) {
 
 // SQL queries
 function SQL_QUERY ($sql_string, $F, $L) {
-       global $link, $CSS, $OK;
+       global $link, $OK;
 
        // Link is up?
        if (!is_resource($link)) return false;
 
        // Link is up?
        if (!is_resource($link)) return false;
@@ -75,7 +75,7 @@ Query string:<br />
        // Debug output
        //* DEBUG: */ print "Query=<pre>".$sql_string."</pre>, affected=<strong>".SQL_AFFECTEDROWS()."</strong>, numrows=<strong>".SQL_NUMROWS($result)."</strong><br />\n";
 
        // Debug output
        //* DEBUG: */ print "Query=<pre>".$sql_string."</pre>, affected=<strong>".SQL_AFFECTEDROWS()."</strong>, numrows=<strong>".SQL_NUMROWS($result)."</strong><br />\n";
 
-       if (($CSS != "1") && ($CSS != "-1") && (isBooleanConstantAndTrue('DEBUG_MODE')) && (isBooleanConstantAndTrue('DEBUG_SQL'))) {
+       if (($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1") && (isBooleanConstantAndTrue('DEBUG_MODE')) && (isBooleanConstantAndTrue('DEBUG_SQL'))) {
                //
                // Debugging stuff...
                //
                //
                // Debugging stuff...
                //
@@ -197,8 +197,6 @@ function SQL_SELECT_DB ($dbName, $link, $F, $L) {
 
 // SQL close link
 function SQL_CLOSE (&$link, $F, $L) {
 
 // SQL close link
 function SQL_CLOSE (&$link, $F, $L) {
-       global $cacheInstance, $cacheArray;
-
        if (!is_resource($link)) {
                // Skip double close
                return false;
        if (!is_resource($link)) {
                // Skip double close
                return false;
@@ -206,7 +204,7 @@ function SQL_CLOSE (&$link, $F, $L) {
 
        // Do we need to update cache/db counter?
        //* DEBUG: */ echo "DB=".getConfig('db_hits').",CACHE=".getConfig('cache_hits')."<br />\n";
 
        // Do we need to update cache/db counter?
        //* DEBUG: */ echo "DB=".getConfig('db_hits').",CACHE=".getConfig('cache_hits')."<br />\n";
-       if ((GET_EXT_VERSION("cache") >= "0.0.7") && (getConfig('db_hits') > 0) && (getConfig('cache_hits') > 0) && (is_object($cacheInstance))) {
+       if ((GET_EXT_VERSION("cache") >= "0.0.7") && (getConfig('db_hits') > 0) && (getConfig('cache_hits') > 0) && (is_object($GLOBALS['cache_instance']))) {
                // Add new hits
                incrementConfigEntry('db_hits', getConfig('db_hits_run'));
 
                // Add new hits
                incrementConfigEntry('db_hits', getConfig('db_hits_run'));
 
index 608cb3234fa92c51de596fb65019fec9637a045e..0f02e6a12485495daa7c172bdd724f66c24f12da 100644 (file)
@@ -39,7 +39,7 @@ if (!defined('__SECURITY')) {
 
 // Load the extension and maybe found language and function files.
 function LOAD_EXTENSION ($ext_name, $EXT_LOAD_MODE = "", $EXT_VER = "", $dry_run = false, &$SQLs = array()) {
 
 // Load the extension and maybe found language and function files.
 function LOAD_EXTENSION ($ext_name, $EXT_LOAD_MODE = "", $EXT_VER = "", $dry_run = false, &$SQLs = array()) {
-       global $EXT_LOADED, $_CONFIG, $CSS, $cacheMode, $EXT_VER_HISTORY;
+       global $EXT_LOADED, $_CONFIG, $EXT_VER_HISTORY;
        global $INC_POOL, $EXT_UPDATE_DEPENDS, $EXT_DEPRECATED, $UPDATE_NOTES;
        global $EXT_VERSION, $EXT_ALWAYS_ACTIVE;
 
        global $INC_POOL, $EXT_UPDATE_DEPENDS, $EXT_DEPRECATED, $UPDATE_NOTES;
        global $EXT_VERSION, $EXT_ALWAYS_ACTIVE;
 
@@ -128,7 +128,7 @@ function LOAD_EXTENSION ($ext_name, $EXT_LOAD_MODE = "", $EXT_VER = "", $dry_run
 
 // Registeres an extension and possible update depencies
 function EXTENSION_REGISTER ($ext_name, $task_id, $dry_run = false, $logout = true) {
 
 // Registeres an extension and possible update depencies
 function EXTENSION_REGISTER ($ext_name, $task_id, $dry_run = false, $logout = true) {
-       global $UPDATE_NOTES, $INC_POOL, $cacheInstance;
+       global $UPDATE_NOTES, $INC_POOL;
        global $EXT_VER_HISTORY, $NOTES, $EXT_ALWAYS_ACTIVE, $EXT_VERSION;
        global $EXT_UPDATE_DEPENDS;
 
        global $EXT_VER_HISTORY, $NOTES, $EXT_ALWAYS_ACTIVE, $EXT_VERSION;
        global $EXT_UPDATE_DEPENDS;
 
@@ -271,8 +271,6 @@ function EXTENSION_REGISTER ($ext_name, $task_id, $dry_run = false, $logout = tr
 // Run SQL queries for given extension id
 // @TODO Change from ext_id to ext_name (not just even the variable! ;-) )
 function EXTENSION_RUN_SQLS ($ext_id, $load_mode) {
 // Run SQL queries for given extension id
 // @TODO Change from ext_id to ext_name (not just even the variable! ;-) )
 function EXTENSION_RUN_SQLS ($ext_id, $load_mode) {
-       global $cacheInstance;
-
        // This shall never do a non-admin user!
        if (!IS_ADMIN()) return false;
 
        // This shall never do a non-admin user!
        if (!IS_ADMIN()) return false;
 
@@ -321,8 +319,6 @@ function EXTENSION_RUN_SQLS ($ext_id, $load_mode) {
 
 // Check if given extension is active
 function EXT_IS_ACTIVE ($ext_name) {
 
 // Check if given extension is active
 function EXT_IS_ACTIVE ($ext_name) {
-       global $cacheArray;
-
        // Extensions are all inactive during installation
        if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing')) || (empty($ext_name))) return false;
 
        // Extensions are all inactive during installation
        if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing')) || (empty($ext_name))) return false;
 
@@ -330,10 +326,10 @@ function EXT_IS_ACTIVE ($ext_name) {
        $active = "N";
 
        // Check cache
        $active = "N";
 
        // Check cache
-       if (isset($cacheArray['extensions']['ext_active'][$ext_name])) {
+       if (isset($GLOBALS['cache_array']['extensions']['ext_active'][$ext_name])) {
                // Load from cache
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "CACHE! ext_name={$ext_name}");
                // Load from cache
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "CACHE! ext_name={$ext_name}");
-               $active = $cacheArray['extensions']['ext_active'][$ext_name];
+               $active = $GLOBALS['cache_array']['extensions']['ext_active'][$ext_name];
 
                // Count cache hits
                incrementConfigEntry('cache_hits');
 
                // Count cache hits
                incrementConfigEntry('cache_hits');
@@ -354,11 +350,11 @@ function EXT_IS_ACTIVE ($ext_name) {
 
                // Write cache array
                //* DEBUG: */ echo $ext_name."[DB]: {$active}");
 
                // Write cache array
                //* DEBUG: */ echo $ext_name."[DB]: {$active}");
-               $cacheArray['extensions']['ext_active'][$ext_name] = $active;
+               $GLOBALS['cache_array']['extensions']['ext_active'][$ext_name] = $active;
        } else {
                // Extension not active!
                //* DEBUG: */ echo $ext_name.": Not active!");
        } else {
                // Extension not active!
                //* DEBUG: */ echo $ext_name.": Not active!");
-               $cacheArray['extensions']['ext_active'][$ext_name] = "N";
+               $GLOBALS['cache_array']['extensions']['ext_active'][$ext_name] = "N";
        }
 
        // Debug message
        }
 
        // Debug message
@@ -369,7 +365,7 @@ function EXT_IS_ACTIVE ($ext_name) {
 }
 // Get version from extensions
 function GET_EXT_VERSION ($ext_name) {
 }
 // Get version from extensions
 function GET_EXT_VERSION ($ext_name) {
-       global $cacheArray, $cacheInstance;
+       // By default no extension is found
        $ext_ver = false;
 
        // Extensions are all inactive during installation
        $ext_ver = false;
 
        // Extensions are all inactive during installation
@@ -377,14 +373,14 @@ function GET_EXT_VERSION ($ext_name) {
        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, ": ext_name={$ext_name}");
 
        // Is the cache written?
        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, ": ext_name={$ext_name}");
 
        // Is the cache written?
-       if (isset($cacheArray['extensions']['ext_version'][$ext_name])) {
+       if (isset($GLOBALS['cache_array']['extensions']['ext_version'][$ext_name])) {
                // Load data from cache
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, ": CACHE!");
                // Load data from cache
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, ": CACHE!");
-               $ext_ver = $cacheArray['extensions']['ext_version'][$ext_name];
+               $ext_ver = $GLOBALS['cache_array']['extensions']['ext_version'][$ext_name];
 
                // Count cache hits
                incrementConfigEntry('cache_hits');
 
                // Count cache hits
                incrementConfigEntry('cache_hits');
-       } elseif (!is_object($cacheInstance)) {
+       } elseif (!is_object($GLOBALS['cache_instance'])) {
                // Load from database
                $result = SQL_QUERY_ESC("SELECT ext_version FROM `{!_MYSQL_PREFIX!}_extensions` WHERE ext_name='%s' LIMIT 1",
                        array($ext_name), __FILE__, __LINE__);
                // Load from database
                $result = SQL_QUERY_ESC("SELECT ext_version FROM `{!_MYSQL_PREFIX!}_extensions` WHERE ext_name='%s' LIMIT 1",
                        array($ext_name), __FILE__, __LINE__);
@@ -399,7 +395,7 @@ function GET_EXT_VERSION ($ext_name) {
                SQL_FREERESULT($result);
 
                // Set cache
                SQL_FREERESULT($result);
 
                // Set cache
-               $cacheArray['extensions']['ext_version'][$ext_name] = $ext_ver;
+               $GLOBALS['cache_array']['extensions']['ext_version'][$ext_name] = $ext_ver;
        }
 
        // Return result
        }
 
        // Return result
@@ -410,8 +406,8 @@ function GET_EXT_VERSION ($ext_name) {
 // Updates a given extension with current extension version to latest version
 function EXTENSION_UPDATE ($ext_name, $ext_ver, $dry_run = false) {
        // This shall never do a non-admin user!
 // Updates a given extension with current extension version to latest version
 function EXTENSION_UPDATE ($ext_name, $ext_ver, $dry_run = false) {
        // This shall never do a non-admin user!
-       global $cacheInstance, $UPDATE_NOTES, $NOTES, $EXT_VER_HISTORY;
-       global $EXT_UPDATE_DEPENDS, $EXT_VERSION, $INC_POOL, $cacheArray, $SQLs;
+       global $UPDATE_NOTES, $NOTES, $EXT_VER_HISTORY;
+       global $EXT_UPDATE_DEPENDS, $EXT_VERSION, $INC_POOL, $SQLs;
 
        // Init arrays
        $SQLs = array(); $INC_POOL = array();
 
        // Init arrays
        $SQLs = array(); $INC_POOL = array();
@@ -439,14 +435,14 @@ function EXTENSION_UPDATE ($ext_name, $ext_ver, $dry_run = false) {
                // And load SQL queries in order of version history
                for ($idx = ($start + 1); $idx < sizeof($history); $idx++) {
                        // Set extension version
                // And load SQL queries in order of version history
                for ($idx = ($start + 1); $idx < sizeof($history); $idx++) {
                        // Set extension version
-                       $cacheArray['update_ver'][$ext_name] = $history[$idx];
+                       $GLOBALS['cache_array']['update_ver'][$ext_name] = $history[$idx];
 
                        // Load again...
 
                        // Load again...
-                       LOAD_EXTENSION($ext_name, "update", $cacheArray['update_ver'][$ext_name], $dry_run, $SQLs);
+                       LOAD_EXTENSION($ext_name, "update", $GLOBALS['cache_array']['update_ver'][$ext_name], $dry_run, $SQLs);
 
                        if (!empty($EXT_UPDATE_DEPENDS)) {
                                // Backup current SQL queries
 
                        if (!empty($EXT_UPDATE_DEPENDS)) {
                                // Backup current SQL queries
-                               $cacheArray['update_sqls'][$ext_name] = $SQLs;
+                               $GLOBALS['cache_array']['update_sqls'][$ext_name] = $SQLs;
 
                                // Is the extension there?
                                if (GET_EXT_VERSION($EXT_UPDATE_DEPENDS) != "") {
 
                                // Is the extension there?
                                if (GET_EXT_VERSION($EXT_UPDATE_DEPENDS) != "") {
@@ -458,20 +454,20 @@ function EXTENSION_UPDATE ($ext_name, $ext_ver, $dry_run = false) {
                                }
 
                                // Restore previous SQL queries
                                }
 
                                // Restore previous SQL queries
-                               $SQLs = $cacheArray['update_sqls'][$ext_name];
-                               unset($cacheArray['update_sqls'][$ext_name]);
+                               $SQLs = $GLOBALS['cache_array']['update_sqls'][$ext_name];
+                               unset($GLOBALS['cache_array']['update_sqls'][$ext_name]);
                        } // END - if
 
                        // Add notes
                        } // END - if
 
                        // Add notes
-                       $NOTES .= ADD_EXTENSION_NOTES($cacheArray['update_ver'][$ext_name], $UPDATE_NOTES);
+                       $NOTES .= ADD_EXTENSION_NOTES($GLOBALS['cache_array']['update_ver'][$ext_name], $UPDATE_NOTES);
                } // END - for
 
                // In real-mode execute any existing includes
                if (!$dry_run) {
                } // END - for
 
                // In real-mode execute any existing includes
                if (!$dry_run) {
-                       $cacheArray['inc_pool'][$ext_name] = $INC_POOL;
+                       $GLOBALS['cache_array']['inc_pool'][$ext_name] = $INC_POOL;
                        RUN_FILTER('load_includes', $INC_POOL);
                        RUN_FILTER('load_includes', $INC_POOL);
-                       $INC_POOL = $cacheArray['inc_pool'][$ext_name];
-                       unset($cacheArray['inc_pool'][$ext_name]);
+                       $INC_POOL = $GLOBALS['cache_array']['inc_pool'][$ext_name];
+                       unset($GLOBALS['cache_array']['inc_pool'][$ext_name]);
                } // END - if
 
                // Run SQLs
                } // END - if
 
                // Run SQLs
@@ -479,15 +475,15 @@ function EXTENSION_UPDATE ($ext_name, $ext_ver, $dry_run = false) {
 
                if (!$dry_run) {
                        // Create task
 
                if (!$dry_run) {
                        // Create task
-                       CREATE_EXTENSION_UPDATE_TASK(GET_CURRENT_ADMIN_ID(), $ext_name, $cacheArray['update_ver'][$ext_name], SQL_ESCAPE($NOTES));
+                       CREATE_EXTENSION_UPDATE_TASK(GET_CURRENT_ADMIN_ID(), $ext_name, $GLOBALS['cache_array']['update_ver'][$ext_name], SQL_ESCAPE($NOTES));
 
                        // Update extension's version
                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_version='%s' WHERE ext_name='%s' LIMIT 1",
 
                        // Update extension's version
                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_version='%s' WHERE ext_name='%s' LIMIT 1",
-                               array($cacheArray['update_ver'][$ext_name], $ext_name), __FILE__, __LINE__);
+                               array($GLOBALS['cache_array']['update_ver'][$ext_name], $ext_name), __FILE__, __LINE__);
 
                        // Remove arrays
                        unset($SQLs);
 
                        // Remove arrays
                        unset($SQLs);
-                       unset($cacheArray['update_ver'][$ext_name]);
+                       unset($GLOBALS['cache_array']['update_ver'][$ext_name]);
 
                        // Run filters on success extension update
                        RUN_FILTER('extension_update', $ext_name);
 
                        // Run filters on success extension update
                        RUN_FILTER('extension_update', $ext_name);
@@ -563,15 +559,13 @@ function EXTENSION_VERBOSE_TABLE ($queries = array(), $title = "", $dashed = "",
 
 // Get extension name from id
 function GET_EXT_NAME ($ext_id) {
 
 // Get extension name from id
 function GET_EXT_NAME ($ext_id) {
-       global $cacheArray;
-
        // Init extension name
        $ret = "";
 
        // Is cache there?
        // Init extension name
        $ret = "";
 
        // Is cache there?
-       if (isset($cacheArray['extensions']['ext_name'][$ext_id])) {
+       if (isset($GLOBALS['cache_array']['extensions']['ext_name'][$ext_id])) {
                // Load from cache
                // Load from cache
-               $ret = $cacheArray['extensions']['ext_name'][$ext_id];
+               $ret = $GLOBALS['cache_array']['extensions']['ext_name'][$ext_id];
 
                // Count cache hits
                incrementConfigEntry('cache_hits');
 
                // Count cache hits
                incrementConfigEntry('cache_hits');
@@ -587,13 +581,11 @@ function GET_EXT_NAME ($ext_id) {
 
 // Get extension id from name
 function GET_EXT_ID ($ext_name) {
 
 // Get extension id from name
 function GET_EXT_ID ($ext_name) {
-       global $cacheArray;
-
        // Init ID number
        $ret = 0;
        // Init ID number
        $ret = 0;
-       if (isset($cacheArray['extensions']['ext_id'][$ext_name])) {
+       if (isset($GLOBALS['cache_array']['extensions']['ext_id'][$ext_name])) {
                // Load from cache
                // Load from cache
-               $ret = $cacheArray['extensions']['ext_id'][$ext_name];
+               $ret = $GLOBALS['cache_array']['extensions']['ext_id'][$ext_name];
 
                // Count cache hits
                incrementConfigEntry('cache_hits');
 
                // Count cache hits
                incrementConfigEntry('cache_hits');
@@ -726,20 +718,19 @@ VALUES (0,0,'NEW','EXTENSION_DEACTIVATION','%s','%s',UNIX_TIMESTAMP())",
 
 // Checks if the module has a menu
 function MODULE_HAS_MENU ($mod, $forceDb = false) {
 
 // Checks if the module has a menu
 function MODULE_HAS_MENU ($mod, $forceDb = false) {
-       global $cacheArray;
-
        // All is false by default
        $ret = false;
        // All is false by default
        $ret = false;
+
        //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):mod={$mod},cache=".GET_EXT_VERSION("cache")."<br />\n";
        if (GET_EXT_VERSION("cache") >= "0.1.2") {
                // Cache version is okay, so let's check the cache!
        //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):mod={$mod},cache=".GET_EXT_VERSION("cache")."<br />\n";
        if (GET_EXT_VERSION("cache") >= "0.1.2") {
                // Cache version is okay, so let's check the cache!
-               if (isset($cacheArray['modules']['has_menu'][$mod])) {
+               if (isset($GLOBALS['cache_array']['modules']['has_menu'][$mod])) {
                        // Check module cache and count hit
                        // Check module cache and count hit
-                       $ret = ($cacheArray['modules']['has_menu'][$mod] == "Y");
+                       $ret = ($GLOBALS['cache_array']['modules']['has_menu'][$mod] == "Y");
                        incrementConfigEntry('cache_hits');
                        incrementConfigEntry('cache_hits');
-               } elseif (isset($cacheArray['extensions']['ext_menu'][$mod])) {
+               } elseif (isset($GLOBALS['cache_array']['extensions']['ext_menu'][$mod])) {
                        // Check cache and count hit
                        // Check cache and count hit
-                       $ret = ($cacheArray['extensions']['ext_menu'][$mod] == "Y");
+                       $ret = ($GLOBALS['cache_array']['extensions']['ext_menu'][$mod] == "Y");
                        incrementConfigEntry('cache_hits');
                } elseif ((IS_ADMIN()) && ($mod == "admin")) {
                        // Admin module has always a menu!
                        incrementConfigEntry('cache_hits');
                } elseif ((IS_ADMIN()) && ($mod == "admin")) {
                        // Admin module has always a menu!
@@ -756,7 +747,7 @@ function MODULE_HAS_MENU ($mod, $forceDb = false) {
                        list($has_menu) = SQL_FETCHROW($result);
 
                        // Fake cache... ;-)
                        list($has_menu) = SQL_FETCHROW($result);
 
                        // Fake cache... ;-)
-                       $cacheArray['extensions']['ext_menu'][$mod] = $has_menu;
+                       $GLOBALS['cache_array']['extensions']['ext_menu'][$mod] = $has_menu;
 
                        // Does it have a menu?
                        $ret = ($has_menu == "Y");
 
                        // Does it have a menu?
                        $ret = ($has_menu == "Y");
index d876c0188b8cf63aa361cddbfa0d7a8186d7fda8..2a49e5361ca07a8b68156a75f9608aceb65c1564 100644 (file)
@@ -254,8 +254,7 @@ case "test": // For testing purposes. For details see file inc/modules/admin/wha
 
 default: // Do stuff when extension is loaded
        // Do we have a daily-reset-run?
 
 default: // Do stuff when extension is loaded
        // Do we have a daily-reset-run?
-       if (isBooleanConstantAndTrue('__DAILY_RESET') && (!isBooleanConstantAndTrue('DEBUG_MODE')) && ($CSS != 1))
-       {
+       if (isBooleanConstantAndTrue('__DAILY_RESET') && (!isBooleanConstantAndTrue('DEBUG_MODE')) && ($GLOBALS['output_mode'] != 1)) {
                // Yes, we have. So let's auto-purge some campaigns, inactive users and unconfirmed accounts
                $INC_POOL[] = sprintf("%sinc/autopurge.php", constant('PATH'));
        }
                // Yes, we have. So let's auto-purge some campaigns, inactive users and unconfirmed accounts
                $INC_POOL[] = sprintf("%sinc/autopurge.php", constant('PATH'));
        }
index 637aef549464d80e9b50777b088597871c89c57c..ce535c248113890909afcce1d1a4ecd05f52ccf3 100644 (file)
@@ -546,7 +546,7 @@ case "test": // For testing purposes. For details see file inc/modules/admin/wha
        break;
 
 default: // Do stuff when extension is loaded
        break;
 
 default: // Do stuff when extension is loaded
-       if (isBooleanConstantAndTrue('__DAILY_RESET') && (!isBooleanConstantAndTrue('DEBUG_MODE')) && ($CSS != 1)) {
+       if (isBooleanConstantAndTrue('__DAILY_RESET') && (!isBooleanConstantAndTrue('DEBUG_MODE')) && ($GLOBALS['output_mode'] != 1)) {
                // Daily reset was run so let's check if active rallye is activated
                if (getConfig('bonus_active') == "Y") {
                        // Run active rallye
                // Daily reset was run so let's check if active rallye is activated
                if (getConfig('bonus_active') == "Y") {
                        // Run active rallye
index 897c3e370ce69272cd8d9d9ef756c4341cb730fb..5f7a2d412beaad44aca637f0ea3cecf0f74fcf0a 100644 (file)
@@ -106,7 +106,7 @@ case "update": // Update an extension
                // Is the cache extension itself there?
                if (EXT_IS_ACTIVE("cache")) {
                        // Check for cache when extension is already installed
                // Is the cache extension itself there?
                if (EXT_IS_ACTIVE("cache")) {
                        // Check for cache when extension is already installed
-                       if ($cacheInstance->loadCacheFile("extensions", true)) $cacheInstance->destroyCacheFile();
+                       if ($GLOBALS['cache_instance']->loadCacheFile("extensions", true)) $GLOBALS['cache_instance']->destroyCacheFile();
                } // END - if
 
                // Update notes (these will be set as task text!)
                } // END - if
 
                // Update notes (these will be set as task text!)
@@ -243,13 +243,10 @@ case "test": // For testing purposes. For details see file inc/modules/admin/wha
 
 default: // Do stuff when extension is loaded
        // Create instance on class
 
 default: // Do stuff when extension is loaded
        // Create instance on class
-       if ($cacheMode != "init") {
-               // Make cacheInstance global
-               global $cacheInstance;
-
+       if ($GLOBALS['cacheMode'] != "init") {
                // Initialize cache system only when it's needed
                // Initialize cache system only when it's needed
-               $cacheInstance = new CacheSystem(getConfig('cache_update'), constant('PATH')."inc/".getConfig('cache_path'), getConfig('cache_tested'));
-               if ($cacheInstance->getStatus() != "done") {
+               $GLOBALS['cache_instance'] = new CacheSystem(getConfig('cache_update'), constant('PATH')."inc/".getConfig('cache_path'), getConfig('cache_tested'));
+               if ($GLOBALS['cache_instance']->getStatus() != "done") {
                        // Failed to initialize cache sustem
                        addFatalMessage(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_CANNOT_INITIALIZE);
                } // END - if
                        // Failed to initialize cache sustem
                        addFatalMessage(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_CANNOT_INITIALIZE);
                } // END - if
index e71f0362be7cc7613084c3c5554e760a24ef48da..e0132cf33226da2109b922a0445f2f6a9e772891 100644 (file)
@@ -168,7 +168,7 @@ default: // Do stuff when extension is loaded
                '2','3','4','5','6','7','8','9'
        );
 
                '2','3','4','5','6','7','8','9'
        );
 
-       if (isBooleanConstantAndTrue('__DAILY_RESET') && (!isBooleanConstantAndTrue('DEBUG_MODE')) && ($CSS != 1)) {
+       if (isBooleanConstantAndTrue('__DAILY_RESET') && (!isBooleanConstantAndTrue('DEBUG_MODE')) && ($GLOBALS['output_mode'] != 1)) {
                // Daily reset was run so let's check out for expired newsletter orders
                $INC_POOL[] = sprintf("%sinc/monthly/monthly_newsletter.php", constant('PATH'));
        }
                // Daily reset was run so let's check out for expired newsletter orders
                $INC_POOL[] = sprintf("%sinc/monthly/monthly_newsletter.php", constant('PATH'));
        }
index 6d2805798f267b9aae44a37a4be9c110eb1f92fa..d9fe6f61a731fbb99c295f9e3fddc9c0465aa6c5 100644 (file)
@@ -123,7 +123,7 @@ case "test": // For testing purposes. For details see file inc/modules/admin/wha
 
 default: // Do stuff when extension is loaded
        // Do we have a daily-reset-run?
 
 default: // Do stuff when extension is loaded
        // Do we have a daily-reset-run?
-       if (isBooleanConstantAndTrue('__DAILY_RESET') && (!isBooleanConstantAndTrue('DEBUG_MODE')) && ($CSS != 1)) {
+       if (isBooleanConstantAndTrue('__DAILY_RESET') && (!isBooleanConstantAndTrue('DEBUG_MODE')) && ($GLOBALS['output_mode'] != 1)) {
                // So let's check for profiles which needs an update
                $INC_POOL[] = sprintf("%sinc/profile-updte.php", constant('PATH'));
        }
                // So let's check for profiles which needs an update
                $INC_POOL[] = sprintf("%sinc/profile-updte.php", constant('PATH'));
        }
index a4d6c26d05b0742bd0415a18e3ffee62af2ceb30..6fa30c5ba04472ab03ed95d1299476a000189f0b 100644 (file)
@@ -324,7 +324,7 @@ case "test": // For testing purposes. For details see file inc/modules/admin/wha
 
 default: // Do stuff when extension is loaded
        // Do stuff only when not in CSS mode
 
 default: // Do stuff when extension is loaded
        // Do stuff only when not in CSS mode
-       if (($CSS != "1") && ($CSS != "-1") && ($cacheMode != "init")) {
+       if (($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1") && ($GLOBALS['cacheMode'] != "init")) {
                // Get total member count
                $TOTAL = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true);
 
                // Get total member count
                $TOTAL = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true);
 
index 4c6b4cf8ca151f336d0dd81a37d25c59bffe0852..e589f5f6991e3dd384c84e86b6d32d2b8126aa9d 100644 (file)
@@ -732,18 +732,16 @@ default: // Do stuff when extension is loaded
                // Read key from secret file
                if ((getConfig('file_hash') == "") || (getConfig('master_salt') == "") || (getConfig('pass_scramble') == "")) {
                        // Cache instance
                // Read key from secret file
                if ((getConfig('file_hash') == "") || (getConfig('master_salt') == "") || (getConfig('pass_scramble') == "")) {
                        // Cache instance
-                       global $cacheInstance;
-
                        // Maybe need setup of secret key!
                        LOAD_INC_ONCE("inc/gen_sql_patches.php");
 
                        // @TODO Rewrite this to a filter!
                        // Maybe need setup of secret key!
                        LOAD_INC_ONCE("inc/gen_sql_patches.php");
 
                        // @TODO Rewrite this to a filter!
-                       if ((GET_EXT_VERSION("cache") >= "0.1.2") && (isset($cacheInstance)) && (is_object($cacheInstance))) {
+                       if ((GET_EXT_VERSION("cache") >= "0.1.2") && (isset($GLOBALS['cache_instance'])) && (is_object($GLOBALS['cache_instance']))) {
                                // Remove extensions and mod_reg cache file
                                LOAD_INC_ONCE("inc/libs/cache_functions.php");
                                require(sprintf("%sinc/extensions/ext-cache.php", constant('PATH')));
                                // Remove extensions and mod_reg cache file
                                LOAD_INC_ONCE("inc/libs/cache_functions.php");
                                require(sprintf("%sinc/extensions/ext-cache.php", constant('PATH')));
-                               if ($cacheInstance->loadCacheFile("extensions", true)) $cacheInstance->destroyCacheFile();
-                               if ($cacheInstance->loadCacheFile("mod_reg"))          $cacheInstance->destroyCacheFile();
+                               if ($GLOBALS['cache_instance']->loadCacheFile("extensions", true)) $GLOBALS['cache_instance']->destroyCacheFile();
+                               if ($GLOBALS['cache_instance']->loadCacheFile("mod_reg"))          $GLOBALS['cache_instance']->destroyCacheFile();
                        } // END - if
                } // END - if
 
                        } // END - if
                } // END - if
 
index f289810b5312d86a5488741cff69bbdaa1232905..1ffea5b4208a6d0d597807fa718e0cb0be955720 100644 (file)
@@ -389,8 +389,6 @@ function FILTER_SOLVE_TASK ($data) {
 
 // Filter to load include files
 function FILTER_LOAD_INCLUDES ($data) {
 
 // Filter to load include files
 function FILTER_LOAD_INCLUDES ($data) {
-       global $CSS;
-
        // Default is $data as inclusion list
        $INC_POOL = $data;
 
        // Default is $data as inclusion list
        $INC_POOL = $data;
 
index e2d31c6e6d9d3f2c32375c71ea804043cf53b0c1..365b5dceece923ae634a90c9dbfa9e1f880e7129 100644 (file)
@@ -32,7 +32,7 @@
  ************************************************************************/
 
 // Global variable stuff
  ************************************************************************/
 
 // Global variable stuff
-global $link, $frame, $CSS, $header, $footer;
+global $link, $frame;
 
 // Some security stuff...
 if (!defined('__SECURITY')) {
 
 // Some security stuff...
 if (!defined('__SECURITY')) {
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Footer disabled or already sent?
 } // END - if
 
 // Footer disabled or already sent?
-if (($footer != "1") && ($footer != "2") && ($CSS != "1")) {
+if (($GLOBALS['footer_sent'] != "1") && ($GLOBALS['footer_sent'] != "2") && ($GLOBALS['output_mode'] != "1")) {
        // Output the generated HTML code or do nothing in direct-mode
        if (getTotalFatalErrors() > 0) {
                // Output fatal error messages
        // Output the generated HTML code or do nothing in direct-mode
        if (getTotalFatalErrors() > 0) {
                // Output fatal error messages
@@ -49,7 +49,7 @@ if (($footer != "1") && ($footer != "2") && ($CSS != "1")) {
        } // END - if
 
        // Shall we display the copyright notice?
        } // END - if
 
        // Shall we display the copyright notice?
-       if ((empty($frame)) && (empty($_GET['frame'])) && (basename($_SERVER['PHP_SELF']) != "mailid_top.php") && (isBooleanConstantAndTrue('WRITE_FOOTER')) && ($header == "2")) {
+       if ((empty($frame)) && (empty($_GET['frame'])) && (basename($_SERVER['PHP_SELF']) != "mailid_top.php") && (isBooleanConstantAndTrue('WRITE_FOOTER')) && ($GLOBALS['header_sent'] == "2")) {
                // Backlink enabled?
                if (isBooleanConstantAndTrue('ENABLE_BACKLINK')) {
                        // Copyright with backlink, thanks! :-)
                // Backlink enabled?
                if (isBooleanConstantAndTrue('ENABLE_BACKLINK')) {
                        // Copyright with backlink, thanks! :-)
@@ -61,7 +61,7 @@ if (($footer != "1") && ($footer != "2") && ($CSS != "1")) {
        } // END - if
 
        // Shall we display the parsing time and number of queries?
        } // END - if
 
        // Shall we display the parsing time and number of queries?
-       if ((getConfig('show_timings') == "Y") && (empty($_GET['frame'])) && ($header == "2")) {
+       if ((getConfig('show_timings') == "Y") && (empty($_GET['frame'])) && ($GLOBALS['header_sent'] == "2")) {
                // Then display it here
                DISPLAY_PARSING_TIME_FOOTER();
        } // END - if
                // Then display it here
                DISPLAY_PARSING_TIME_FOOTER();
        } // END - if
@@ -74,7 +74,7 @@ if (($footer != "1") && ($footer != "2") && ($CSS != "1")) {
 } // END - if
 
 // Footer has been reached
 } // END - if
 
 // Footer has been reached
-$footer = 1;
+$GLOBALS['footer_sent'] = 1;
 
 // Output HTML code
 OUTPUT_HTML("");
 
 // Output HTML code
 OUTPUT_HTML("");
index a5113472977aa303ea17762ca25da7a4a384b4d9..a292a5b1bce53c775c69869d2d4f78c3b9dea785 100644 (file)
@@ -62,7 +62,7 @@ function IS_INC_WRITEABLE($inc) {
 // Output HTML code directly or "render" it. You addionally switch the new-line character off
 function OUTPUT_HTML ($HTML, $newLine = true) {
        // Some global variables
 // Output HTML code directly or "render" it. You addionally switch the new-line character off
 function OUTPUT_HTML ($HTML, $newLine = true) {
        // Some global variables
-       global $OUTPUT, $footer, $CSS;
+       global $OUTPUT;
 
        // Do we have HTML-Code here?
        if (!empty($HTML)) {
 
        // Do we have HTML-Code here?
        if (!empty($HTML)) {
@@ -101,7 +101,7 @@ function OUTPUT_HTML ($HTML, $newLine = true) {
                        mxchange_die("<strong>{--FATAL_ERROR--}:</strong> {--LANG_NO_RENDER_DIRECT--}");
                        break;
                }
                        mxchange_die("<strong>{--FATAL_ERROR--}:</strong> {--LANG_NO_RENDER_DIRECT--}");
                        break;
                }
-       } elseif ((constant('_OB_CACHING') == "on") && ($footer == 1)) {
+       } elseif ((constant('_OB_CACHING') == "on") && ($GLOBALS['footer_sent'] == 1)) {
                // Headers already sent?
                if (headers_sent()) {
                        // Log this error
                // Headers already sent?
                if (headers_sent()) {
                        // Log this error
@@ -131,7 +131,7 @@ function OUTPUT_HTML ($HTML, $newLine = true) {
                header("Connection: Close");
 
                // Extension "rewrite" installed?
                header("Connection: Close");
 
                // Extension "rewrite" installed?
-               if ((EXT_IS_ACTIVE("rewrite")) && ($CSS != "1") && ($CSS != "-1")) {
+               if ((EXT_IS_ACTIVE("rewrite")) && ($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1")) {
                        $OUTPUT = REWRITE_LINKS($OUTPUT);
                } // END - if
 
                        $OUTPUT = REWRITE_LINKS($OUTPUT);
                } // END - if
 
@@ -154,7 +154,7 @@ function OUTPUT_HTML ($HTML, $newLine = true) {
                OUTPUT_RAW($OUTPUT);
        } elseif ((constant('OUTPUT_MODE') == "render") && (!empty($OUTPUT))) {
                // Rewrite links when rewrite extension is active
                OUTPUT_RAW($OUTPUT);
        } elseif ((constant('OUTPUT_MODE') == "render") && (!empty($OUTPUT))) {
                // Rewrite links when rewrite extension is active
-               if ((EXT_IS_ACTIVE("rewrite")) && ($CSS != "1") && ($CSS != "-1")) {
+               if ((EXT_IS_ACTIVE("rewrite")) && ($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1")) {
                        $OUTPUT = REWRITE_LINKS($OUTPUT);
                } // END - if
 
                        $OUTPUT = REWRITE_LINKS($OUTPUT);
                } // END - if
 
@@ -703,8 +703,6 @@ function TRANSLATE_STATUS ($status) {
 }
 //
 function GET_LANGUAGE() {
 }
 //
 function GET_LANGUAGE() {
-       global $cacheArray;
-
        // Set default return value to default language from config
        $ret = constant('DEFAULT_LANG');
 
        // Set default return value to default language from config
        $ret = constant('DEFAULT_LANG');
 
@@ -715,9 +713,9 @@ function GET_LANGUAGE() {
        if (!empty($_GET['mx_lang'])) {
                // Accept only first 2 chars
                $lang = substr($_GET['mx_lang'], 0, 2);
        if (!empty($_GET['mx_lang'])) {
                // Accept only first 2 chars
                $lang = substr($_GET['mx_lang'], 0, 2);
-       } elseif (isset($cacheArray['language'])) {
+       } elseif (isset($GLOBALS['cache_array']['language'])) {
                // Use cached
                // Use cached
-               $ret = $cacheArray['language'];
+               $ret = $GLOBALS['cache_array']['language'];
        } elseif (!empty($lang)) {
                // Check if main language file does exist
                if (FILE_READABLE(constant('PATH')."inc/language/".$lang.".php")) {
        } elseif (!empty($lang)) {
                // Check if main language file does exist
                if (FILE_READABLE(constant('PATH')."inc/language/".$lang.".php")) {
@@ -733,7 +731,7 @@ function GET_LANGUAGE() {
        }
 
        // Cache entry
        }
 
        // Cache entry
-       $cacheArray['language'] = $ret;
+       $GLOBALS['cache_array']['language'] = $ret;
 
        // Return value
        return $ret;
 
        // Return value
        return $ret;
@@ -908,8 +906,6 @@ function MAKE_TIME($H, $M, $S, $stamp) {
 }
 //
 function LOAD_URL($URL, $addUrlData=true) {
 }
 //
 function LOAD_URL($URL, $addUrlData=true) {
-       global $CSS, $footer;
-
        // Compile out URI codes
        $URL = compileUriCode($URL);
 
        // Compile out URI codes
        $URL = compileUriCode($URL);
 
@@ -1309,11 +1305,11 @@ function bigintval($num, $castValue = true) {
 }
 
 // Insert the code in $img_code into jpeg or PNG image
 }
 
 // Insert the code in $img_code into jpeg or PNG image
-function GENERATE_IMAGE ($img_code, $header=true) {
+function GENERATE_IMAGE ($img_code, $headerSent=true) {
        if ((strlen($img_code) > 6) || (empty($img_code)) || (getConfig('code_length') == 0)) {
                // Stop execution of function here because of over-sized code length
                return;
        if ((strlen($img_code) > 6) || (empty($img_code)) || (getConfig('code_length') == 0)) {
                // Stop execution of function here because of over-sized code length
                return;
-       } elseif (!$header) {
+       } elseif (!$headerSent) {
                // Return in an HTML code code
                return "<img src=\"{!URL!}/img.php?code=".$img_code."\" alt=\"Image\" />\n";
        }
                // Return in an HTML code code
                return "<img src=\"{!URL!}/img.php?code=".$img_code."\" alt=\"Image\" />\n";
        }
@@ -2288,10 +2284,8 @@ function DISPLAY_PARSING_TIME_FOOTER() {
 
 // Unset/set session variables
 function set_session ($var, $value) {
 
 // Unset/set session variables
 function set_session ($var, $value) {
-       global $CSS;
-
        // Abort in CSS mode here
        // Abort in CSS mode here
-       if ($CSS == 1) return true;
+       if ($GLOBALS['output_mode'] == 1) return true;
 
        // Trim value and session variable
        $var = trim(SQL_ESCAPE($var)); $value = trim($value);
 
        // Trim value and session variable
        $var = trim(SQL_ESCAPE($var)); $value = trim($value);
@@ -2322,23 +2316,21 @@ function set_session ($var, $value) {
 // Check wether a boolean constant is set
 // Taken from user comments in PHP documentation for function constant()
 function isBooleanConstantAndTrue($constName) { // : Boolean
 // Check wether a boolean constant is set
 // Taken from user comments in PHP documentation for function constant()
 function isBooleanConstantAndTrue($constName) { // : Boolean
-       global $cacheArray;
-
        // Failed by default
        $res = false;
 
        // In cache?
        // Failed by default
        $res = false;
 
        // In cache?
-       if (isset($cacheArray['const'][$constName])) {
+       if (isset($GLOBALS['cache_array']['const'][$constName])) {
                // Use cache
                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ".$constName."-CACHE!<br />\n";
                // Use cache
                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ".$constName."-CACHE!<br />\n";
-               $res = $cacheArray['const'][$constName];
+               $res = $GLOBALS['cache_array']['const'][$constName];
        } else {
                // Check constant
                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ".$constName."-RESOLVE!<br />\n";
                if (defined($constName)) $res = (constant($constName) === true);
 
                // Set cache
        } else {
                // Check constant
                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ".$constName."-RESOLVE!<br />\n";
                if (defined($constName)) $res = (constant($constName) === true);
 
                // Set cache
-               $cacheArray['const'][$constName] = $res;
+               $GLOBALS['cache_array']['const'][$constName] = $res;
        }
        //* DEBUG: */ var_dump($res);
 
        }
        //* DEBUG: */ var_dump($res);
 
@@ -2353,23 +2345,21 @@ function isSessionVariableSet ($var) {
 }
 // Returns wether the value of the session variable or NULL if not set
 function get_session ($var) {
 }
 // Returns wether the value of the session variable or NULL if not set
 function get_session ($var) {
-       global $cacheArray;
-
        // Default is not found! ;-)
        $value = null;
 
        // Is the variable there or cached values?
        // Default is not found! ;-)
        $value = null;
 
        // Is the variable there or cached values?
-       if (isset($cacheArray['session'][$var])) {
+       if (isset($GLOBALS['cache_array']['session'][$var])) {
                // Get cached value (skips a lot SQL_ESCAPE() calles!
                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ".$var."-CACHE!<br />\n";
                // Get cached value (skips a lot SQL_ESCAPE() calles!
                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ".$var."-CACHE!<br />\n";
-               $value = $cacheArray['session'][$var];
+               $value = $GLOBALS['cache_array']['session'][$var];
        } elseif (isSessionVariableSet($var)) {
                // Then  get it secured!
                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ".$var."-RESOLVE!<br />\n";
                $value = SQL_ESCAPE($_SESSION[$var]);
 
                // Cache the value
        } elseif (isSessionVariableSet($var)) {
                // Then  get it secured!
                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ".$var."-RESOLVE!<br />\n";
                $value = SQL_ESCAPE($_SESSION[$var]);
 
                // Cache the value
-               $cacheArray['session'][$var] = $value;
+               $GLOBALS['cache_array']['session'][$var] = $value;
        } // END - if
 
        // Return the value
        } // END - if
 
        // Return the value
@@ -2634,14 +2624,12 @@ function HANDLE_LOGIN_FAILTURES ($accessLevel) {
 
 // Rebuild cache
 function REBUILD_CACHE ($cache, $inc="") {
 
 // Rebuild cache
 function REBUILD_CACHE ($cache, $inc="") {
-       global $cacheInstance, $CSS;
-
        // Shall I remove the cache file?
        // Shall I remove the cache file?
-       if ((EXT_IS_ACTIVE("cache")) && (is_object($cacheInstance))) {
+       if ((EXT_IS_ACTIVE("cache")) && (is_object($GLOBALS['cache_instance']))) {
                // Rebuild cache
                // Rebuild cache
-               if ($cacheInstance->loadCacheFile($cache)) {
+               if ($GLOBALS['cache_instance']->loadCacheFile($cache)) {
                        // Destroy it
                        // Destroy it
-                       $cacheInstance->destroyCacheFile();
+                       $GLOBALS['cache_instance']->destroyCacheFile();
                } // END - if
 
                // Include file given?
                } // END - if
 
                // Include file given?
@@ -2664,13 +2652,11 @@ function REBUILD_CACHE ($cache, $inc="") {
 
 // Purge admin menu cache
 function CACHE_PURGE_ADMIN_MENU ($id=0, $action="", $what="", $str="") {
 
 // Purge admin menu cache
 function CACHE_PURGE_ADMIN_MENU ($id=0, $action="", $what="", $str="") {
-       global $cacheInstance;
-
        // Is the cache extension enabled or no cache instance or admin menu cache disabled?
        if (!EXT_IS_ACTIVE("cache")) {
                // Cache extension not active
                return false;
        // Is the cache extension enabled or no cache instance or admin menu cache disabled?
        if (!EXT_IS_ACTIVE("cache")) {
                // Cache extension not active
                return false;
-       } elseif (!is_object($cacheInstance)) {
+       } elseif (!is_object($GLOBALS['cache_instance'])) {
                // No cache instance!
                DEBUG_LOG(__FUNCTION__, __LINE__, " No cache instance found.");
                return false;
                // No cache instance!
                DEBUG_LOG(__FUNCTION__, __LINE__, " No cache instance found.");
                return false;
@@ -2936,7 +2922,7 @@ function getMessage ($messageId) {
 
 // Get current theme name
 function GET_CURR_THEME() {
 
 // Get current theme name
 function GET_CURR_THEME() {
-       global $INC_POOL, $CSS, $cacheArray;
+       global $INC_POOL;
 
        // The default theme is 'default'... ;-)
        $ret = "default";
 
        // The default theme is 'default'... ;-)
        $ret = "default";
@@ -2948,7 +2934,7 @@ function GET_CURR_THEME() {
                // Set default theme
                set_session('mxchange_theme', $ret);
        } elseif ((isSessionVariableSet('mxchange_theme')) && (GET_EXT_VERSION("sql_patches") >= "0.1.4")) {
                // Set default theme
                set_session('mxchange_theme', $ret);
        } elseif ((isSessionVariableSet('mxchange_theme')) && (GET_EXT_VERSION("sql_patches") >= "0.1.4")) {
-               //die("<pre>".print_r($cacheArray['themes'], true)."</pre>");
+               //die("<pre>".print_r($GLOBALS['cache_array']['themes'], true)."</pre>");
                // Get theme from cookie
                $ret = get_session('mxchange_theme');
 
                // Get theme from cookie
                $ret = get_session('mxchange_theme');
 
@@ -2957,7 +2943,7 @@ function GET_CURR_THEME() {
                        // Fix it to default
                        $ret = "default";
                } // END - if
                        // Fix it to default
                        $ret = "default";
                } // END - if
-       } elseif ((!isBooleanConstantAndTrue('mxchange_installed')) && ((isBooleanConstantAndTrue('mxchange_installing')) || ($CSS == true)) && ((!empty($_GET['theme'])) || (!empty($_POST['theme'])))) {
+       } elseif ((!isBooleanConstantAndTrue('mxchange_installed')) && ((isBooleanConstantAndTrue('mxchange_installing')) || ($GLOBALS['output_mode'] == true)) && ((!empty($_GET['theme'])) || (!empty($_POST['theme'])))) {
                // Prepare FQFN for checking
                $theme = sprintf("%stheme/%s/theme.php", constant('PATH'), SQL_ESCAPE($_GET['theme']));
 
                // Prepare FQFN for checking
                $theme = sprintf("%stheme/%s/theme.php", constant('PATH'), SQL_ESCAPE($_GET['theme']));
 
@@ -2989,8 +2975,6 @@ function GET_CURR_THEME() {
 
 // Get id from theme
 function THEME_GET_ID ($name) {
 
 // Get id from theme
 function THEME_GET_ID ($name) {
-       global $cacheArray;
-
        // Is the extension "theme" installed?
        if (!EXT_IS_ACTIVE("theme")) {
                // Then abort here
        // Is the extension "theme" installed?
        if (!EXT_IS_ACTIVE("theme")) {
                // Then abort here
@@ -3001,9 +2985,9 @@ function THEME_GET_ID ($name) {
        $id = 0;
 
        // Is the cache entry there?
        $id = 0;
 
        // Is the cache entry there?
-       if (isset($cacheArray['themes']['id'][$name])) {
+       if (isset($GLOBALS['cache_array']['themes']['id'][$name])) {
                // Get the version from cache
                // Get the version from cache
-               $id = $cacheArray['themes']['id'][$name];
+               $id = $GLOBALS['cache_array']['themes']['id'][$name];
 
                // Count up
                incrementConfigEntry('cache_hits');
 
                // Count up
                incrementConfigEntry('cache_hits');
@@ -3183,15 +3167,13 @@ function LOAD_INC ($INC) {
 
 // Loads an include file once
 function LOAD_INC_ONCE ($INC) {
 
 // Loads an include file once
 function LOAD_INC_ONCE ($INC) {
-       global $cacheArray;
-
        // Is it not loaded?
        // Is it not loaded?
-       if (!isset($cacheArray['load_once'][$INC])) {
+       if (!isset($GLOBALS['cache_array']['load_once'][$INC])) {
                // Then try to load it
                LOAD_INC($INC);
 
                // And mark it as loaded
                // Then try to load it
                LOAD_INC($INC);
 
                // And mark it as loaded
-               $cacheArray['load_once'][$INC] = true;
+               $GLOBALS['cache_array']['load_once'][$INC] = true;
        } // END - if
 }
 
        } // END - if
 }
 
index 596aa5b916929d127b172e460d2299809cc260f3..449edcaa1d77044a626981ba759ffe62c5ef7f9a 100644 (file)
@@ -70,12 +70,10 @@ ORDER BY u.userid ASC", __FILE__, __LINE__);
 
 // Do we have entries?
 if (SQL_NUMROWS($result_direct) > 0) {
 
 // Do we have entries?
 if (SQL_NUMROWS($result_direct) > 0) {
-       global $cacheArray;
-
        // When "walk" through all users
        while (list($uid) = SQL_FETCHROW($result_direct)) {
                // Init level
        // When "walk" through all users
        while (list($uid) = SQL_FETCHROW($result_direct)) {
                // Init level
-               $cacheArray['back_level'] = 1;
+               $GLOBALS['cache_array']['back_level'] = 1;
 
                // Update refback table
                //* DEBUG: */ echo "uid={$uid}<br />\n";
 
                // Update refback table
                //* DEBUG: */ echo "uid={$uid}<br />\n";
index 56cafa67ced876624a305e31d833bb9433d23306..dc81c5a8689222ff330f8bbd8101e26e76344858 100644 (file)
@@ -39,12 +39,10 @@ if (!defined('__SECURITY')) {
        require($INC);
 }
 
        require($INC);
 }
 
-global $header;
-
 // Is the header already sent?
 // Is the header already sent?
-if (($header != "1") && ($header != "2")) {
+if (($GLOBALS['header_sent'] != "1") && ($GLOBALS['header_sent'] != "2")) {
        // If not in CSS mode generate the header
        // If not in CSS mode generate the header
-       if (($CSS != "1")) {
+       if (($GLOBALS['output_mode'] != "1")) {
                // Generate header
                $TITLE = "";
 
                // Generate header
                $TITLE = "";
 
@@ -122,17 +120,17 @@ if (($header != "1") && ($header != "2")) {
        } // END - if
 
        // Closing HEAD tag
        } // END - if
 
        // Closing HEAD tag
-       if ($CSS != "1") OUTPUT_HTML("</head>");
-       $header = 1;
+       if ($GLOBALS['output_mode'] != "1") OUTPUT_HTML("</head>");
+       $GLOBALS['header_sent'] = 1;
 } // END - if
 
 // Load body or not
 } // END - if
 
 // Load body or not
-if (($GLOBALS['module'] != "frametester") || (($GLOBALS['module'] == "frametester") && (isset($_GET['frame']))) || (($header == "1") && (!empty($_GET['frame']))) && ($CSS != "1")) {
+if (($GLOBALS['module'] != "frametester") || (($GLOBALS['module'] == "frametester") && (isset($_GET['frame']))) || (($GLOBALS['header_sent'] == "1") && (!empty($_GET['frame']))) && ($GLOBALS['output_mode'] != "1")) {
        // Is the header sent and the script is not the mail confirmation script and not a CSS?
        // Is the header sent and the script is not the mail confirmation script and not a CSS?
-       if (($header == "1") && (basename($_SERVER['PHP_SELF']) != "mailid.php") && ($CSS != "1")) {
+       if (($GLOBALS['header_sent'] == "1") && (basename($_SERVER['PHP_SELF']) != "mailid.php") && ($GLOBALS['output_mode'] != "1")) {
                // Add BODY tag
                LOAD_TEMPLATE("page_body");
                // Add BODY tag
                LOAD_TEMPLATE("page_body");
-               $header = 2;
+               $GLOBALS['header_sent'] = 2;
        } // END - if
 } // END - if
 
        } // END - if
 } // END - if
 
index 2ee0d45299818018c59b3aa0b7ae2b8887f339eb..5f3c4a5d5dc7a73b1a59e04f2f6c246c64663265 100644 (file)
@@ -39,7 +39,6 @@ if (!defined('__SECURITY')) {
 
 // Check ACL for menu combination
 function ADMINS_CHECK_ACL($act, $wht) {
 
 // Check ACL for menu combination
 function ADMINS_CHECK_ACL($act, $wht) {
-       global $cacheArray, $cacheInstance;
        // If action is login or logout allow allways!
        $default = "allow";
        if (($act == "login") || ($act == "logout")) return true;
        // If action is login or logout allow allways!
        $default = "allow";
        if (($act == "login") || ($act == "logout")) return true;
@@ -69,19 +68,19 @@ function ADMINS_CHECK_ACL($act, $wht) {
        $lines = 0; $acl_mode = "failed";
        if (GET_EXT_VERSION("cache") >= "0.1.2") {
                // Load only from array when there are lines!
        $lines = 0; $acl_mode = "failed";
        if (GET_EXT_VERSION("cache") >= "0.1.2") {
                // Load only from array when there are lines!
-               if ((isset($cacheArray['admin_acls'])) && (is_array($cacheArray['admin_acls'])) && (count($cacheArray['admin_acls']) > 0)) {
+               if ((isset($GLOBALS['cache_array']['admin_acls'])) && (is_array($GLOBALS['cache_array']['admin_acls'])) && (count($GLOBALS['cache_array']['admin_acls']) > 0)) {
                        // Load ACL from array
                        // Load ACL from array
-                       foreach ($cacheArray['admin_acls']['admin_id'] as $id => $aid_acls) {
+                       foreach ($GLOBALS['cache_array']['admin_acls']['admin_id'] as $id => $aid_acls) {
                                if ($aid == $aid_acls) {
                                        // Okay, one line was found!
                                if ($aid == $aid_acls) {
                                        // Okay, one line was found!
-                                       if ((!empty($act)) && ($cacheArray['admin_acls']['action_menu'][$id] == $act)) {
+                                       if ((!empty($act)) && ($GLOBALS['cache_array']['admin_acls']['action_menu'][$id] == $act)) {
                                                // Main menu line found
                                                // Main menu line found
-                                               $acl_mode = $cacheArray['admin_acls']['access_mode'][$id];
+                                               $acl_mode = $GLOBALS['cache_array']['admin_acls']['access_mode'][$id];
                                                $lines = 1;
                                        }
                                                $lines = 1;
                                        }
-                                        elseif ((!empty($wht)) && ($cacheArray['admin_acls']['what_menu'][$id] == $wht)) {
+                                        elseif ((!empty($wht)) && ($GLOBALS['cache_array']['admin_acls']['what_menu'][$id] == $wht)) {
                                                // Check sub menu
                                                // Check sub menu
-                                               $acl_mode = $cacheArray['admin_acls']['access_mode'][$id];
+                                               $acl_mode = $GLOBALS['cache_array']['admin_acls']['access_mode'][$id];
                                                $lines = 1;
                                        }
                                        if ($lines == 1) {
                                                $lines = 1;
                                        }
                                        if ($lines == 1) {
@@ -162,8 +161,6 @@ WHERE email='%s'".$locked." LIMIT 1",
 
 // Change a lot admin account
 function ADMINS_CHANGE_ADMIN_ACCOUNT($POST) {
 
 // Change a lot admin account
 function ADMINS_CHANGE_ADMIN_ACCOUNT($POST) {
-       global $cacheInstance;
-
        // Begin the update
        $cache_update = 0;
        foreach ($POST['login'] as $id => $login) {
        // Begin the update
        $cache_update = 0;
        foreach ($POST['login'] as $id => $login) {
index 121cfc096a79f08c32c6f8b53d09b3ce1b426281..98d29819ab9801c8780f0a95756d55f43c974191 100644 (file)
@@ -117,20 +117,19 @@ class CacheSystem {
        }
 
        function addRow ($data) {
        }
 
        function addRow ($data) {
-               global $cacheArray;
-
+               // Is the pointe rvalid?
                if (is_resource($this->pointer)) {
                        // Write every array element to cache file
                        foreach ($data as $k => $v) {
                                // Write global cache array for immediate access
                                if ((substr($k, 0, 4) == "ext_") && (isset($data['ext_name'])) && (isset($data['ext_id']))) {
                                        if ($k != "ext_name") {
                if (is_resource($this->pointer)) {
                        // Write every array element to cache file
                        foreach ($data as $k => $v) {
                                // Write global cache array for immediate access
                                if ((substr($k, 0, 4) == "ext_") && (isset($data['ext_name'])) && (isset($data['ext_id']))) {
                                        if ($k != "ext_name") {
-                                               $cacheArray['extensions'][$k][$data['ext_name']] = $v;
+                                               $GLOBALS['cache_array']['extensions'][$k][$data['ext_name']] = $v;
                                        } else {
                                        } else {
-                                               $cacheArray['extensions'][$k][$data['ext_id']] = $v;
+                                               $GLOBALS['cache_array']['extensions'][$k][$data['ext_id']] = $v;
                                        }
                                        if (($k == "ext_keep") && ($v == "Y")) {
                                        }
                                        if (($k == "ext_keep") && ($v == "Y")) {
-                                               $cacheArray['active_extensions'][$data['ext_name']] = $v;
+                                               $GLOBALS['cache_array']['active_extensions'][$data['ext_name']] = $v;
                                        } // END - if
                                } elseif (is_array($v)) {
                                        // Serialize and BASE64-encode the array
                                        } // END - if
                                } elseif (is_array($v)) {
                                        // Serialize and BASE64-encode the array
@@ -395,13 +394,11 @@ class CacheSystem {
 
 // Destroy the cache on extension changes
 function FILTER_CACHE_DESTROY_ON_EXT_CHANGE ($data) {
 
 // Destroy the cache on extension changes
 function FILTER_CACHE_DESTROY_ON_EXT_CHANGE ($data) {
-       global $cacheInstance;
-
        // Remove cache
        if (EXT_IS_ACTIVE("cache")) {
        // Remove cache
        if (EXT_IS_ACTIVE("cache")) {
-               if ($cacheInstance->loadCacheFile("config"))     $cacheInstance->destroyCacheFile();
-               if ($cacheInstance->loadCacheFile("extensions")) $cacheInstance->destroyCacheFile();
-               if ($cacheInstance->loadCacheFile("mod_reg"))    $cacheInstance->destroyCacheFile();
+               if ($GLOBALS['cache_instance']->loadCacheFile("config"))     $GLOBALS['cache_instance']->destroyCacheFile();
+               if ($GLOBALS['cache_instance']->loadCacheFile("extensions")) $GLOBALS['cache_instance']->destroyCacheFile();
+               if ($GLOBALS['cache_instance']->loadCacheFile("mod_reg"))    $GLOBALS['cache_instance']->destroyCacheFile();
        } // END - if
 
        // Return it
        } // END - if
 
        // Return it
@@ -410,28 +407,24 @@ function FILTER_CACHE_DESTROY_ON_EXT_CHANGE ($data) {
 
 // Destroy the cache on changing admin
 function FILTER_CACHE_DESTROY_ON_ADMIN_CHANGE () {
 
 // Destroy the cache on changing admin
 function FILTER_CACHE_DESTROY_ON_ADMIN_CHANGE () {
-       global $cacheInstance;
-
        // Remove cache
        if (EXT_IS_ACTIVE("cache")) {
        // Remove cache
        if (EXT_IS_ACTIVE("cache")) {
-               if ($cacheInstance->loadCacheFile("admins")) $cacheInstance->destroyCacheFile();
+               if ($GLOBALS['cache_instance']->loadCacheFile("admins")) $GLOBALS['cache_instance']->destroyCacheFile();
        } // END - if
 }
 
 // Destroy all cache files
 function FILTER_CACHE_DESTROY_ALL () {
        } // END - if
 }
 
 // Destroy all cache files
 function FILTER_CACHE_DESTROY_ALL () {
-       global $cacheInstance;
-
        // Remove cache
        if (EXT_IS_ACTIVE("cache")) {
        // Remove cache
        if (EXT_IS_ACTIVE("cache")) {
-               if ($cacheInstance->loadCacheFile("admins"))      $cacheInstance->destroyCacheFile();
-               if ($cacheInstance->loadCacheFile("admins_acls")) $cacheInstance->destroyCacheFile();
-               if ($cacheInstance->loadCacheFile("config"))      $cacheInstance->destroyCacheFile();
-               if ($cacheInstance->loadCacheFile("extensions"))  $cacheInstance->destroyCacheFile();
-               if ($cacheInstance->loadCacheFile("mod_reg"))     $cacheInstance->destroyCacheFile();
-               if ($cacheInstance->loadCacheFile("refdepths"))   $cacheInstance->destroyCacheFile();
-               if ($cacheInstance->loadCacheFile("refsystem"))   $cacheInstance->destroyCacheFile();
-               if ($cacheInstance->loadCacheFile("themes"))      $cacheInstance->destroyCacheFile();
+               if ($GLOBALS['cache_instance']->loadCacheFile("admins"))      $GLOBALS['cache_instance']->destroyCacheFile();
+               if ($GLOBALS['cache_instance']->loadCacheFile("admins_acls")) $GLOBALS['cache_instance']->destroyCacheFile();
+               if ($GLOBALS['cache_instance']->loadCacheFile("config"))      $GLOBALS['cache_instance']->destroyCacheFile();
+               if ($GLOBALS['cache_instance']->loadCacheFile("extensions"))  $GLOBALS['cache_instance']->destroyCacheFile();
+               if ($GLOBALS['cache_instance']->loadCacheFile("mod_reg"))     $GLOBALS['cache_instance']->destroyCacheFile();
+               if ($GLOBALS['cache_instance']->loadCacheFile("refdepths"))   $GLOBALS['cache_instance']->destroyCacheFile();
+               if ($GLOBALS['cache_instance']->loadCacheFile("refsystem"))   $GLOBALS['cache_instance']->destroyCacheFile();
+               if ($GLOBALS['cache_instance']->loadCacheFile("themes"))      $GLOBALS['cache_instance']->destroyCacheFile();
        } // END - if
 }
 
        } // END - if
 }
 
index d218289fd562dc5105cb00cac1b524ceee126da9..116e35f658fff453198119d4466e729e949ce507 100644 (file)
@@ -39,15 +39,13 @@ if (!defined('__SECURITY')) {
 
 //
 function NICKNAME_IS_ACTIVE ($uidNick) {
 
 //
 function NICKNAME_IS_ACTIVE ($uidNick) {
-       global $cacheArray;
-
        // By default nothing is found...
        $ret = false;
 
        // Found in cache?
        // By default nothing is found...
        $ret = false;
 
        // Found in cache?
-       if (isset($cacheArray['nick_active'][$uidNick])) {
+       if (isset($GLOBALS['cache_array']['nick_active'][$uidNick])) {
                // Use it directly
                // Use it directly
-               $ret = $cacheArray['nick_active'][$uidNick];
+               $ret = $GLOBALS['cache_array']['nick_active'][$uidNick];
 
                // Increment cache counter
                incrementConfigEntry('cache_hits');
 
                // Increment cache counter
                incrementConfigEntry('cache_hits');
@@ -61,7 +59,7 @@ function NICKNAME_IS_ACTIVE ($uidNick) {
                $ret = (SQL_NUMROWS($result) == 1);
 
                // Put it in cache
                $ret = (SQL_NUMROWS($result) == 1);
 
                // Put it in cache
-               $cacheArray['nick_active'][$uidNick] = $ret;
+               $GLOBALS['cache_array']['nick_active'][$uidNick] = $ret;
 
                // Free result
                SQL_FREERESULT($result);
 
                // Free result
                SQL_FREERESULT($result);
@@ -73,15 +71,13 @@ function NICKNAME_IS_ACTIVE ($uidNick) {
 
 //
 function NICKNAME_GET_NICK ($userid) {
 
 //
 function NICKNAME_GET_NICK ($userid) {
-       global $cacheArray;
-
        // If not found...
        $ret = "";
 
        // Found in cache?
        // If not found...
        $ret = "";
 
        // Found in cache?
-       if (isset($cacheArray['nicknames'][$userid])) {
+       if (isset($GLOBALS['cache_array']['nicknames'][$userid])) {
                // Use it directly
                // Use it directly
-               $ret = $cacheArray['nicknames'][$userid];
+               $ret = $GLOBALS['cache_array']['nicknames'][$userid];
 
                // Increment cache counter
                incrementConfigEntry('cache_hits');
 
                // Increment cache counter
                incrementConfigEntry('cache_hits');
@@ -96,7 +92,7 @@ function NICKNAME_GET_NICK ($userid) {
                        list($ret) = SQL_FETCHROW($result);
 
                        // Put it in cche
                        list($ret) = SQL_FETCHROW($result);
 
                        // Put it in cche
-                       $cacheArray['nicknames'][$userid] = $ret;
+                       $GLOBALS['cache_array']['nicknames'][$userid] = $ret;
                } // END - if
 
                // Free result
                } // END - if
 
                // Free result
index d156ee865bee77833e16ed2f135db978e51f1b27..3d70abc82496e915b055ada4313b0f78527ecb25 100644 (file)
@@ -733,21 +733,19 @@ function RALLYE_TEMPLATE_SELECTION($name="template", $default="")
 }
 //
 function RALLYE_GET_REFCOUNT($uid, $old=0) {
 }
 //
 function RALLYE_GET_REFCOUNT($uid, $old=0) {
-       global $cacheArray;
-
        // Check current refs
        if (GET_EXT_VERSION("cache") >= "0.1.2") {
                // Get refs from cache
                $cnt = 0;
        // Check current refs
        if (GET_EXT_VERSION("cache") >= "0.1.2") {
                // Get refs from cache
                $cnt = 0;
-               foreach ($cacheArray['refsystem']['userid'] as $id => $u_id) {
+               foreach ($GLOBALS['cache_array']['refsystem']['userid'] as $id => $u_id) {
                        // Do we have a ref for this user?
                        // Do we have a ref for this user?
-                       //* DEBUG: */ echo "id={$id},u_id={$u_id},uid={$uid},old={$old},level={$cacheArray['refsystem']['level'][$id]}<br />\n";
-                       if (($u_id == $uid) && ($cacheArray['refsystem']['level'][$id] == 1)) {
+                       //* DEBUG: */ echo "id={$id},u_id={$u_id},uid={$uid},old={$old},level={$GLOBALS['cache_array']['refsystem']['level'][$id]}<br />\n";
+                       if (($u_id == $uid) && ($GLOBALS['cache_array']['refsystem']['level'][$id] == 1)) {
                                //* DEBUG: */ echo "uid matches!<br />\n";
                                //* DEBUG: */ echo "uid matches!<br />\n";
-                               foreach ($cacheArray['ref_depths']['level'] as $level) {
-                                       if (($level == $cacheArray['refsystem']['level'][$id]) && ($level == 1)) {
+                               foreach ($GLOBALS['cache_array']['ref_depths']['level'] as $level) {
+                                       if (($level == $GLOBALS['cache_array']['refsystem']['level'][$id]) && ($level == 1)) {
                                                // Level does exist so abort here
                                                // Level does exist so abort here
-                                               $cnt = $cacheArray['refsystem']['counter'][$id];
+                                               $cnt = $GLOBALS['cache_array']['refsystem']['counter'][$id];
                                                //* DEBUG: */ echo "*".$uid."/".$cnt."*<br />";
                                                break;
                                        } elseif ($level > 1) {
                                                //* DEBUG: */ echo "*".$uid."/".$cnt."*<br />";
                                                break;
                                        } elseif ($level > 1) {
@@ -761,7 +759,7 @@ function RALLYE_GET_REFCOUNT($uid, $old=0) {
                        }
                }
                //* DEBUG: */ echo "<pre>";
                        }
                }
                //* DEBUG: */ echo "<pre>";
-               //* DEBUG: */ print_r($cacheArray['refsystem']);
+               //* DEBUG: */ print_r($GLOBALS['cache_array']['refsystem']);
                //* DEBUG: */ echo "</pre>";
                //* DEBUG: */ die();
 
                //* DEBUG: */ echo "</pre>";
                //* DEBUG: */ die();
 
index 8dd3c2267189897f332aba1bc7011fc1ff5d7493..dc3d0681602bcc0dfe336b5705a4346d7145e95e 100644 (file)
@@ -40,10 +40,8 @@ if (!defined('__SECURITY')) {
 // Payback refback for refid and reduce it for current user
 function ADD_REFBACK_POINTS ($uid, $ref, $points, $ref_points) {
        //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
 // Payback refback for refid and reduce it for current user
 function ADD_REFBACK_POINTS ($uid, $ref, $points, $ref_points) {
        //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
-       global $cacheArray;
-
        // Back ref depths
        // Back ref depths
-       $cacheArray['depth'][$uid][$ref] = $GLOBALS['ref_level']; 
+       $GLOBALS['cache_array']['depth'][$uid][$ref] = $GLOBALS['ref_level']; 
 
        // Init points
        $return = $points;
 
        // Init points
        $return = $points;
@@ -95,12 +93,13 @@ function ADD_REFBACK_POINTS ($uid, $ref, $points, $ref_points) {
        SQL_FREERESULT($result_refs);
 
        // Restore ref depth
        SQL_FREERESULT($result_refs);
 
        // Restore ref depth
-       $GLOBALS['ref_level'] = $cacheArray['depth'][$uid][$ref];
+       $GLOBALS['ref_level'] = $GLOBALS['cache_array']['depth'][$uid][$ref];
 
        // Return them
        //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
        return $return;
 }
 
        // Return them
        //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
        return $return;
 }
+
 // "Getter" for refback percents
 function GET_REFBACK_PERCENTS ($uid, $ref) {
        //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
 // "Getter" for refback percents
 function GET_REFBACK_PERCENTS ($uid, $ref) {
        //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
@@ -133,6 +132,7 @@ function GET_REFBACK_PERCENTS ($uid, $ref) {
        //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
        return $percents;
 }
        //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
        return $percents;
 }
+
 // "Getter" for userid array which will return only one entry
 function GET_REFBACK_USERID_ARRAY ($rid, $level) {
        //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
 // "Getter" for userid array which will return only one entry
 function GET_REFBACK_USERID_ARRAY ($rid, $level) {
        //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
@@ -165,17 +165,16 @@ ORDER BY userid ASC",
        //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
        return $userIds;
 }
        //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
        return $userIds;
 }
+
 // Update "refback table"
 function UPDATE_REFBACK_TABLE($uid) {
        //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
 // Update "refback table"
 function UPDATE_REFBACK_TABLE($uid) {
        //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
-       global $cacheArray, $cacheInstance;
-
        // Make it sure referal level zero (member him-/herself) is at least selected
        // Make it sure referal level zero (member him-/herself) is at least selected
-       if (empty($cacheArray['back_level'])) $cacheArray['back_level'] = 1;
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$cacheArray['back_level']}<br />\n";
+       if (empty($GLOBALS['cache_array']['back_level'])) $GLOBALS['cache_array']['back_level'] = 1;
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']}<br />\n";
 
        // Init refid
 
        // Init refid
-       $cacheArray['up_refid'][$cacheArray['back_level']] = 0;
+       $GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']] = 0;
        $old = 0; $minus = 0;
 
        // Check for his referal
        $old = 0; $minus = 0;
 
        // Check for his referal
@@ -186,54 +185,54 @@ function UPDATE_REFBACK_TABLE($uid) {
        //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):found=".SQL_NUMROWS($result_refid)."<br />\n";
        if (SQL_NUMROWS($result_refid) > 0) {
                // Load all refids
        //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):found=".SQL_NUMROWS($result_refid)."<br />\n";
        if (SQL_NUMROWS($result_refid) > 0) {
                // Load all refids
-               while (list($cacheArray['up_refid'][$cacheArray['back_level']]) = SQL_FETCHROW($result_refid)) {
+               while (list($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]) = SQL_FETCHROW($result_refid)) {
                        // Remmber userid
                        // Remmber userid
-                       $cacheArray['up_userid'][$cacheArray['up_refid'][$cacheArray['back_level']]] = $uid;
+                       $GLOBALS['cache_array']['up_userid'][$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]] = $uid;
 
 
-                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$cacheArray['up_refid'][$cacheArray['back_level']]}<br />\n";
+                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]}<br />\n";
                        // Refid set?
                        // Refid set?
-                       if (($cacheArray['up_refid'][$cacheArray['back_level']] > 0) && ($cacheArray['up_refid'][$cacheArray['back_level']] != $uid) && (isset($cacheArray['up_refid'][$cacheArray['back_level']]))) {
+                       if (($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']] > 0) && ($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']] != $uid) && (isset($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]))) {
                                // New userid?
                                // New userid?
-                               if ((isset($cacheArray['up_refid'][$cacheArray['back_level']-1])) && (isset($cacheArray['up_userid'][$cacheArray['up_refid'][$cacheArray['back_level']-1]]))) {
+                               if ((isset($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']-1])) && (isset($GLOBALS['cache_array']['up_userid'][$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']-1]]))) {
                                        // New userid!
                                        $old = $uid;
                                        // New userid!
                                        $old = $uid;
-                                       $uid = $cacheArray['up_userid'][$cacheArray['up_refid'][$cacheArray['back_level']-1]];
+                                       $uid = $GLOBALS['cache_array']['up_userid'][$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']-1]];
                                        $minus = 1;
                                        $minus = 1;
-                                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},old={$old},level={$cacheArray['back_level']},ref={$cacheArray['up_refid'][$cacheArray['back_level']]} - NEW UID!<br />\n";
+                                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},old={$old},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - NEW UID!<br />\n";
                                } // END - if
 
                                // Check existence
                                $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_refs` WHERE userid=%s AND level='%s' AND refid=%s LIMIT 1",
                                } // END - if
 
                                // Check existence
                                $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_refs` WHERE userid=%s AND level='%s' AND refid=%s LIMIT 1",
-                                       array(bigintval($uid), $cacheArray['back_level'], bigintval($cacheArray['up_refid'][$cacheArray['back_level']])), __FILE__, __LINE__);
+                                       array(bigintval($uid), $GLOBALS['cache_array']['back_level'], bigintval($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']])), __FILE__, __LINE__);
 
                                // Do we have no entry?
 
                                // Do we have no entry?
-                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$cacheArray['back_level']},ref={$cacheArray['up_refid'][$cacheArray['back_level']]},minus={$minus},numRows=".SQL_NUMROWS($result)." - FOUND!<br />\n";
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]},minus={$minus},numRows=".SQL_NUMROWS($result)." - FOUND!<br />\n";
                                if (SQL_NUMROWS($result) == 0) {
                                        // Insert this level
                                if (SQL_NUMROWS($result) == 0) {
                                        // Insert this level
-                                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$cacheArray['back_level']},ref={$cacheArray['up_refid'][$cacheArray['back_level']]} - ADD!<br />\n";
+                                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - ADD!<br />\n";
                                        SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_refs` (userid,level,refid) VALUES (%s,%s,%s)",
                                        SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_refs` (userid,level,refid) VALUES (%s,%s,%s)",
-                                               array(bigintval($uid), $cacheArray['back_level'], bigintval($cacheArray['up_refid'][$cacheArray['back_level']])), __FILE__, __LINE__);
+                                               array(bigintval($uid), $GLOBALS['cache_array']['back_level'], bigintval($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']])), __FILE__, __LINE__);
 
                                        // Move to next referal level and count his counter one up!
 
                                        // Move to next referal level and count his counter one up!
-                                       $cacheArray['back_level']++; UPDATE_REFBACK_TABLE($cacheArray['up_refid'][($cacheArray['back_level'] - 1)]);
+                                       $GLOBALS['cache_array']['back_level']++; UPDATE_REFBACK_TABLE($GLOBALS['cache_array']['up_refid'][($GLOBALS['cache_array']['back_level'] - 1)]);
                                } // END - if
 
                                // Do we have another level here?
                                } // END - if
 
                                // Do we have another level here?
-                               if ((($cacheArray['back_level']-$minus) > 0) && ($old > 0)) {
+                               if ((($GLOBALS['cache_array']['back_level']-$minus) > 0) && ($old > 0)) {
                                        // Restore old one
                                        $uid = $old;
 
                                        // Shall we add this as well?
                                        $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_refs` WHERE userid=%s AND level='%s' AND refid=%s LIMIT 1",
                                        // Restore old one
                                        $uid = $old;
 
                                        // Shall we add this as well?
                                        $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_refs` WHERE userid=%s AND level='%s' AND refid=%s LIMIT 1",
-                                               array(bigintval($uid), ($cacheArray['back_level']-$minus), bigintval($cacheArray['up_refid'][$cacheArray['back_level']])), __FILE__, __LINE__);
+                                               array(bigintval($uid), ($GLOBALS['cache_array']['back_level']-$minus), bigintval($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']])), __FILE__, __LINE__);
 
                                        // Do we have no entry?
 
                                        // Do we have no entry?
-                                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level=".($cacheArray['back_level']-$minus).",ref={$cacheArray['up_refid'][$cacheArray['back_level']]},numRows=".SQL_NUMROWS($result)." - BACK!<br />\n";
+                                       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level=".($GLOBALS['cache_array']['back_level']-$minus).",ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]},numRows=".SQL_NUMROWS($result)." - BACK!<br />\n";
                                        if (SQL_NUMROWS($result) == 0) {
                                                // Insert this level
                                                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_refs` (userid,level,refid) VALUES (%s,%s,%s)",
                                        if (SQL_NUMROWS($result) == 0) {
                                                // Insert this level
                                                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_refs` (userid,level,refid) VALUES (%s,%s,%s)",
-                                                       array(bigintval($uid), ($cacheArray['back_level']-$minus), bigintval($cacheArray['up_refid'][$cacheArray['back_level']])), __FILE__, __LINE__);
-                                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level=".($cacheArray['back_level']-$minus).",ref={$cacheArray['up_refid'][$cacheArray['back_level']]} - RETURNED!<br />\n";
+                                                       array(bigintval($uid), ($GLOBALS['cache_array']['back_level']-$minus), bigintval($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']])), __FILE__, __LINE__);
+                                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level=".($GLOBALS['cache_array']['back_level']-$minus).",ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - RETURNED!<br />\n";
                                        } // END - if
                                } // END - if
                        } // END - if
                                        } // END - if
                                } // END - if
                        } // END - if
@@ -244,22 +243,23 @@ function UPDATE_REFBACK_TABLE($uid) {
        } // END - if
 
        // When he has a referal...
        } // END - if
 
        // When he has a referal...
-       if ((($cacheArray['up_refid'][$cacheArray['back_level']] == $uid) || ($cacheArray['up_refid'][$cacheArray['back_level']] == 0)) && (GET_EXT_VERSION("cache") >= "0.1.2") && (!isset($cacheArray['back_cached']))) {
+       if ((($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']] == $uid) || ($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']] == 0)) && (GET_EXT_VERSION("cache") >= "0.1.2") && (!isset($GLOBALS['cache_array']['back_cached']))) {
                // Remove cache here
                // Remove cache here
-               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$cacheArray['up_refid'][$cacheArray['back_level']]} - CACHE!<br />\n";
-               if ($cacheInstance->loadCacheFile("refback")) $cacheInstance->destroyCacheFile();
-               $cacheArray['back_cached'] = 1;
+               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']]} - CACHE!<br />\n";
+               if ($GLOBALS['cache_instance']->loadCacheFile("refback")) $GLOBALS['cache_instance']->destroyCacheFile();
+               $GLOBALS['cache_array']['back_cached'] = 1;
        } // END - if
 
        // "Walk" back here
        } // END - if
 
        // "Walk" back here
-       $cacheArray['back_level']--;
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$cacheArray['back_level']} - LEVEL!<br />\n";
+       $GLOBALS['cache_array']['back_level']--;
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']} - LEVEL!<br />\n";
 
        // Fix empty refid
 
        // Fix empty refid
-       if (!isset($cacheArray['up_refid'][$cacheArray['back_level']-1])) $cacheArray['up_refid'][$cacheArray['back_level']-1] = 0;
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$cacheArray['back_level']},ref={$cacheArray['up_refid'][$cacheArray['back_level']-1]} - BACK!<br />\n";
+       if (!isset($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']-1])) $GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']-1] = 0;
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['back_level']},ref={$GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']-1]} - BACK!<br />\n";
        //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
 }
        //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
 }
+
 // "Getter" for array for user refs in given level
 function GET_USER_REFS ($uid, $level) {
        //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
 // "Getter" for array for user refs in given level
 function GET_USER_REFS ($uid, $level) {
        //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
@@ -297,6 +297,7 @@ ORDER BY r.refid ASC",
        //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
        return $refs;
 }
        //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
        return $refs;
 }
+
 // "Getter" for refback entry
 function GET_USER_REF_ENTRY ($id) {
        //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
 // "Getter" for refback entry
 function GET_USER_REF_ENTRY ($id) {
        //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
@@ -323,24 +324,25 @@ function GET_USER_REF_ENTRY ($id) {
        //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
        return $data;
 }
        //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
        return $data;
 }
+
 // Update refback percents (but with some sanity-checks!
 function REFBACK_CHANGE_MEMBER_PERCENTS ($id, $percents) {
        //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
        // Default status is failed
 // Update refback percents (but with some sanity-checks!
 function REFBACK_CHANGE_MEMBER_PERCENTS ($id, $percents) {
        //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
        // Default status is failed
-       $status['message'] = MEMBER_REFBACK_ERROR_GENERAL;
+       $status['message'] = getMessage('MEMBER_REFBACK_ERROR_GENERAL');
 
        // Do some sanity-checks
        if (!IS_MEMBER()) {
                // No member!
 
        // Do some sanity-checks
        if (!IS_MEMBER()) {
                // No member!
-               $status['message'] = MEMBER_REFBACK_ERROR_NO_MEMBER;
+               $status['message'] = getMessage('MEMBER_REFBACK_ERROR_NO_MEMBER');
                return $status;
        } elseif ("".$id."" != "".($id + 0)."") {
                // No number!
                return $status;
        } elseif ("".$id."" != "".($id + 0)."") {
                // No number!
-               $status['message'] = MEMBER_REFBACK_ERROR_INVALID_ID_NUMBER;
+               $status['message'] = getMessage('MEMBER_REFBACK_ERROR_INVALID_ID_NUMBER');
                return $status;
        } elseif (($percents < 0) || ($percents > 100)) {
                // Percentage is not valid!
                return $status;
        } elseif (($percents < 0) || ($percents > 100)) {
                // Percentage is not valid!
-               $status['message'] = MEMBER_REFBACK_ERROR_INVALID_PERCENTAGE;
+               $status['message'] = getMessage('MEMBER_REFBACK_ERROR_INVALID_PERCENTAGE');
                return $status;
        }
 
                return $status;
        }
 
@@ -350,7 +352,7 @@ function REFBACK_CHANGE_MEMBER_PERCENTS ($id, $percents) {
        // Is this valid?
        if (count($dummy) == 0) {
                // ID does not belong to user!
        // Is this valid?
        if (count($dummy) == 0) {
                // ID does not belong to user!
-               $status['message'] = MEMBER_REFBACK_ERROR_ID_MISMATCH;
+               $status['message'] = getMessage('MEMBER_REFBACK_ERROR_ID_MISMATCH');
                return $status;
        } // END - if
 
                return $status;
        } // END - if
 
@@ -364,7 +366,7 @@ function REFBACK_CHANGE_MEMBER_PERCENTS ($id, $percents) {
        // Entry updated?
        if (SQL_AFFECTEDROWS() < 1) {
                // Entry not updated!
        // Entry updated?
        if (SQL_AFFECTEDROWS() < 1) {
                // Entry not updated!
-               $status['message'] = MEMBER_REFBACK_ERROR_NOT_UPDATED;;
+               $status['message'] = getMessage('MEMBER_REFBACK_ERROR_NOT_UPDATED');
                return $status;
        } // END - if
 
                return $status;
        } // END - if
 
@@ -379,10 +381,10 @@ function REFBACK_CHANGE_MEMBER_PERCENTS ($id, $percents) {
        $mail = LOAD_EMAIL_TEMPLATE("member_refback", $content, $GLOBALS['userid']);
 
        // Send email to user
        $mail = LOAD_EMAIL_TEMPLATE("member_refback", $content, $GLOBALS['userid']);
 
        // Send email to user
-       SEND_EMAIL($dummy['refid'], MEMBER_REFBACK_SUBJECT, $mail);
+       SEND_EMAIL($dummy['refid'], getMessage('MEMBER_REFBACK_SUBJECT'), $mail);
 
        // Send admin notification
 
        // Send admin notification
-       SEND_ADMIN_NOTIFICATION(ADMIN_REFBACK_SUBJECT, "admin_refback", $content, $GLOBALS['userid']);
+       SEND_ADMIN_NOTIFICATION(getMessage('ADMIN_REFBACK_SUBJECT'), "admin_refback", $content, $GLOBALS['userid']);
 
        // All fine!
        $status['ok'] = true;
 
        // All fine!
        $status['ok'] = true;
index ebdaf6ee52ae855eb4059d4986015a9986250c49..4a56e674ef2c6f2ff1dfbd0a1f4a6fbb85c02032 100644 (file)
@@ -81,8 +81,6 @@ function THEME_SELECTION_BOX($mod, $act, $wht, $result) {
 
 // Get version from name
 function THEME_GET_VERSION ($name) {
 
 // Get version from name
 function THEME_GET_VERSION ($name) {
-       global $cacheArray;
-
        // Is the extension "theme" installed?
        if (!EXT_IS_ACTIVE("theme")) {
                // Then abort here
        // Is the extension "theme" installed?
        if (!EXT_IS_ACTIVE("theme")) {
                // Then abort here
@@ -93,9 +91,9 @@ function THEME_GET_VERSION ($name) {
        $cver = "?.?";
 
        // Is the cache entry there?
        $cver = "?.?";
 
        // Is the cache entry there?
-       if (isset($cacheArray['themes']['theme_ver'][$name])) {
+       if (isset($GLOBALS['cache_array']['themes']['theme_ver'][$name])) {
                // Get the version from cache
                // Get the version from cache
-               $cver = $cacheArray['themes']['theme_ver'][$name];
+               $cver = $GLOBALS['cache_array']['themes']['theme_ver'][$name];
 
                // Count up
                incrementConfigEntry('cache_hits');
 
                // Count up
                incrementConfigEntry('cache_hits');
@@ -126,8 +124,6 @@ function THEME_CHECK_EXIST ($name) {
 
 // Checks if a theme is active
 function THEME_IS_ACTIVE ($name) {
 
 // Checks if a theme is active
 function THEME_IS_ACTIVE ($name) {
-       global $cacheArray;
-
        // Is the extension "theme" installed?
        if (!EXT_IS_ACTIVE("theme")) {
                // Then abort here
        // Is the extension "theme" installed?
        if (!EXT_IS_ACTIVE("theme")) {
                // Then abort here
@@ -138,9 +134,9 @@ function THEME_IS_ACTIVE ($name) {
        $active = false;
 
        // Is the cache entry there?
        $active = false;
 
        // Is the cache entry there?
-       if (isset($cacheArray['themes']['theme_active'][$name])) {
+       if (isset($GLOBALS['cache_array']['themes']['theme_active'][$name])) {
                // Get the version from cache
                // Get the version from cache
-               $active = ($cacheArray['themes']['theme_active'][$name] == "Y");
+               $active = ($GLOBALS['cache_array']['themes']['theme_active'][$name] == "Y");
 
                // Count up
                incrementConfigEntry('cache_hits');
 
                // Count up
                incrementConfigEntry('cache_hits');
@@ -162,8 +158,6 @@ function THEME_IS_ACTIVE ($name) {
 
 // Gets current human-readable theme name
 function GET_CURR_THEME_NAME () {
 
 // Gets current human-readable theme name
 function GET_CURR_THEME_NAME () {
-       global $cacheArray;
-
        // Is the extension "theme" installed?
        if (!EXT_IS_ACTIVE("theme")) {
                // Then abort here
        // Is the extension "theme" installed?
        if (!EXT_IS_ACTIVE("theme")) {
                // Then abort here
@@ -174,9 +168,9 @@ function GET_CURR_THEME_NAME () {
        $name = GET_CURR_THEME();
 
        // Is the cache entry there?
        $name = GET_CURR_THEME();
 
        // Is the cache entry there?
-       if (isset($cacheArray['themes']['theme_name'][$name])) {
+       if (isset($GLOBALS['cache_array']['themes']['theme_name'][$name])) {
                // Get the version from cache
                // Get the version from cache
-               $name = $cacheArray['themes']['theme_name'][$name];
+               $name = $GLOBALS['cache_array']['themes']['theme_name'][$name];
 
                // Count up
                incrementConfigEntry('cache_hits');
 
                // Count up
                incrementConfigEntry('cache_hits');
index 4b832a07d17ba104162a8394924ce67987fead64..c3d2574d795659a6f0b006496f694a9f6f27fce5 100644 (file)
@@ -43,18 +43,17 @@ $EXT_CSS_FILES = array();
 $ADD = "";
 
 // Init cache instance and array
 $ADD = "";
 
 // Init cache instance and array
-global $cacheInstance, $cacheArray;
-$cacheInstance = null;
-$cacheArray = array();
+$GLOBALS['cache_instance'] = null;
+$GLOBALS['cache_array'] = array();
 
 // Skip loading extensions
 if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing'))) return;
 
 // Initialize array for "always keep active extensions"
 
 // Skip loading extensions
 if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing'))) return;
 
 // Initialize array for "always keep active extensions"
-$cacheArray['active_extensions'] = array();
+$GLOBALS['cache_array']['active_extensions'] = array();
 
 // By default no cache is set
 
 // By default no cache is set
-$cacheMode = "no";
+$GLOBALS['cacheMode'] = "no";
 
 // Load sql_patchrs extension alone
 LOAD_EXTENSION("sql_patches");
 
 // Load sql_patchrs extension alone
 LOAD_EXTENSION("sql_patches");
@@ -67,37 +66,37 @@ if (EXT_IS_ACTIVE("cache")) {
        LOAD_EXTENSION("cache");
 
        // Check extension cache
        LOAD_EXTENSION("cache");
 
        // Check extension cache
-       switch (($cacheInstance->loadCacheFile("extensions", true)) && ($cacheInstance->extensionVersionMatches("sql_patches"))) {
-               case true : $cacheMode = "load"; break;
-               case false: $cacheMode = "init"; break;
+       switch (($GLOBALS['cache_instance']->loadCacheFile("extensions", true)) && ($GLOBALS['cache_instance']->extensionVersionMatches("sql_patches"))) {
+               case true : $GLOBALS['cacheMode'] = "load"; break;
+               case false: $GLOBALS['cacheMode'] = "init"; break;
        }
 
        // Do we need to init the cache?
        }
 
        // Do we need to init the cache?
-       if (($cacheMode == "init") && (getConfig('cache_exts') == "Y")) {
+       if (($GLOBALS['cacheMode'] == "init") && (getConfig('cache_exts') == "Y")) {
                // Init cache file
                // Init cache file
-               $cacheInstance->init("EXTENSIONS");
-               $cacheInstance->storeExtensionVersion("sql_patches");
+               $GLOBALS['cache_instance']->init("EXTENSIONS");
+               $GLOBALS['cache_instance']->storeExtensionVersion("sql_patches");
        } elseif (getConfig('cache_exts') != "Y") {
                // Cache will not be created for extensions
        } elseif (getConfig('cache_exts') != "Y") {
                // Cache will not be created for extensions
-               $cacheMode = "skip";
+               $GLOBALS['cacheMode'] = "skip";
        }
 } // END - if
 
 // Load cache?
        }
 } // END - if
 
 // Load cache?
-if ($cacheMode == "load") {
+if ($GLOBALS['cacheMode'] == "load") {
        // Init include array
        $EXT_POOL = array();
 
        // Re-initialize handler
        // Init include array
        $EXT_POOL = array();
 
        // Re-initialize handler
-       $cacheInstance->loadCacheFile("extensions", true);
+       $GLOBALS['cache_instance']->loadCacheFile("extensions", true);
 
        // Load extension data from cache file
 
        // Load extension data from cache file
-       $EXT_DUMMY = $cacheInstance->getArrayFromCache();
+       $EXT_DUMMY = $GLOBALS['cache_instance']->getArrayFromCache();
 
        // Is the cache file fine?
        if (!isset($EXT_DUMMY['ext_name'])) {
                // Cache file is damaged so kill it
 
        // Is the cache file fine?
        if (!isset($EXT_DUMMY['ext_name'])) {
                // Cache file is damaged so kill it
-               $cacheInstance->destroyCacheFile();
+               $GLOBALS['cache_instance']->destroyCacheFile();
 
                // Retry it
                LOAD_INC(__FILE__);
 
                // Retry it
                LOAD_INC(__FILE__);
@@ -139,7 +138,7 @@ if ($cacheMode == "load") {
                $EXT_DUMMY['ext_deprecated'][$name] = "N";
 
                // Mark it as active extension
                $EXT_DUMMY['ext_deprecated'][$name] = "N";
 
                // Mark it as active extension
-               $cacheArray['active_extensions']['$name'] = $EXT_DUMMY['ext_keep'][$k];
+               $GLOBALS['cache_array']['active_extensions']['$name'] = $EXT_DUMMY['ext_keep'][$k];
                unset($EXT_DUMMY['ext_keep'][$k]);
 
                // Remove unneccessary data from memory
                unset($EXT_DUMMY['ext_keep'][$k]);
 
                // Remove unneccessary data from memory
@@ -153,7 +152,7 @@ if ($cacheMode == "load") {
        // Loading cache is done so let's free some memory!
        unset($EXT_DUMMY['ext_keep']);
        unset($EXT_DUMMY['ext_css']);
        // Loading cache is done so let's free some memory!
        unset($EXT_DUMMY['ext_keep']);
        unset($EXT_DUMMY['ext_css']);
-       $cacheArray['extensions'] = $EXT_DUMMY;
+       $GLOBALS['cache_array']['extensions'] = $EXT_DUMMY;
        unset($EXT_DUMMY);
 
        // No database load needed
        unset($EXT_DUMMY);
 
        // No database load needed
@@ -176,7 +175,7 @@ if ($cacheMode == "load") {
        // If current user is not admin load only activated extensions. But load
        // them all if we are going to init the cache files. The admin shall use
        // every available extension for testing purposes.
        // If current user is not admin load only activated extensions. But load
        // them all if we are going to init the cache files. The admin shall use
        // every available extension for testing purposes.
-       if ((!IS_ADMIN()) && ($cacheMode != "init")) $ADD = " WHERE ext_active='Y'";
+       if ((!IS_ADMIN()) && ($GLOBALS['cacheMode'] != "init")) $ADD = " WHERE ext_active='Y'";
 
        if (GET_EXT_VERSION("sql_patches") >= "0.0.6") {
                // Query with CSS file from DB
 
        if (GET_EXT_VERSION("sql_patches") >= "0.0.6") {
                // Query with CSS file from DB
@@ -195,7 +194,7 @@ ORDER BY ext_name", __FILE__, __LINE__);
 $DEL = array();
 
 // At least one found?
 $DEL = array();
 
 // At least one found?
-if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($cacheMode == "init") && ($CSS != "1") && ($CSS != "-1")) || ($cacheMode == "no"))) {
+if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($GLOBALS['cacheMode'] == "init") && ($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1")) || ($GLOBALS['cacheMode'] == "no"))) {
        // Load session management
        LOAD_INC_ONCE("inc/session.php");
 
        // Load session management
        LOAD_INC_ONCE("inc/session.php");
 
@@ -230,10 +229,10 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($cacheMode == "init") && ($CSS != "1")
                        // CSS file handling:
                        if ((!isset($content['ext_css'])) || ($content['ext_css'] == "Y")) {
                                // Create FQFN for the CSS file
                        // CSS file handling:
                        if ((!isset($content['ext_css'])) || ($content['ext_css'] == "Y")) {
                                // Create FQFN for the CSS file
-                               $CSS_FILE = sprintf("%stheme/%s/css/%s.css", constant('PATH'), GET_CURR_THEME(), $content['ext_name']);
+                               $GLOBALS['output_mode']_FILE = sprintf("%stheme/%s/css/%s.css", constant('PATH'), GET_CURR_THEME(), $content['ext_name']);
 
                                // Is the file there?
 
                                // Is the file there?
-                               if (FILE_READABLE($CSS_FILE)) {
+                               if (FILE_READABLE($GLOBALS['output_mode']_FILE)) {
                                        // CSS file for extension was found (use only relative path for now!)
                                        $EXT_CSS_FILES[] = $content['ext_name'].".css";
                                        $content['ext_css'] = "Y";
                                        // CSS file for extension was found (use only relative path for now!)
                                        $EXT_CSS_FILES[] = $content['ext_name'].".css";
                                        $content['ext_css'] = "Y";
@@ -244,12 +243,12 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($cacheMode == "init") && ($CSS != "1")
                        } // END - if
 
                        // Shall we cache?
                        } // END - if
 
                        // Shall we cache?
-                       if ($cacheMode == "init") {
+                       if ($GLOBALS['cacheMode'] == "init") {
                                // Add cache row
                                // Add cache row
-                               $cacheInstance->addRow($content);
-                       } elseif ($cacheMode == "no") {
+                               $GLOBALS['cache_instance']->addRow($content);
+                       } elseif ($GLOBALS['cacheMode'] == "no") {
                                // Remember this value for later usage
                                // Remember this value for later usage
-                               $cacheArray['active_extensions'][$content['ext_name']] = $EXT_ALWAYS_ACTIVE;
+                               $GLOBALS['cache_array']['active_extensions'][$content['ext_name']] = $EXT_ALWAYS_ACTIVE;
                        }
                } elseif (!FILE_READABLE($FQFN)) {
                        // Deleted extension file so we mark it for removal from DB
                        }
                } elseif (!FILE_READABLE($FQFN)) {
                        // Deleted extension file so we mark it for removal from DB
@@ -260,9 +259,9 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($cacheMode == "init") && ($CSS != "1")
        // Init filter system
        INIT_FILTER_SYSTEM();
 
        // Init filter system
        INIT_FILTER_SYSTEM();
 
-       if ($cacheMode == "init") {
+       if ($GLOBALS['cacheMode'] == "init") {
                // Close cache file
                // Close cache file
-               $cacheInstance->finalize();
+               $GLOBALS['cache_instance']->finalize();
 
                // Load more cache files (like admins)
                LOAD_INC_ONCE("inc/load_cache.php");
 
                // Load more cache files (like admins)
                LOAD_INC_ONCE("inc/load_cache.php");
index eef5335ccb7f86516cbe88661b01582b58048834..2ae06ced10913d45550f2119a2ad14309fb752cf 100644 (file)
@@ -37,56 +37,52 @@ if (!defined('__SECURITY')) {
        require($INC);
 } // END - if
 
        require($INC);
 } // END - if
 
-// Make cacheInstance global
-global $cacheInstance;
-
 // Let's start with the admins table...
 // Let's start with the admins table...
-if (($cacheInstance->loadCacheFile("admins")) && ($cacheInstance->extensionVersionMatches("admins"))) {
+if (($GLOBALS['cache_instance']->loadCacheFile("admins")) && ($GLOBALS['cache_instance']->extensionVersionMatches("admins"))) {
        // Load cache
        // Load cache
-       global $cacheArray;
-       $cacheArray['admins'] = $cacheInstance->getArrayFromCache();
+       $GLOBALS['cache_array']['admins'] = $GLOBALS['cache_instance']->getArrayFromCache();
 
        // Check if valid
 
        // Check if valid
-       if ((isset($cacheArray['admins']['login'])) && (is_array($cacheArray['admins']['login'])) && (is_array($cacheArray['admins']['aid']))) {
+       if ((isset($GLOBALS['cache_array']['admins']['login'])) && (is_array($GLOBALS['cache_array']['admins']['login'])) && (is_array($GLOBALS['cache_array']['admins']['aid']))) {
                // Check count
                // Check count
-               if (count($cacheArray['admins']['login']) == count($cacheArray['admins']['aid'])) {
+               if (count($GLOBALS['cache_array']['admins']['login']) == count($GLOBALS['cache_array']['admins']['aid'])) {
                        // Get "id map"
                        // Get "id map"
-                       $idMap = $cacheArray['admins']['aid'];
+                       $idMap = $GLOBALS['cache_array']['admins']['aid'];
 
                        // Rewrite the cache array
                        for ($idx = (count($idMap) - 1); $idx >= 0; $idx--) {
                                // Rewrite all entries
 
                        // Rewrite the cache array
                        for ($idx = (count($idMap) - 1); $idx >= 0; $idx--) {
                                // Rewrite all entries
-                               foreach ($cacheArray['admins'] as $key=>$entryArray) {
+                               foreach ($GLOBALS['cache_array']['admins'] as $key=>$entryArray) {
                                        // Rewrite the entry
                                        if ($key == "aid") {
                                                // Rewrite admin id (use login name as index)
                                        // Rewrite the entry
                                        if ($key == "aid") {
                                                // Rewrite admin id (use login name as index)
-                                               $cacheArray['admins']['aid'][$cacheArray['admins']['login'][$idx]] = $entryArray[$idx];
+                                               $GLOBALS['cache_array']['admins']['aid'][$GLOBALS['cache_array']['admins']['login'][$idx]] = $entryArray[$idx];
                                        } else {
                                                // Rewrite regular entry
                                        } else {
                                                // Rewrite regular entry
-                                               $cacheArray['admins'][$key][$idMap[$idx]] = $entryArray[$idx];
+                                               $GLOBALS['cache_array']['admins'][$key][$idMap[$idx]] = $entryArray[$idx];
                                        }
 
                                        // Is the last entry reached?
                                        if ($idx == 0) {
                                                // Remove it
                                        }
 
                                        // Is the last entry reached?
                                        if ($idx == 0) {
                                                // Remove it
-                                               unset($cacheArray['admins'][$key][0]);
+                                               unset($GLOBALS['cache_array']['admins'][$key][0]);
                                        } // END - if
                                } // END - if
                        } // END - for
                } else {
                        // Nope, cache file is corrupted!
                                        } // END - if
                                } // END - if
                        } // END - for
                } else {
                        // Nope, cache file is corrupted!
-                       $cacheInstance->destroyCacheFile();
-                       unset($cacheArray['admins']);
+                       $GLOBALS['cache_instance']->destroyCacheFile();
+                       unset($GLOBALS['cache_array']['admins']);
                }
        } else {
                // Nope, cache file is corrupted!
                }
        } else {
                // Nope, cache file is corrupted!
-               $cacheInstance->destroyCacheFile();
-               unset($cacheArray['admins']);
+               $GLOBALS['cache_instance']->destroyCacheFile();
+               unset($GLOBALS['cache_array']['admins']);
        }
        }
-} elseif ((getConfig('cache_admins') == "Y") && ($CSS != "1") && ($CSS != "-1")) {
+} elseif ((getConfig('cache_admins') == "Y") && ($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1")) {
        // Create cache file
        // Create cache file
-       $cacheInstance->init("ADMINS");
-       $cacheInstance->storeExtensionVersion("admins");
+       $GLOBALS['cache_instance']->init("ADMINS");
+       $GLOBALS['cache_instance']->storeExtensionVersion("admins");
 
        // Load every data from DB to cache file
        $ADD = RUN_FILTER('sql_admin_extra_data');
 
        // Load every data from DB to cache file
        $ADD = RUN_FILTER('sql_admin_extra_data');
@@ -97,14 +93,14 @@ FROM `{!_MYSQL_PREFIX!}_admins`
 ORDER BY login", __FILE__, __LINE__);
        while($dummy = SQL_FETCHARRAY($result_admins)) {
                // Save row
 ORDER BY login", __FILE__, __LINE__);
        while($dummy = SQL_FETCHARRAY($result_admins)) {
                // Save row
-               $cacheInstance->addRow($dummy);
+               $GLOBALS['cache_instance']->addRow($dummy);
        } // END - while
 
        // Free memory
        SQL_FREERESULT($result_admins);
 
        // Close cache
        } // END - while
 
        // Free memory
        SQL_FREERESULT($result_admins);
 
        // Close cache
-       $cacheInstance->finalize();
+       $GLOBALS['cache_instance']->finalize();
 
        // Reload the cache
        LOAD_INC(__FILE__);
 
        // Reload the cache
        LOAD_INC(__FILE__);
@@ -113,14 +109,14 @@ ORDER BY login", __FILE__, __LINE__);
 // Next cached table are the admins_acls...
 if (GET_EXT_VERSION("admins") >= "0.3") {
        // Check for cache file
 // Next cached table are the admins_acls...
 if (GET_EXT_VERSION("admins") >= "0.3") {
        // Check for cache file
-       if (($cacheInstance->loadCacheFile("admins_acls")) && ($cacheInstance->extensionVersionMatches("admins"))) {
+       if (($GLOBALS['cache_instance']->loadCacheFile("admins_acls")) && ($GLOBALS['cache_instance']->extensionVersionMatches("admins"))) {
                // Load referal system from cache
                // Load referal system from cache
-               global $cacheArray;
-               $cacheArray['admin_acls'] = $cacheInstance->getArrayFromCache();
-       } elseif ((getConfig('cache_acls') == "Y") && ($CSS != "1") && ($CSS != "-1")) {
+               global $GLOBALS['cache_array'];
+               $GLOBALS['cache_array']['admin_acls'] = $GLOBALS['cache_instance']->getArrayFromCache();
+       } elseif ((getConfig('cache_acls') == "Y") && ($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1")) {
                // Create cache file here
                // Create cache file here
-               $cacheInstance->init("ADMINS_ACLS");
-               $cacheInstance->storeExtensionVersion("admins");
+               $GLOBALS['cache_instance']->init("ADMINS_ACLS");
+               $GLOBALS['cache_instance']->storeExtensionVersion("admins");
 
                // Load all modules and their data
                $result = SQL_QUERY("SELECT id, admin_id, action_menu, what_menu, access_mode FROM `{!_MYSQL_PREFIX!}_admins_acls` ORDER BY admin_id, action_menu, what_menu", __FILE__, __LINE__);
 
                // Load all modules and their data
                $result = SQL_QUERY("SELECT id, admin_id, action_menu, what_menu, access_mode FROM `{!_MYSQL_PREFIX!}_admins_acls` ORDER BY admin_id, action_menu, what_menu", __FILE__, __LINE__);
@@ -128,14 +124,14 @@ if (GET_EXT_VERSION("admins") >= "0.3") {
                // Add all rows
                while ($data = SQL_FETCHARRAY($result)) {
                        // Add row to cache file
                // Add all rows
                while ($data = SQL_FETCHARRAY($result)) {
                        // Add row to cache file
-                       $cacheInstance->addRow($data);
+                       $GLOBALS['cache_instance']->addRow($data);
                } // END - while
 
                // Free memory
                SQL_FREERESULT($result);
 
                // Close cache
                } // END - while
 
                // Free memory
                SQL_FREERESULT($result);
 
                // Close cache
-               $cacheInstance->finalize();
+               $GLOBALS['cache_instance']->finalize();
 
                // Reload the cache
                LOAD_INC(__FILE__);
 
                // Reload the cache
                LOAD_INC(__FILE__);
index 39b032af951642da048e0253eb17dbbf7acc5f77..ad5b5dfcd9cda20226beaa996f41e9e1c1c8acde 100644 (file)
@@ -37,33 +37,29 @@ if (!defined('__SECURITY')) {
        require($INC);
 }
 
        require($INC);
 }
 
-// Make cacheInstance global
-global $cacheInstance;
-
 // Next cached table is the configuration (config)...
 // Next cached table is the configuration (config)...
-if (($cacheInstance->loadCacheFile("config", true)) && ($cacheInstance->extensionVersionMatches("sql_patches"))) {
+if (($GLOBALS['cache_instance']->loadCacheFile("config", true)) && ($GLOBALS['cache_instance']->extensionVersionMatches("sql_patches"))) {
        // Load config from cache
        // Load config from cache
-       global $cacheArray;
-       $cacheArray['config'] = $cacheInstance->getArrayFromCache();
+       $GLOBALS['cache_array']['config'] = $GLOBALS['cache_instance']->getArrayFromCache();
 
        // @TODO: Do we really need to cache the config???
 
        // @TODO: Do we really need to cache the config???
-} elseif ((getConfig('cache_config') == "Y") && ($CSS != "1") && ($CSS != "-1")) {
+} elseif ((getConfig('cache_config') == "Y") && ($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1")) {
        // Create cache file here
        // Create cache file here
-       $cacheInstance->init("CONFIG");
-       $cacheInstance->storeExtensionVersion("sql_patches");
+       $GLOBALS['cache_instance']->init("CONFIG");
+       $GLOBALS['cache_instance']->storeExtensionVersion("sql_patches");
 
        // Load all modules and their data
        $result = SQL_QUERY("SELECT * FROM `{!_MYSQL_PREFIX!}_config` ORDER BY config ASC", __FILE__, __LINE__);
        while ($data = SQL_FETCHARRAY($result)) {
                // Add row to cache file
 
        // Load all modules and their data
        $result = SQL_QUERY("SELECT * FROM `{!_MYSQL_PREFIX!}_config` ORDER BY config ASC", __FILE__, __LINE__);
        while ($data = SQL_FETCHARRAY($result)) {
                // Add row to cache file
-               $cacheInstance->addRow($data);
+               $GLOBALS['cache_instance']->addRow($data);
        } // END - while
 
        // Free memory
        SQL_FREERESULT($result);
 
        // Close the cache
        } // END - while
 
        // Free memory
        SQL_FREERESULT($result);
 
        // Close the cache
-       $cacheInstance->finalize();
+       $GLOBALS['cache_instance']->finalize();
 
        // Reload the cache
        LOAD_INC(__FILE__);
 
        // Reload the cache
        LOAD_INC(__FILE__);
index 7e6411ae5b1c20293b97ffe13d73bb0502b883f0..07f8be05d480d97df5ddf29f0d1b1ab9ff75f9d7 100644 (file)
@@ -37,40 +37,36 @@ if (!defined('__SECURITY')) {
        require($INC);
 }
 
        require($INC);
 }
 
-// Make cacheInstance global
-global $cacheInstance;
-
 // Next cached table is the module registry (mod_reg)...
 // Next cached table is the module registry (mod_reg)...
-if (($cacheInstance->loadCacheFile("mod_reg")) && ($cacheInstance->extensionVersionMatches("sql_patches"))) {
+if (($GLOBALS['cache_instance']->loadCacheFile("mod_reg")) && ($GLOBALS['cache_instance']->extensionVersionMatches("sql_patches"))) {
        // Load cache
        // Load cache
-       global $cacheArray;
-       $cacheArray['modules'] = $cacheInstance->getArrayFromCache();
+       $GLOBALS['cache_array']['modules'] = $GLOBALS['cache_instance']->getArrayFromCache();
 
        // Rewrite module cache
 
        // Rewrite module cache
-       $modArray = $cacheArray['modules'];
+       $modArray = $GLOBALS['cache_array']['modules'];
        foreach ($modArray['module'] as $key => $mod) {
        foreach ($modArray['module'] as $key => $mod) {
-               $cacheArray['modules']['id'][$mod] = $modArray['id'][$key];
-               unset($cacheArray['modules']['id'][$key]);
-               $cacheArray['modules']['title'][$mod] = $modArray['title'][$key];
-               unset($cacheArray['modules']['title'][$key]);
-               $cacheArray['modules']['locked'][$mod] = $modArray['locked'][$key];
-               unset($cacheArray['modules']['locked'][$key]);
-               $cacheArray['modules']['hidden'][$mod] = $modArray['hidden'][$key];
-               unset($cacheArray['modules']['hidden'][$key]);
-               $cacheArray['modules']['admin_only'][$mod] = $modArray['admin_only'][$key];
-               unset($cacheArray['modules']['admin_only'][$key]);
-               $cacheArray['modules']['mem_only'][$mod] = $modArray['mem_only'][$key];
-               unset($cacheArray['modules']['mem_only'][$key]);
-               if (isset($cacheArray['modules']['has_menu'][$key])) {
-                       $cacheArray['modules']['has_menu'][$mod] = $modArray['has_menu'][$key];
-                       unset($cacheArray['modules']['has_menu'][$key]);
+               $GLOBALS['cache_array']['modules']['id'][$mod] = $modArray['id'][$key];
+               unset($GLOBALS['cache_array']['modules']['id'][$key]);
+               $GLOBALS['cache_array']['modules']['title'][$mod] = $modArray['title'][$key];
+               unset($GLOBALS['cache_array']['modules']['title'][$key]);
+               $GLOBALS['cache_array']['modules']['locked'][$mod] = $modArray['locked'][$key];
+               unset($GLOBALS['cache_array']['modules']['locked'][$key]);
+               $GLOBALS['cache_array']['modules']['hidden'][$mod] = $modArray['hidden'][$key];
+               unset($GLOBALS['cache_array']['modules']['hidden'][$key]);
+               $GLOBALS['cache_array']['modules']['admin_only'][$mod] = $modArray['admin_only'][$key];
+               unset($GLOBALS['cache_array']['modules']['admin_only'][$key]);
+               $GLOBALS['cache_array']['modules']['mem_only'][$mod] = $modArray['mem_only'][$key];
+               unset($GLOBALS['cache_array']['modules']['mem_only'][$key]);
+               if (isset($GLOBALS['cache_array']['modules']['has_menu'][$key])) {
+                       $GLOBALS['cache_array']['modules']['has_menu'][$mod] = $modArray['has_menu'][$key];
+                       unset($GLOBALS['cache_array']['modules']['has_menu'][$key]);
                } // END - if
        } // END - foreach
        unset($modArray);
                } // END - if
        } // END - foreach
        unset($modArray);
-} elseif ((getConfig('cache_modreg') == "Y") && ($CSS != "1") && ($CSS != "-1")) {
+} elseif ((getConfig('cache_modreg') == "Y") && ($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1")) {
        // Create cache file here
        // Create cache file here
-       $cacheInstance->init("MODULES");
-       $cacheInstance->storeExtensionVersion("sql_patches");
+       $GLOBALS['cache_instance']->init("MODULES");
+       $GLOBALS['cache_instance']->storeExtensionVersion("sql_patches");
 
        // Load all modules and their data
        if (GET_EXT_VERSION("sql_patches") >= "0.3.6") {
 
        // Load all modules and their data
        if (GET_EXT_VERSION("sql_patches") >= "0.3.6") {
@@ -86,14 +82,14 @@ FROM `{!_MYSQL_PREFIX!}_mod_reg` ORDER BY `id`", __FILE__, __LINE__);
        // Cache all data
        while ($data = SQL_FETCHARRAY($result)) {
                // Add row to cache file
        // Cache all data
        while ($data = SQL_FETCHARRAY($result)) {
                // Add row to cache file
-               $cacheInstance->addRow($data);
+               $GLOBALS['cache_instance']->addRow($data);
        } // END - while
 
        // Free memory
        SQL_FREERESULT($result);
 
        // Close the cache
        } // END - while
 
        // Free memory
        SQL_FREERESULT($result);
 
        // Close the cache
-       $cacheInstance->finalize();
+       $GLOBALS['cache_instance']->finalize();
 
        // Reload the cache
        LOAD_INC(__FILE__);
 
        // Reload the cache
        LOAD_INC(__FILE__);
index 7c5bf3ff554fa672cecb27afdf13050f6e724bb4..4e73cb15f0e7cd9c80afa1fb5515fd5ede226b3b 100644 (file)
@@ -37,31 +37,27 @@ if (!defined('__SECURITY')) {
        require($INC);
 }
 
        require($INC);
 }
 
-// Make cacheInstance global
-global $cacheInstance;
-
 // Next cached table is the referal system (refdepths)...
 // Next cached table is the referal system (refdepths)...
-if (($cacheInstance->loadCacheFile("refdepths")) && ($cacheInstance->extensionVersionMatches("sql_patches"))) {
+if (($GLOBALS['cache_instance']->loadCacheFile("refdepths")) && ($GLOBALS['cache_instance']->extensionVersionMatches("sql_patches"))) {
        // Load referal system from cache
        // Load referal system from cache
-       global $cacheArray;
-       $cacheArray['ref_depths'] = $cacheInstance->getArrayFromCache();
-} elseif ((getConfig('cache_refdepth') == "Y") && ($CSS != "1") && ($CSS != "-1")) {
+       $GLOBALS['cache_array']['ref_depths'] = $GLOBALS['cache_instance']->getArrayFromCache();
+} elseif ((getConfig('cache_refdepth') == "Y") && ($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1")) {
        // Create cache file here
        // Create cache file here
-       $cacheInstance->init("REFDEPTHS");
-       $cacheInstance->storeExtensionVersion("sql_patches");
+       $GLOBALS['cache_instance']->init("REFDEPTHS");
+       $GLOBALS['cache_instance']->storeExtensionVersion("sql_patches");
 
        // Load all modules and their data
        $result = SQL_QUERY("SELECT id, level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` ORDER BY level", __FILE__, __LINE__);
        while ($data = SQL_FETCHARRAY($result)) {
                // Add row to cache file
 
        // Load all modules and their data
        $result = SQL_QUERY("SELECT id, level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` ORDER BY level", __FILE__, __LINE__);
        while ($data = SQL_FETCHARRAY($result)) {
                // Add row to cache file
-               $cacheInstance->addRow($data);
+               $GLOBALS['cache_instance']->addRow($data);
        } // END - while
 
        // Free memory
        SQL_FREERESULT($result);
 
        // Close the cache
        } // END - while
 
        // Free memory
        SQL_FREERESULT($result);
 
        // Close the cache
-       $cacheInstance->finalize();
+       $GLOBALS['cache_instance']->finalize();
 
        // Reload the cache
        LOAD_INC(__FILE__);
 
        // Reload the cache
        LOAD_INC(__FILE__);
index b65764680e50f8af4a8ac584e6f35d22c412c398..e87dbf022f863065ee0fc85cfd316e5545d5f3bb 100644 (file)
@@ -37,31 +37,27 @@ if (!defined('__SECURITY')) {
        require($INC);
 }
 
        require($INC);
 }
 
-// Make cacheInstance global
-global $cacheInstance;
-
 // Next cached table is the referal system (refsystem)...
 // Next cached table is the referal system (refsystem)...
-if (($cacheInstance->loadCacheFile("refsystem")) && ($cacheInstance->extensionVersionMatches("sql_patches"))) {
+if (($GLOBALS['cache_instance']->loadCacheFile("refsystem")) && ($GLOBALS['cache_instance']->extensionVersionMatches("sql_patches"))) {
        // Load referal system from cache
        // Load referal system from cache
-       global $cacheArray;
-       $cacheArray['refsystem'] = $cacheInstance->getArrayFromCache();
-} elseif ((getConfig('cache_refsys') == "Y") && ($CSS != "1") && ($CSS != "-1")) {
+       $GLOBALS['cache_array']['refsystem'] = $GLOBALS['cache_instance']->getArrayFromCache();
+} elseif ((getConfig('cache_refsys') == "Y") && ($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1")) {
        // Create cache file here
        // Create cache file here
-       $cacheInstance->init("REFSYSTEM");
-       $cacheInstance->storeExtensionVersion("sql_patches");
+       $GLOBALS['cache_instance']->init("REFSYSTEM");
+       $GLOBALS['cache_instance']->storeExtensionVersion("sql_patches");
 
        // Load all modules and their data
        $result = SQL_QUERY("SELECT id, userid, level, counter FROM `{!_MYSQL_PREFIX!}_refsystem` ORDER BY userid, level", __FILE__, __LINE__);
        while ($data = SQL_FETCHARRAY($result)) {
                // Add row to cache file
 
        // Load all modules and their data
        $result = SQL_QUERY("SELECT id, userid, level, counter FROM `{!_MYSQL_PREFIX!}_refsystem` ORDER BY userid, level", __FILE__, __LINE__);
        while ($data = SQL_FETCHARRAY($result)) {
                // Add row to cache file
-               $cacheInstance->addRow($data);
+               $GLOBALS['cache_instance']->addRow($data);
        } // END - while
 
        // Free memory
        SQL_FREERESULT($result);
 
        // Close the cache
        } // END - while
 
        // Free memory
        SQL_FREERESULT($result);
 
        // Close the cache
-       $cacheInstance->finalize();
+       $GLOBALS['cache_instance']->finalize();
 
        // Reload the cache
        LOAD_INC(__FILE__);
 
        // Reload the cache
        LOAD_INC(__FILE__);
index 0b453f1b4bfa16b697f7e2c42ef028ca48b6a10c..fcfd809967a2d8bc93a2f9b3b3d4faf1fee2bba6 100644 (file)
@@ -40,38 +40,34 @@ if (!defined('__SECURITY')) {
        return false;
 }
 
        return false;
 }
 
-// Make cacheInstance global
-global $cacheInstance;
-
 // Next cached table is the referal system (themes)...
 // Next cached table is the referal system (themes)...
-if (($cacheInstance->loadCacheFile("themes")) && ($cacheInstance->extensionVersionMatches("theme"))) {
+if (($GLOBALS['cache_instance']->loadCacheFile("themes")) && ($GLOBALS['cache_instance']->extensionVersionMatches("theme"))) {
        // Load referal system from cache
        // Load referal system from cache
-       global $cacheArray;
-       $cache = $cacheInstance->getArrayFromCache();
+       $cache = $GLOBALS['cache_instance']->getArrayFromCache();
 
        // Restructure the array
 
        // Restructure the array
-       $cacheArray['themes'] = array();
+       $GLOBALS['cache_array']['themes'] = array();
        foreach ($cache as $key => $data) {
                // Skip "theme_path" because we don't need to rebuild it
                if ($key == "theme_path") {
                        // Add entries with id
                        foreach ($data as $id => $entry) {
        foreach ($cache as $key => $data) {
                // Skip "theme_path" because we don't need to rebuild it
                if ($key == "theme_path") {
                        // Add entries with id
                        foreach ($data as $id => $entry) {
-                               $cacheArray['themes']['theme_path'][$cache['id'][$id]] = $entry;
+                               $GLOBALS['cache_array']['themes']['theme_path'][$cache['id'][$id]] = $entry;
                        } // END - foreach
                } else {
                        // Add all themes with theme name as array index
                        foreach ($data as $id => $entry) {
                        } // END - foreach
                } else {
                        // Add all themes with theme name as array index
                        foreach ($data as $id => $entry) {
-                               $cacheArray['themes'][$key][$cache['theme_path'][$id]] = $entry;
+                               $GLOBALS['cache_array']['themes'][$key][$cache['theme_path'][$id]] = $entry;
                        } // END - foreach
                }
        } // END - if
 
        // Remove dummy array
        unset($cache);
                        } // END - foreach
                }
        } // END - if
 
        // Remove dummy array
        unset($cache);
-} elseif ((getConfig('cache_themes') == "Y") && ($CSS != "1") && ($CSS != "-1")) {
+} elseif ((getConfig('cache_themes') == "Y") && ($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1")) {
        // Create cache file here
        // Create cache file here
-       $cacheInstance->init("THEMES");
-       $cacheInstance->storeExtensionVersion("theme");
+       $GLOBALS['cache_instance']->init("THEMES");
+       $GLOBALS['cache_instance']->storeExtensionVersion("theme");
 
        // Load all themes and their data
        if (GET_EXT_VERSION("theme") >= "0.0.7") {
 
        // Load all themes and their data
        if (GET_EXT_VERSION("theme") >= "0.0.7") {
@@ -81,14 +77,14 @@ if (($cacheInstance->loadCacheFile("themes")) && ($cacheInstance->extensionVersi
        }
        while ($data = SQL_FETCHARRAY($result)) {
                // Add row to cache file
        }
        while ($data = SQL_FETCHARRAY($result)) {
                // Add row to cache file
-               $cacheInstance->addRow($data);
+               $GLOBALS['cache_instance']->addRow($data);
        } // END - while
 
        // Free memory
        SQL_FREERESULT($result);
 
        // Close the cache
        } // END - while
 
        // Free memory
        SQL_FREERESULT($result);
 
        // Close the cache
-       $cacheInstance->finalize();
+       $GLOBALS['cache_instance']->finalize();
 
        // Reload the cache
        LOAD_INC(__FILE__);
 
        // Reload the cache
        LOAD_INC(__FILE__);
index a208c5376f65abb0465f41a894f08c97409a1a0b..d5a098a42b84ab34d768ea2a4db5e3244d8a9ec3 100644 (file)
@@ -40,8 +40,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode
 }
 
 // Do not execute when script is in CSS mode
-global $CSS;
-if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
+if (($GLOBALS['output_mode'] == 1) || (!defined('__DAILY_RESET'))) return;
 
 //
 ?>
 
 //
 ?>
index 5fa921256436733246ac8bcd705b841a94be5c00..8072c29321c12352e9888307cef2a964e9cd54d8 100644 (file)
@@ -40,8 +40,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode
 }
 
 // Do not execute when script is in CSS mode
-global $CSS;
-if ($CSS == 1) return;
+if ($GLOBALS['output_mode'] == 1) return;
 
 // Create timemark from saved month
 $mark = mktime(0, 0, 0, getConfig('last_month'), date("d", time()), date('Y', time()));
 
 // Create timemark from saved month
 $mark = mktime(0, 0, 0, getConfig('last_month'), date("d", time()), date('Y', time()));
index f843766557d0def1fd54188f51dff12684d23370..3edf763e9e926ff7300b6bc7a506e772ec15aa86 100644 (file)
@@ -40,8 +40,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode
 }
 
 // Do not execute when script is in CSS mode
-global $CSS;
-if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
+if (($GLOBALS['output_mode'] == 1) || (!defined('__DAILY_RESET'))) return;
 
 // Get current day (01 to 31), month (01 to 12) and year (4-digits year)
 $DAY   = date("d", time());
 
 // Get current day (01 to 31), month (01 to 12) and year (4-digits year)
 $DAY   = date("d", time());
index 591ae9e2e64a01930e4e2fa6e35aff9455e35640..ff07609ab54c7bdf1b1fddb4186b102ef78a116d 100644 (file)
@@ -40,8 +40,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode
 }
 
 // Do not execute when script is in CSS mode
-global $CSS;
-if ($CSS == 1) return;
+if ($GLOBALS['output_mode'] == 1) return;
 
 // Create timemark from saved month
 $mark = mktime(0, 0, 0, getConfig('last_month'), date("d", time()), date('Y', time()));
 
 // Create timemark from saved month
 $mark = mktime(0, 0, 0, getConfig('last_month'), date("d", time()), date('Y', time()));
index 706a4724e41af99c773cf88334a507b9fe1a7920..e7b1acb6195185bad6baabc8fb6e00b097cabaea 100644 (file)
@@ -62,8 +62,6 @@ function REGISTER_ADMIN ($user, $md5, $email=WEBMASTER) {
 }
 // Only be executed on login procedure!
 function CHECK_ADMIN_LOGIN ($admin_login, $password) {
 }
 // Only be executed on login procedure!
 function CHECK_ADMIN_LOGIN ($admin_login, $password) {
-       global $cacheArray, $cacheInstance;
-
        // By default no admin is found
        $ret = "404";
 
        // By default no admin is found
        $ret = "404";
 
@@ -74,17 +72,17 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) {
        $data = array('aid' => $aid);
 
        // Is the cache valid?
        $data = array('aid' => $aid);
 
        // Is the cache valid?
-       if (isset($cacheArray['admins']['password'][$aid])) {
+       if (isset($GLOBALS['cache_array']['admins']['password'][$aid])) {
                // Get password from cache
                // Get password from cache
-               $data['password'] = $cacheArray['admins']['password'][$aid];
+               $data['password'] = $GLOBALS['cache_array']['admins']['password'][$aid];
                $ret = "pass";
                incrementConfigEntry('cache_hits');
 
                // Include more admins data?
                if (GET_EXT_VERSION("admins") >= "0.7.0") {
                        // Load them here
                $ret = "pass";
                incrementConfigEntry('cache_hits');
 
                // Include more admins data?
                if (GET_EXT_VERSION("admins") >= "0.7.0") {
                        // Load them here
-                       $data['login_failures'] = $cacheArray['admins']['login_failures'][$aid];
-                       $data['last_failure']   = $cacheArray['admins']['last_failure'][$aid];
+                       $data['login_failures'] = $GLOBALS['cache_array']['admins']['login_failures'][$aid];
+                       $data['last_failure']   = $GLOBALS['cache_array']['admins']['last_failure'][$aid];
                } // END - if
        } elseif (!EXT_IS_ACTIVE("cache")) {
                // Add extra data via filter now
                } // END - if
        } elseif (!EXT_IS_ACTIVE("cache")) {
                // Add extra data via filter now
@@ -187,8 +185,6 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) {
 
 // Try to login the admin by setting some session/cookie variables
 function LOGIN_ADMIN ($adminLogin, $passHash) {
 
 // Try to login the admin by setting some session/cookie variables
 function LOGIN_ADMIN ($adminLogin, $passHash) {
-       global $cacheInstance;
-
        // Reset failure counter on matching admins version
        if ((GET_EXT_VERSION("admins") >= "0.7.0") && ((EXT_VERSION_IS_OLDER("sql_patches", "0.3.6")) || (GET_EXT_VERSION("sql_patches") == ""))) {
                // Reset counter on out-dated sql_patches version
        // Reset failure counter on matching admins version
        if ((GET_EXT_VERSION("admins") >= "0.7.0") && ((EXT_VERSION_IS_OLDER("sql_patches", "0.3.6")) || (GET_EXT_VERSION("sql_patches") == ""))) {
                // Reset counter on out-dated sql_patches version
@@ -215,7 +211,7 @@ function LOGIN_ADMIN ($adminLogin, $passHash) {
 
 // Only be executed on cookie checking
 function CHECK_ADMIN_COOKIES ($admin_login, $password) {
 
 // Only be executed on cookie checking
 function CHECK_ADMIN_COOKIES ($admin_login, $password) {
-       global $cacheArray;
+       // By default no admin cookies are found
        $ret = "404"; $pass = "";
 
        // Get hash
        $ret = "404"; $pass = "";
 
        // Get hash
@@ -236,13 +232,8 @@ function CHECK_ADMIN_COOKIES ($admin_login, $password) {
 
 //
 function ADMIN_DO_ACTION($wht) {
 
 //
 function ADMIN_DO_ACTION($wht) {
-       global $menuDesription, $menuTitle, $cacheArray, $DATA;
-
+       global $menuDesription, $menuTitle, $DATA;
        //* DEBUG: */ echo __LINE__."*".$wht."/".$GLOBALS['module']."/".$GLOBALS['action']."/".$GLOBALS['what']."*<br />\n";
        //* DEBUG: */ echo __LINE__."*".$wht."/".$GLOBALS['module']."/".$GLOBALS['action']."/".$GLOBALS['what']."*<br />\n";
-       if (EXT_IS_ACTIVE("cache")) {
-               // Include cache instance
-               global $cacheInstance;
-       }
 
        // Remove any spaces from variable
        if (empty($wht)) {
 
        // Remove any spaces from variable
        if (empty($wht)) {
@@ -306,7 +297,7 @@ LIMIT 1", array($act, $wht, $wht), __FILE__, __LINE__);
 }
 //
 function ADD_ADMIN_MENU($act, $wht, $return=false) {
 }
 //
 function ADD_ADMIN_MENU($act, $wht, $return=false) {
-       global $menuDesription, $menuTitle, $cacheInstance;
+       global $menuDesription, $menuTitle;
 
        // Init variables
        $SUB = false;
 
        // Init variables
        $SUB = false;
@@ -317,14 +308,14 @@ function ADD_ADMIN_MENU($act, $wht, $return=false) {
        $menuTitle = array();
 
        // Is there a cache instance?
        $menuTitle = array();
 
        // Is there a cache instance?
-       if ((is_object($cacheInstance)) && (getConfig('cache_admin_menu') == "Y")) {
+       if ((is_object($GLOBALS['cache_instance'])) && (getConfig('cache_admin_menu') == "Y")) {
                // Create cache name
                $cacheName = "admin_".$act."_".$wht."_".GET_LANGUAGE()."_".strtolower(get_session('admin_login'));
 
                // Is that cache there?
                // Create cache name
                $cacheName = "admin_".$act."_".$wht."_".GET_LANGUAGE()."_".strtolower(get_session('admin_login'));
 
                // Is that cache there?
-               if ($cacheInstance->loadCacheFile($cacheName)) {
+               if ($GLOBALS['cache_instance']->loadCacheFile($cacheName)) {
                        // Then load it
                        // Then load it
-                       $data = $cacheInstance->getArrayFromCache();
+                       $data = $GLOBALS['cache_instance']->getArrayFromCache();
 
                        // Extract all parts
                        $OUT = base64_decode($data['output'][0]);
 
                        // Extract all parts
                        $OUT = base64_decode($data['output'][0]);
@@ -465,9 +456,9 @@ function ADD_ADMIN_MENU($act, $wht, $return=false) {
        eval($eval);
 
        // Is there a cache instance again?
        eval($eval);
 
        // Is there a cache instance again?
-       if ((is_object($cacheInstance)) && (getConfig('cache_admin_menu') == "Y")) {
+       if ((is_object($GLOBALS['cache_instance'])) && (getConfig('cache_admin_menu') == "Y")) {
                // Init cache
                // Init cache
-               $cacheInstance->init($cacheName);
+               $GLOBALS['cache_instance']->init($cacheName);
 
                // Prepare cache data
                $data = array(
 
                // Prepare cache data
                $data = array(
@@ -477,10 +468,10 @@ function ADD_ADMIN_MENU($act, $wht, $return=false) {
                );
 
                // Write the data away
                );
 
                // Write the data away
-               $cacheInstance->addRow($data);
+               $GLOBALS['cache_instance']->addRow($data);
 
                // Close cache
 
                // Close cache
-               $cacheInstance->finalize();
+               $GLOBALS['cache_instance']->finalize();
        } // END - if
 
        // Return or output content?
        } // END - if
 
        // Return or output content?
@@ -556,8 +547,6 @@ function ADMIN_MENU_SELECTION($MODE, $default="", $defid="") {
 
 // Save settings to the database
 function ADMIN_SAVE_SETTINGS (&$POST, $tableName="_config", $whereStatement="config=0", $translateComma=array(), $alwaysAdd=false) {
 
 // Save settings to the database
 function ADMIN_SAVE_SETTINGS (&$POST, $tableName="_config", $whereStatement="config=0", $translateComma=array(), $alwaysAdd=false) {
-       global $cacheArray, $cacheInstance;
-
        // Prepare all arrays, variables
        $DATA = array();
        $skip = false;
        // Prepare all arrays, variables
        $DATA = array();
        $skip = false;
@@ -707,8 +696,6 @@ function ADMIN_USER_PROFILE_LINK ($uid, $title="", $wht="list_user") {
 
 // Check "logical-area-mode"
 function ADMIN_CHECK_MENU_MODE () {
 
 // Check "logical-area-mode"
 function ADMIN_CHECK_MENU_MODE () {
-       global $cacheArray;
-
        // Set the global mode as the mode for all admins
        $MODE = getConfig('admin_menu');
        $ADMIN = $MODE;
        // Set the global mode as the mode for all admins
        $MODE = getConfig('admin_menu');
        $ADMIN = $MODE;
@@ -717,9 +704,9 @@ function ADMIN_CHECK_MENU_MODE () {
        $aid = GET_CURRENT_ADMIN_ID();
 
        // Check individual settings of current admin
        $aid = GET_CURRENT_ADMIN_ID();
 
        // Check individual settings of current admin
-       if (isset($cacheArray['admins']['la_mode'][$aid])) {
+       if (isset($GLOBALS['cache_array']['admins']['la_mode'][$aid])) {
                // Load from cache
                // Load from cache
-               $ADMIN = $cacheArray['admins']['la_mode'][$aid];
+               $ADMIN = $GLOBALS['cache_array']['admins']['la_mode'][$aid];
                incrementConfigEntry('cache_hits');
        } elseif (GET_EXT_VERSION("admins") >= "0.6.7") {
                // Load from database when version of "admins" is enough
                incrementConfigEntry('cache_hits');
        } elseif (GET_EXT_VERSION("admins") >= "0.6.7") {
                // Load from database when version of "admins" is enough
index a9a81337c8330f4e1f3f7ec590b4301548e72758..d823fd4676e2393291a5e4d31139c963f70a04d8 100644 (file)
@@ -38,8 +38,6 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 }
 
 function OUTPUT_STANDARD_OVERVIEW(&$result_tasks) {
 }
 
 function OUTPUT_STANDARD_OVERVIEW(&$result_tasks) {
-       global $cacheArray;
-
        // First check for solved and not assigned tasks and assign them to current admin
        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET assigned_admin='%s' WHERE assigned_admin < 1 AND status != 'NEW'",
                array(GET_CURRENT_ADMIN_ID()), __FILE__, __LINE__);
        // First check for solved and not assigned tasks and assign them to current admin
        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET assigned_admin='%s' WHERE assigned_admin < 1 AND status != 'NEW'",
                array(GET_CURRENT_ADMIN_ID()), __FILE__, __LINE__);
@@ -84,9 +82,9 @@ function OUTPUT_STANDARD_OVERVIEW(&$result_tasks) {
                                        EXTENSION_UPDATE($ext_name, $ext_ver);
                                } // END - if
 
                                        EXTENSION_UPDATE($ext_name, $ext_ver);
                                } // END - if
 
-                               if (isset($cacheArray['active_extensions'][$ext_name])) {
+                               if (isset($GLOBALS['cache_array']['active_extensions'][$ext_name])) {
                                        // Maybe we want to keept the current extension active?
                                        // Maybe we want to keept the current extension active?
-                                       if (($cacheArray['active_extensions'][$ext_name] == "Y") && (!EXT_IS_ACTIVE($ext_name))) {
+                                       if (($GLOBALS['cache_array']['active_extensions'][$ext_name] == "Y") && (!EXT_IS_ACTIVE($ext_name))) {
                                                // Reactivate this extension!
                                                ACTIVATE_EXTENSION($ext_name);
                                        } // END - if
                                                // Reactivate this extension!
                                                ACTIVATE_EXTENSION($ext_name);
                                        } // END - if
index 5adb87dde1db5a3cbfea40da1400c3a7f118a78d..c1054846cbb493b4d4bdd2b3e0db36e3b8b0fbcf 100644 (file)
@@ -40,8 +40,6 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 // Add description as navigation point
 ADD_DESCR("admin", __FILE__);
 
 // Add description as navigation point
 ADD_DESCR("admin", __FILE__);
 
-global $cacheInstance;
-
 // Display form is default
 $FORM = true;
 
 // Display form is default
 $FORM = true;
 
index 3831184cc64ca3494b6099dc4551aaae76171091..6706d9a016780bfb9a151f2a794fc12bb2e10cf2 100644 (file)
@@ -40,9 +40,6 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 // Add description as navigation point
 ADD_DESCR("admin", __FILE__);
 
 // Add description as navigation point
 ADD_DESCR("admin", __FILE__);
 
-// Instance for the cache extension
-global $cacheInstance;
-
 // Set selection data to empty array when it is empty
 if (empty($_POST['sel'])) $_POST['sel'] = array();
 
 // Set selection data to empty array when it is empty
 if (empty($_POST['sel'])) $_POST['sel'] = array();
 
index 1c56e964699cc64e4933b3d345f8b609abb57b64..04124c3ca15e91cb07283a1e227414df6875d416 100644 (file)
@@ -47,7 +47,7 @@ if (isset($_POST['edit']))
        if ($SEL > 0)
        {
                // Add option for events
        if ($SEL > 0)
        {
                // Add option for events
-               $cacheArray['admins'] = ADD_OPTION_LINES("admins", "id", "login", "", "email");
+               $GLOBALS['cache_array']['admins'] = ADD_OPTION_LINES("admins", "id", "login", "", "email");
                $SW = 2; $rowNameS = "";
                foreach ($_POST['sel'] as $template => $sel) {
                        // First of all load data from DB
                $SW = 2; $rowNameS = "";
                foreach ($_POST['sel'] as $template => $sel) {
                        // First of all load data from DB
@@ -78,7 +78,7 @@ if (isset($_POST['edit']))
                                'id'      => $id,
                                'id2'     => $id2,
                                'tpl'     => $template,
                                'id'      => $id,
                                'id2'     => $id2,
                                'tpl'     => $template,
-                               'admins'  => $cacheArray['admins']
+                               'admins'  => $GLOBALS['cache_array']['admins']
                        );
 
                        if ($aid2 > 0)
                        );
 
                        if ($aid2 > 0)
index 9f1a9fac6a045d212330d533b78619b49c090786..a8957adaf9b81f14d0cd28b167da1b7556819031 100644 (file)
@@ -89,7 +89,7 @@ if ((isset($_POST['edit'])) && ($SEL > 0)) {
 
        // Update cache when installed
        if (EXT_IS_ACTIVE("cache")) {
 
        // Update cache when installed
        if (EXT_IS_ACTIVE("cache")) {
-               if ($cacheInstance->loadCacheFile("admins_acls")) $cacheInstance->destroyCacheFile();
+               if ($GLOBALS['cache_instance']->loadCacheFile("admins_acls")) $GLOBALS['cache_instance']->destroyCacheFile();
 
                // Purge menu cache
                CACHE_PURGE_ADMIN_MENU($_POST['admin'][$id]);
 
                // Purge menu cache
                CACHE_PURGE_ADMIN_MENU($_POST['admin'][$id]);
@@ -144,7 +144,7 @@ if ((isset($_POST['edit'])) && ($SEL > 0)) {
 
        // Update cache when installed
        if (EXT_IS_ACTIVE("cache")) {
 
        // Update cache when installed
        if (EXT_IS_ACTIVE("cache")) {
-               if ($cacheInstance->loadCacheFile("admins_acls")) $cacheInstance->destroyCacheFile();
+               if ($GLOBALS['cache_instance']->loadCacheFile("admins_acls")) $GLOBALS['cache_instance']->destroyCacheFile();
 
                // @TODO This causes the whole (!) menu cache being rebuild
                CACHE_PURGE_ADMIN_MENU();
 
                // @TODO This causes the whole (!) menu cache being rebuild
                CACHE_PURGE_ADMIN_MENU();
@@ -184,7 +184,7 @@ VALUES ('%s','%s','%s','%s')",
 
                                // Update cache when installed
                                if (EXT_IS_ACTIVE("cache")) {
 
                                // Update cache when installed
                                if (EXT_IS_ACTIVE("cache")) {
-                                       if ($cacheInstance->loadCacheFile("admins_acls")) $cacheInstance->destroyCacheFile();
+                                       if ($GLOBALS['cache_instance']->loadCacheFile("admins_acls")) $GLOBALS['cache_instance']->destroyCacheFile();
 
                                        // Purge cache
                                        CACHE_PURGE_ADMIN_MENU($_POST['admin_id'], $_POST['action_menu'], $_POST['what_menu']);
 
                                        // Purge cache
                                        CACHE_PURGE_ADMIN_MENU($_POST['admin_id'], $_POST['action_menu'], $_POST['what_menu']);
index 68e34ed80aea906a2e6e84329c19ce702ba66f6f..6a86a6732550049937c80fc0b63095ff775893a2 100644 (file)
@@ -51,26 +51,26 @@ if (isset($_POST['ok'])) {
        }
 
        // Delete deactivated cache files
        }
 
        // Delete deactivated cache files
-       if (($_POST['cache_admins'] == "N") && ($cacheInstance->loadCacheFile("admins"))) {
-               $cacheInstance->destroyCacheFile();
+       if (($_POST['cache_admins'] == "N") && ($GLOBALS['cache_instance']->loadCacheFile("admins"))) {
+               $GLOBALS['cache_instance']->destroyCacheFile();
        }
        }
-       if (($_POST['cache_acls'] == "N") && ($cacheInstance->loadCacheFile("acls"))) {
-               $cacheInstance->destroyCacheFile();
+       if (($_POST['cache_acls'] == "N") && ($GLOBALS['cache_instance']->loadCacheFile("acls"))) {
+               $GLOBALS['cache_instance']->destroyCacheFile();
        }
        }
-       if (($_POST['cache_exts'] == "N") && ($cacheInstance->loadCacheFile("extensions", true))) {
-               $cacheInstance->destroyCacheFile();
+       if (($_POST['cache_exts'] == "N") && ($GLOBALS['cache_instance']->loadCacheFile("extensions", true))) {
+               $GLOBALS['cache_instance']->destroyCacheFile();
        }
        }
-       if (($_POST['cache_config'] == "N") && ($cacheInstance->loadCacheFile("config"))) {
-               $cacheInstance->destroyCacheFile();
+       if (($_POST['cache_config'] == "N") && ($GLOBALS['cache_instance']->loadCacheFile("config"))) {
+               $GLOBALS['cache_instance']->destroyCacheFile();
        }
        }
-       if (($_POST['cache_modreg'] == "N") && ($cacheInstance->loadCacheFile("modreg"))) {
-               $cacheInstance->destroyCacheFile();
+       if (($_POST['cache_modreg'] == "N") && ($GLOBALS['cache_instance']->loadCacheFile("modreg"))) {
+               $GLOBALS['cache_instance']->destroyCacheFile();
        }
        }
-       if (($_POST['cache_refdepth'] == "N") && ($cacheInstance->loadCacheFile("refdepth"))) {
-               $cacheInstance->destroyCacheFile();
+       if (($_POST['cache_refdepth'] == "N") && ($GLOBALS['cache_instance']->loadCacheFile("refdepth"))) {
+               $GLOBALS['cache_instance']->destroyCacheFile();
        }
        }
-       if (($_POST['cache_refsys'] == "N") && ($cacheInstance->loadCacheFile("refsys"))) {
-               $cacheInstance->destroyCacheFile();
+       if (($_POST['cache_refsys'] == "N") && ($GLOBALS['cache_instance']->loadCacheFile("refsys"))) {
+               $GLOBALS['cache_instance']->destroyCacheFile();
        }
 
        // Save configuration
        }
 
        // Save configuration
index df25c63da7041239c114bab2543fd501a44eab88..2b1c292599a2f1de98680b0afbffb1f7a52c2b4a 100644 (file)
@@ -96,7 +96,7 @@ if (isset($_POST['edit'])) {
 
        // Remove cache file if version matches
        if (GET_EXT_VERSION("cache") >= "0.1.2") {
 
        // Remove cache file if version matches
        if (GET_EXT_VERSION("cache") >= "0.1.2") {
-               if ($cacheInstance->loadCacheFile("mod_reg")) $cacheInstance->destroyCacheFile();
+               if ($GLOBALS['cache_instance']->loadCacheFile("mod_reg")) $GLOBALS['cache_instance']->destroyCacheFile();
        }
 
        // Entries updated
        }
 
        // Entries updated
index 9ea90fab8a83776f6cdc5c53f646f443bbb24d03..524ec68c71c51a9ea69c0f74a9866ddcb81f83f0 100644 (file)
@@ -108,7 +108,7 @@ if (isset($_POST['ok'])) {
 
                // Update cache file
                if (GET_EXT_VERSION("cache") >= "0.1.2") {
 
                // Update cache file
                if (GET_EXT_VERSION("cache") >= "0.1.2") {
-                       if ($cacheInstance->loadCacheFile("refdepths")) $cacheInstance->destroyCacheFile();
+                       if ($GLOBALS['cache_instance']->loadCacheFile("refdepths")) $GLOBALS['cache_instance']->destroyCacheFile();
                }
                break;
 
                }
                break;
 
index 54c37e4dd3205436d3a00a0c2a94fb75bb0f56e1..548d708ade487c736f8f455754c57c095270db3f 100644 (file)
@@ -40,8 +40,6 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 // Add description as navigation point
 ADD_DESCR("admin", __FILE__);
 
 // Add description as navigation point
 ADD_DESCR("admin", __FILE__);
 
-global $cacheInstance, $cacheArray, $cacheMode;
-
 // Normally we want the overview of all registered extensions
 $do = "overview";
 $SEL = 0;
 // Normally we want the overview of all registered extensions
 $do = "overview";
 $SEL = 0;
@@ -55,7 +53,7 @@ if (!empty($_GET['reg_ext'])) {
        // De-/activate extensions
        foreach ($_POST['sel'] as $ext_id => $active) {
                // Shall we keep the extension always active?
        // De-/activate extensions
        foreach ($_POST['sel'] as $ext_id => $active) {
                // Shall we keep the extension always active?
-               if ((isset($cacheArray['active_extensions'][GET_EXT_NAME($ext_id)])) && ($cacheArray['active_extensions'][GET_EXT_NAME($ext_id)] == "Y") && ($active == "N")) {
+               if ((isset($GLOBALS['cache_array']['active_extensions'][GET_EXT_NAME($ext_id)])) && ($GLOBALS['cache_array']['active_extensions'][GET_EXT_NAME($ext_id)] == "Y") && ($active == "N")) {
                        // Keep this extension active!
                } else {
                        // De/activate extension
                        // Keep this extension active!
                } else {
                        // De/activate extension
@@ -125,8 +123,8 @@ if (!empty($_GET['reg_ext'])) {
                                }
 
                                // Output row
                                }
 
                                // Output row
-                               $CSS = "---";
-                               if (GET_EXT_VERSION("sql_patches") >= "0.0.6") $CSS = ADD_SELECTION("yn", $css, "css", $ext_id);
+                               $cssSelection = "---";
+                               if (GET_EXT_VERSION("sql_patches") >= "0.0.6") $cssSelection = ADD_SELECTION("yn", $css, "css", $ext_id);
 
                                // Prepare data for the row template
                                $content = array(
 
                                // Prepare data for the row template
                                $content = array(
@@ -134,7 +132,7 @@ if (!empty($_GET['reg_ext'])) {
                                        'id'     => $ext_id,
                                        'name'   => $name,
                                        'active' => ADD_SELECTION("yn", $active, "active", $ext_id),
                                        'id'     => $ext_id,
                                        'name'   => $name,
                                        'active' => ADD_SELECTION("yn", $active, "active", $ext_id),
-                                       'css'    => $CSS,
+                                       'css'    => $cssSelection,
                                );
 
                                // Load row template and switch color
                                );
 
                                // Load row template and switch color
@@ -239,8 +237,9 @@ ORDER BY ext_name", __FILE__, __LINE__);
                // Extensions are registered
                $SW = 2; $OUT = "";
                while ($content = SQL_FETCHARRAY($result)) {
                // Extensions are registered
                $SW = 2; $OUT = "";
                while ($content = SQL_FETCHARRAY($result)) {
-                       $CSS = "---";
-                       if (GET_EXT_VERSION("sql_patches") >= "0.0.6") $CSS = TRANSLATE_YESNO($content['ext_css']);
+                       // Prepare CSS selection output
+                       $cssSelection = "---";
+                       if (GET_EXT_VERSION("sql_patches") >= "0.0.6") $cssSelection = TRANSLATE_YESNO($content['ext_css']);
 
                        // Prepare data for the row template
                        $content = array(
 
                        // Prepare data for the row template
                        $content = array(
@@ -249,7 +248,7 @@ ORDER BY ext_name", __FILE__, __LINE__);
                                'name'    => $content['ext_name'],
                                'active'  => TRANSLATE_YESNO($content['ext_active']),
                                'act_val' => $content['ext_active'],
                                'name'    => $content['ext_name'],
                                'active'  => TRANSLATE_YESNO($content['ext_active']),
                                'act_val' => $content['ext_active'],
-                               'css'     => $CSS,
+                               'css'     => $cssSelection,
                                'ver'     => $content['ext_version'],
                        );
 
                                'ver'     => $content['ext_version'],
                        );
 
@@ -320,11 +319,11 @@ case "register": // Register new extension
                                        }
 
                                        // Do we need to update cache file?
                                        }
 
                                        // Do we need to update cache file?
-                                       if ((EXT_IS_ACTIVE("cache")) && ($cacheMode != "no")) {
+                                       if ((EXT_IS_ACTIVE("cache")) && ($GLOBALS['cacheMode'] != "no")) {
                                                // Remove cache file (will be auto-created again!)
                                                // Remove cache file (will be auto-created again!)
-                                               if ($cacheInstance->loadCacheFile("config")) $cacheInstance->destroyCacheFile();
-                                               if ($cacheInstance->loadCacheFile("extensions", true)) $cacheInstance->destroyCacheFile();
-                                               if ($cacheInstance->loadCacheFile("mod_reg")) $cacheInstance->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("mod_reg")) $GLOBALS['cache_instance']->destroyCacheFile();
                                        } // END - if
                                } elseif (GET_EXT_VERSION($ext_name) != "") {
                                        // Notify the admin that we have a problem here...
                                        } // END - if
                                } elseif (GET_EXT_VERSION($ext_name) != "") {
                                        // Notify the admin that we have a problem here...
index d402ab529640203e59b1bfa3cddadc8b1506e07d..83cf01f67b35c6e5ddb4546b5c305792b35183a1 100644 (file)
@@ -40,8 +40,6 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 // Add description as navigation point
 ADD_DESCR("admin", __FILE__);
 
 // Add description as navigation point
 ADD_DESCR("admin", __FILE__);
 
-global $cacheInstance, $cacheArray, $cacheMode;
-
 // Normally we want the overview of all registered theme_check
 $mode = "overview";
 $SEL = 0;
 // Normally we want the overview of all registered theme_check
 $mode = "overview";
 $SEL = 0;
index 292eb5befcbc34deb27b0684b55dedff0b90fea5..f73fab7f71dca342914d4c3b03a2ba4d09ab5726 100644 (file)
@@ -40,14 +40,14 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode or no daily reset
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!defined('__DAILY_RESET')) || (getConfig('beg_rallye') != "Y")) return;
+if (($GLOBALS['output_mode'] == 1) || (!defined('__DAILY_RESET')) || (getConfig('beg_rallye') != "Y")) return;
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Get current month (2 digits)
 $curr = date("m", time());
 
 // Check if month is done
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Get current month (2 digits)
 $curr = date("m", time());
 
 // Check if month is done
-if (($curr != getConfig('last_month')) && (getConfig('last_month') > 0) && (getConfig('beg_ranks') > 0) && ($CSS != 1)) {
+if (($curr != getConfig('last_month')) && (getConfig('last_month') > 0) && (getConfig('beg_ranks') > 0) && ($GLOBALS['output_mode'] != 1)) {
        // Extension "autopurge" is inactive or purging of inactive accounts is deactivated
        $whereStatement1 = "";
        $whereStatement2 = bigintval(getConfig('beg_ranks'));
        // Extension "autopurge" is inactive or purging of inactive accounts is deactivated
        $whereStatement1 = "";
        $whereStatement2 = bigintval(getConfig('beg_ranks'));
index d90c75d387780533a12b0463efc635b359b2d173..de78e488c7219697f8157d216938b45da5326fd4 100644 (file)
@@ -40,13 +40,13 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode or no daily reset
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
+if (($GLOBALS['output_mode'] == 1) || (!defined('__DAILY_RESET'))) return;
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Get current month (2 digits)
 $curr = date("m", time());
 
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Get current month (2 digits)
 $curr = date("m", time());
 
-if (($curr != getConfig('last_month')) && (getConfig('bonus_ranks') > 0) && ($CSS != 1)) {
+if (($curr != getConfig('last_month')) && (getConfig('bonus_ranks') > 0) && ($GLOBALS['output_mode'] != 1)) {
        // Extension "autopurge" is inactive or purging of inactive accounts is deactivated
        $whereStatement1 = "WHERE `status`='CONFIRMED'";
        $whereStatement2 = bigintval(getConfig('bonus_ranks'));
        // Extension "autopurge" is inactive or purging of inactive accounts is deactivated
        $whereStatement1 = "WHERE `status`='CONFIRMED'";
        $whereStatement2 = bigintval(getConfig('bonus_ranks'));
index b71659c451c4637292e1c811b74b7ce9880a1275..b640715803ba368de26ba1fdceaafaaa0ee02868 100644 (file)
@@ -40,7 +40,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode or no daily reset
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
+if (($GLOBALS['output_mode'] == 1) || (!defined('__DAILY_RESET'))) return;
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Get current month (2 digits)
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Get current month (2 digits)
index 1a099824b6d3e0734430f2801c6a62c0f2c01db2..826250915b183d12211c25383908374d7e77f5ae 100644 (file)
@@ -40,7 +40,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode or no daily reset
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
+if (($GLOBALS['output_mode'] == 1) || (!defined('__DAILY_RESET'))) return;
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Reset surfbar counter
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Reset surfbar counter
index 23fd43926c133639d01bc736ac5a69797251c457..fdc059a8fb27904640f3cce2499486a0081d2199 100644 (file)
@@ -123,9 +123,8 @@ $_CONFIG = array(
        'last_update' => time()
 );
 
        'last_update' => time()
 );
 
-// Init important $header variable
-global $header;
-$header = 0;
+// Set important header_sent
+$GLOBALS['header_sent'] = 0;
 
 // Init fatal messages
 global $FATAL;
 
 // Init fatal messages
 global $FATAL;
@@ -182,7 +181,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT
                                //* DEBUG: */ die();
 
                                // Get all values
                                //* DEBUG: */ die();
 
                                // Get all values
-                               if (($CSS != 1) && ($CSS != -1)) {
+                               if (($GLOBALS['output_mode'] != 1) && ($GLOBALS['output_mode'] != -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']);
                                        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']);
@@ -197,7 +196,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT
 
                                // Set default 'what' value
                                //* DEBUG: */ OUTPUT_HTML("-".$GLOBALS['module']."/".$GLOBALS['what']."-<br />");
 
                                // Set default 'what' value
                                //* DEBUG: */ OUTPUT_HTML("-".$GLOBALS['module']."/".$GLOBALS['what']."-<br />");
-                               if ((empty($GLOBALS['what'])) && (empty($GLOBALS['action'])) && ($CSS != 1) && ($CSS != -1)) {
+                               if ((empty($GLOBALS['what'])) && (empty($GLOBALS['action'])) && ($GLOBALS['output_mode'] != 1) && ($GLOBALS['output_mode'] != -1)) {
                                        if ($GLOBALS['module'] == "admin") {
                                                // Set 'action' value to 'login' in admin menu
                                                $GLOBALS['action'] = GET_ACTION($GLOBALS['module'], $GLOBALS['what']);
                                        if ($GLOBALS['module'] == "admin") {
                                                // Set 'action' value to 'login' in admin menu
                                                $GLOBALS['action'] = GET_ACTION($GLOBALS['module'], $GLOBALS['what']);
@@ -212,7 +211,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT
                                } // END - if
 
                                // Update sending pool
                                } // END - if
 
                                // Update sending pool
-                               if (($CSS != "1") && ($CSS != "-1")) LOAD_INC_ONCE("inc/pool-update.php"); // Sends out mails in configureable steps
+                               if (($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1")) LOAD_INC_ONCE("inc/pool-update.php"); // Sends out mails in configureable steps
 
                                // Load all active extension including language files when not upgrading.
                                // Check module for testing and count one click
 
                                // Load all active extension including language files when not upgrading.
                                // Check module for testing and count one click
@@ -263,7 +262,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT
        ///////////////////////////////////////////////////
 
        // Set other missing variables
        ///////////////////////////////////////////////////
 
        // Set other missing variables
-       if (!isset($CSS)) $CSS = "0";
+       if (!isset($GLOBALS['output_mode'])) $GLOBALS['output_mode'] = "0";
        $link = false; // No database link by default
 
        // Include required files
        $link = false; // No database link by default
 
        // Include required files
@@ -271,7 +270,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT
        LOAD_INC_ONCE("inc/session.php");
 
        // Check if we are in installation routine
        LOAD_INC_ONCE("inc/session.php");
 
        // Check if we are in installation routine
-       if ((basename($_SERVER['PHP_SELF']) != "install.php") && ($CSS != "1") && ($CSS != -1)) {
+       if ((basename($_SERVER['PHP_SELF']) != "install.php") && ($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != -1)) {
                // Redirect to the installation system
                LOAD_URL("install.php");
        } // END - if
                // Redirect to the installation system
                LOAD_URL("install.php");
        } // END - if
@@ -291,7 +290,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT
        } // END - if
 }
 
        } // END - if
 }
 
-if ((getTotalFatalErrors() > 0) && (isBooleanConstantAndTrue('mxchange_installed')) && (!defined('mxchange_installing')) && ($CSS != "1")) {
+if ((getTotalFatalErrors() > 0) && (isBooleanConstantAndTrue('mxchange_installed')) && (!defined('mxchange_installing')) && ($GLOBALS['output_mode'] != "1")) {
        // One or more fatal error(s) occur during connect...
        LOAD_INC_ONCE("inc/header.php");
        LOAD_INC_ONCE("inc/fatal_errors.php");
        // One or more fatal error(s) occur during connect...
        LOAD_INC_ONCE("inc/header.php");
        LOAD_INC_ONCE("inc/fatal_errors.php");
index 2304e13b9932506d4da3a9bc9ed77ea30fbefadb..db512f6b59950527d42a58bb58efc1688d286809 100644 (file)
@@ -39,8 +39,6 @@ if (!defined('__SECURITY')) {
 
 // Returns the title for given module
 function ADD_MODULE_TITLE ($mod) {
 
 // Returns the title for given module
 function ADD_MODULE_TITLE ($mod) {
-       global $cacheArray;
-
        // Init variables
        $name = "";
        $result = false;
        // Init variables
        $name = "";
        $result = false;
@@ -48,9 +46,9 @@ function ADD_MODULE_TITLE ($mod) {
        // Is the script installed?
        if (isBooleanConstantAndTrue('mxchange_installed')) {
                // Check if cache is valid
        // Is the script installed?
        if (isBooleanConstantAndTrue('mxchange_installed')) {
                // Check if cache is valid
-               if ((GET_EXT_VERSION("cache") >= "0.1.2") && (isset($cacheArray['modules']['module'])) && (in_array($mod, $cacheArray['modules']['module']))) {
+               if ((GET_EXT_VERSION("cache") >= "0.1.2") && (isset($GLOBALS['cache_array']['modules']['module'])) && (in_array($mod, $GLOBALS['cache_array']['modules']['module']))) {
                        // Load from cache
                        // Load from cache
-                       $name = $cacheArray['modules']['title'][$mod];
+                       $name = $GLOBALS['cache_array']['modules']['title'][$mod];
 
                        // Update cache hits
                        incrementConfigEntry('cache_hits');
 
                        // Update cache hits
                        incrementConfigEntry('cache_hits');
@@ -81,9 +79,6 @@ function ADD_MODULE_TITLE ($mod) {
 
 // Check validity of a given module name (no file extension)
 function CHECK_MODULE ($mod) {
 
 // Check validity of a given module name (no file extension)
 function CHECK_MODULE ($mod) {
-       // We need them now here...
-       global $cacheArray, $cacheInstance;
-
        // Filter module name (names with low chars and underlines are fine!)
        $mod = preg_replace("/[^a-z_]/", "", $mod);
 
        // Filter module name (names with low chars and underlines are fine!)
        $mod = preg_replace("/[^a-z_]/", "", $mod);
 
@@ -110,12 +105,12 @@ function CHECK_MODULE ($mod) {
        $locked = "Y"; $hidden = "N"; $admin = "N"; $mem = "N"; $found = false;
        if (GET_EXT_VERSION("cache") >= "0.1.2") {
                // Is the module cached?
        $locked = "Y"; $hidden = "N"; $admin = "N"; $mem = "N"; $found = false;
        if (GET_EXT_VERSION("cache") >= "0.1.2") {
                // Is the module cached?
-               if (isset($cacheArray['modules']['locked'][$mod_chk])) {
+               if (isset($GLOBALS['cache_array']['modules']['locked'][$mod_chk])) {
                        // Check cache
                        // Check cache
-                       $locked = $cacheArray['modules']['locked'][$mod_chk];
-                       $hidden = $cacheArray['modules']['hidden'][$mod_chk];
-                       $admin  = $cacheArray['modules']['admin_only'][$mod_chk];
-                       $mem    = $cacheArray['modules']['mem_only'][$mod_chk];
+                       $locked = $GLOBALS['cache_array']['modules']['locked'][$mod_chk];
+                       $hidden = $GLOBALS['cache_array']['modules']['hidden'][$mod_chk];
+                       $admin  = $GLOBALS['cache_array']['modules']['admin_only'][$mod_chk];
+                       $mem    = $GLOBALS['cache_array']['modules']['mem_only'][$mod_chk];
 
                        // Update cache hits
                        incrementConfigEntry('cache_hits');
 
                        // Update cache hits
                        incrementConfigEntry('cache_hits');
@@ -450,8 +445,6 @@ function ADD_MENU ($MODE, $act, $wht) {
 
 // This patched function will reduce many SELECT queries for the specified or current admin login
 function IS_ADMIN ($admin="") {
 
 // This patched function will reduce many SELECT queries for the specified or current admin login
 function IS_ADMIN ($admin="") {
-       global $cacheArray;
-
        // Init variables
        $ret = false; $passCookie = ""; $valPass = "";
        //* DEBUG: */ echo __LINE__."ADMIN:".$admin."<br />";
        // Init variables
        $ret = false; $passCookie = ""; $valPass = "";
        //* DEBUG: */ echo __LINE__."ADMIN:".$admin."<br />";
@@ -465,19 +458,19 @@ function IS_ADMIN ($admin="") {
        //* DEBUG: */ echo __LINE__."ADMIN:".$admin."/".$passCookie."<br />";
 
        // Search in array for entry
        //* DEBUG: */ echo __LINE__."ADMIN:".$admin."/".$passCookie."<br />";
 
        // Search in array for entry
-       if (isset($cacheArray['admin_hash'])) {
+       if (isset($GLOBALS['cache_array']['admin_hash'])) {
                // Use cached string
                // Use cached string
-               $valPass = $cacheArray['admin_hash'];
-       } elseif ((!empty($passCookie)) && (isset($cacheArray['admins']['password'][$admin])) && (!empty($admin))) {
+               $valPass = $GLOBALS['cache_array']['admin_hash'];
+       } elseif ((!empty($passCookie)) && (isset($GLOBALS['cache_array']['admins']['password'][$admin])) && (!empty($admin))) {
                // Login data is valid or not?
                // Login data is valid or not?
-               $valPass = generatePassString($cacheArray['admins']['password'][$admin]);
+               $valPass = generatePassString($GLOBALS['cache_array']['admins']['password'][$admin]);
 
                // Cache it away
 
                // Cache it away
-               $cacheArray['admin_hash'] = $valPass;
+               $GLOBALS['cache_array']['admin_hash'] = $valPass;
 
                // Count cache hits
                incrementConfigEntry('cache_hits');
 
                // Count cache hits
                incrementConfigEntry('cache_hits');
-       } elseif ((!empty($admin)) && ((!EXT_IS_ACTIVE("cache"))) || (!isset($cacheArray['admins']['password'][$admin]))) {
+       } elseif ((!empty($admin)) && ((!EXT_IS_ACTIVE("cache"))) || (!isset($GLOBALS['cache_array']['admins']['password'][$admin]))) {
                // Search for admin
                $result = SQL_QUERY_ESC("SELECT HIGH_PRIORITY password FROM `{!_MYSQL_PREFIX!}_admins` WHERE login='%s' LIMIT 1",
                        array($admin), __FILE__, __LINE__);
                // Search for admin
                $result = SQL_QUERY_ESC("SELECT HIGH_PRIORITY password FROM `{!_MYSQL_PREFIX!}_admins` WHERE login='%s' LIMIT 1",
                        array($admin), __FILE__, __LINE__);
@@ -489,7 +482,7 @@ function IS_ADMIN ($admin="") {
                        list($passDB) = SQL_FETCHROW($result);
 
                        // Temporary cache it
                        list($passDB) = SQL_FETCHROW($result);
 
                        // Temporary cache it
-                       $cacheArray['admins']['password'][$admin] = $passDB;
+                       $GLOBALS['cache_array']['admins']['password'][$admin] = $passDB;
 
                        // Generate password hash
                        $valPass = generatePassString($passDB);
 
                        // Generate password hash
                        $valPass = generatePassString($passDB);
@@ -587,14 +580,14 @@ function SEARCH_EMAIL_USERTAB ($email) {
 
 // Checks wether the current user is a member
 function IS_MEMBER () {
 
 // Checks wether the current user is a member
 function IS_MEMBER () {
-       global $status, $LAST, $cacheArray;
+       global $status, $LAST;
        if (!is_array($LAST)) $LAST = array();
        $ret = false;
 
        // is the cache entry there?
        if (!is_array($LAST)) $LAST = array();
        $ret = false;
 
        // is the cache entry there?
-       if (isset($cacheArray['is_member'])) {
+       if (isset($GLOBALS['cache_array']['is_member'])) {
                // Then return it
                // Then return it
-               return $cacheArray['is_member'];
+               return $GLOBALS['cache_array']['is_member'];
        } // END - if
 
        // Fix "deleted" cookies first
        } // END - if
 
        // Fix "deleted" cookies first
@@ -643,7 +636,7 @@ function IS_MEMBER () {
        }
 
        // Cache status
        }
 
        // Cache status
-       $cacheArray['is_member'] = $ret;
+       $GLOBALS['cache_array']['is_member'] = $ret;
 
        // Return status
        return $ret;
 
        // Return status
        return $ret;
@@ -651,15 +644,13 @@ function IS_MEMBER () {
 
 // Validate the given menu action
 function VALIDATE_MENU_ACTION ($MODE, $act, $wht, $UPDATE=false) {
 
 // Validate the given menu action
 function VALIDATE_MENU_ACTION ($MODE, $act, $wht, $UPDATE=false) {
-       global $cacheArray;
-
        // Is the cache entry there and we shall not update?
        // Is the cache entry there and we shall not update?
-       if ((isset($cacheArray['action_valid'][$MODE][$act][$wht])) && ($UPDATE === false)) {
+       if ((isset($GLOBALS['cache_array']['action_valid'][$MODE][$act][$wht])) && ($UPDATE === false)) {
                // Count cache hit
                incrementConfigEntry('cache_hits');
 
                // Then use this cache
                // Count cache hit
                incrementConfigEntry('cache_hits');
 
                // Then use this cache
-               return $cacheArray['action_valid'][$MODE][$act][$wht];
+               return $GLOBALS['cache_array']['action_valid'][$MODE][$act][$wht];
        } // END - if
 
        // By default nothing is valid
        } // END - if
 
        // By default nothing is valid
@@ -698,7 +689,7 @@ function VALIDATE_MENU_ACTION ($MODE, $act, $wht, $UPDATE=false) {
        SQL_FREERESULT($result);
 
        // Set cache entry
        SQL_FREERESULT($result);
 
        // Set cache entry
-       $cacheArray['action_valid'][$MODE][$act][$wht] = $ret;
+       $GLOBALS['cache_array']['action_valid'][$MODE][$act][$wht] = $ret;
 
        // Return result
        return $ret;
 
        // Return result
        return $ret;
@@ -1060,18 +1051,16 @@ function GET_TOTAL_DATA ($search, $tableName, $lookFor, $whereStatement="userid"
 }
 // "Getter fro ref level percents
 function GET_REF_LEVEL_PERCENTS ($level) {
 }
 // "Getter fro ref level percents
 function GET_REF_LEVEL_PERCENTS ($level) {
-       global $cacheInstance, $cacheArray;
-
        // Default is zero
        $per = 0;
 
        // Do we have cache?
        // Default is zero
        $per = 0;
 
        // Do we have cache?
-       if ((isset($cacheArray['ref_depths']['level'])) && (EXT_IS_ACTIVE("cache"))) {
+       if ((isset($GLOBALS['cache_array']['ref_depths']['level'])) && (EXT_IS_ACTIVE("cache"))) {
                // First look for level
                // First look for level
-               $key = array_search($level, $cacheArray['ref_depths']['level']);
+               $key = array_search($level, $GLOBALS['cache_array']['ref_depths']['level']);
                if ($key !== false) {
                        // Entry found!
                if ($key !== false) {
                        // Entry found!
-                       $per = $cacheArray['ref_depths']['percents'][$key];
+                       $per = $GLOBALS['cache_array']['ref_depths']['percents'][$key];
 
                        // Count cache hit
                        incrementConfigEntry('cache_hits');
 
                        // Count cache hit
                        incrementConfigEntry('cache_hits');
@@ -1109,7 +1098,7 @@ function GET_REF_LEVEL_PERCENTS ($level) {
  */
 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";
  */
 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, $cacheArray;
+       global $DATA;
 
        // Convert mode to lower-case
        $add_mode = strtolower($add_mode);
 
        // Convert mode to lower-case
        $add_mode = strtolower($add_mode);
@@ -1152,7 +1141,7 @@ function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify=false, $rid
        if (SQL_NUMROWS($result_user) == 1) {
                // This is the user and his ref
                list($ref, $email) = SQL_FETCHROW($result_user);
        if (SQL_NUMROWS($result_user) == 1) {
                // This is the user and his ref
                list($ref, $email) = SQL_FETCHROW($result_user);
-               $cacheArray['add_uid'][$ref] = $uid;
+               $GLOBALS['cache_array']['add_uid'][$ref] = $uid;
 
                // Get percents
                $per = GET_REF_LEVEL_PERCENTS($GLOBALS['ref_level']);
 
                // Get percents
                $per = GET_REF_LEVEL_PERCENTS($GLOBALS['ref_level']);
@@ -1165,10 +1154,10 @@ function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify=false, $rid
                        $ref_points = $points * $per / 100;
 
                        // Pay refback here if level > 0 and in ref-mode
                        $ref_points = $points * $per / 100;
 
                        // Pay refback here if level > 0 and in ref-mode
-                       if ((EXT_IS_ACTIVE("refback")) && ($GLOBALS['ref_level'] > 0) && ($per < 100) && ($add_mode == "ref") && (isset($cacheArray['add_uid'][$uid]))) {
-                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},data={$cacheArray['add_uid'][$uid]},ref_points={$ref_points},depth={$GLOBALS['ref_level']} - BEFORE!<br />\n";
-                               $ref_points = ADD_REFBACK_POINTS($cacheArray['add_uid'][$uid], $uid, $points, $ref_points);
-                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},data={$cacheArray['add_uid'][$uid]},ref_points={$ref_points},depth={$GLOBALS['ref_level']} - AFTER!<br />\n";
+                       if ((EXT_IS_ACTIVE("refback")) && ($GLOBALS['ref_level'] > 0) && ($per < 100) && ($add_mode == "ref") && (isset($GLOBALS['cache_array']['add_uid'][$uid]))) {
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},data={$GLOBALS['cache_array']['add_uid'][$uid]},ref_points={$ref_points},depth={$GLOBALS['ref_level']} - BEFORE!<br />\n";
+                               $ref_points = ADD_REFBACK_POINTS($GLOBALS['cache_array']['add_uid'][$uid], $uid, $points, $ref_points);
+                               //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},data={$GLOBALS['cache_array']['add_uid'][$uid]},ref_points={$ref_points},depth={$GLOBALS['ref_level']} - AFTER!<br />\n";
                        } // END - if
 
                        // Update points...
                        } // END - if
 
                        // Update points...
@@ -1237,22 +1226,20 @@ function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify=false, $rid
 }
 //
 function UPDATE_REF_COUNTER ($uid) {
 }
 //
 function UPDATE_REF_COUNTER ($uid) {
-       global $cacheArray, $cacheInstance;
-
        // Make it sure referal level zero (member him-/herself) is at least selected
        // Make it sure referal level zero (member him-/herself) is at least selected
-       if (empty($cacheArray['ref_level'][$uid])) $cacheArray['ref_level'][$uid] = 1;
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$cacheArray['ref_level'][$uid]}<br />\n";
+       if (empty($GLOBALS['cache_array']['ref_level'][$uid])) $GLOBALS['cache_array']['ref_level'][$uid] = 1;
+       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['ref_level'][$uid]}<br />\n";
 
        // Update counter
        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_refsystem` SET counter=counter+1 WHERE userid=%s AND level='%s' LIMIT 1",
 
        // Update counter
        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_refsystem` SET counter=counter+1 WHERE userid=%s AND level='%s' LIMIT 1",
-               array(bigintval($uid), $cacheArray['ref_level'][$uid]), __FILE__, __LINE__);
+               array(bigintval($uid), $GLOBALS['cache_array']['ref_level'][$uid]), __FILE__, __LINE__);
 
        // When no entry was updated then we have to create it here
        //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):updated=".SQL_AFFECTEDROWS()."<br />\n";
        if (SQL_AFFECTEDROWS() < 1) {
                // First count!
                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_refsystem` (userid, level, counter) VALUES (%s,%s,1)",
 
        // When no entry was updated then we have to create it here
        //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):updated=".SQL_AFFECTEDROWS()."<br />\n";
        if (SQL_AFFECTEDROWS() < 1) {
                // First count!
                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_refsystem` (userid, level, counter) VALUES (%s,%s,1)",
-                       array(bigintval($uid), $cacheArray['ref_level'][$uid]), __FILE__, __LINE__);
+                       array(bigintval($uid), $GLOBALS['cache_array']['ref_level'][$uid]), __FILE__, __LINE__);
                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid}<br />\n";
        } // END - if
 
                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid}<br />\n";
        } // END - if
 
@@ -1271,7 +1258,7 @@ function UPDATE_REF_COUNTER ($uid) {
        if (($ref > 0) && ($ref != $uid)) {
                // Move to next referal level and count his counter one up!
                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ref={$ref} - ADVANCE!<br />\n";
        if (($ref > 0) && ($ref != $uid)) {
                // Move to next referal level and count his counter one up!
                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ref={$ref} - ADVANCE!<br />\n";
-               $cacheArray['ref_level'][$uid]++; UPDATE_REF_COUNTER($ref);
+               $GLOBALS['cache_array']['ref_level'][$uid]++; UPDATE_REF_COUNTER($ref);
        } 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";
        } 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";
@@ -1279,7 +1266,7 @@ function UPDATE_REF_COUNTER ($uid) {
        }
 
        // "Walk" back here
        }
 
        // "Walk" back here
-       $cacheArray['ref_level'][$uid]--;
+       $GLOBALS['cache_array']['ref_level'][$uid]--;
 
        // Handle refback here if extension is installed
        if (EXT_IS_ACTIVE("refback")) {
 
        // Handle refback here if extension is installed
        if (EXT_IS_ACTIVE("refback")) {
@@ -1304,18 +1291,20 @@ function SEND_ADMIN_EMAILS ($subj, $msg) {
 
 // Get ID number from administrator's login name
 function GET_ADMIN_ID ($login) {
 
 // Get ID number from administrator's login name
 function GET_ADMIN_ID ($login) {
-       global $cacheArray;
+       // By default no admin is found
        $ret = "-1";
        $ret = "-1";
-       if (isset($cacheArray['admins']['aid'][$login])) {
-               // Check cache
-               $ret = $cacheArray['admins']['aid'][$login];
+
+       // Check cache
+       if (isset($GLOBALS['cache_array']['admins']['aid'][$login])) {
+               // Use it if found to save SQL queries
+               $ret = $GLOBALS['cache_array']['admins']['aid'][$login];
 
                // Update cache hits
                incrementConfigEntry('cache_hits');
        } elseif (!EXT_IS_ACTIVE("cache")) {
                // Load from database
                $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admins` WHERE login='%s' LIMIT 1",
 
                // Update cache hits
                incrementConfigEntry('cache_hits');
        } elseif (!EXT_IS_ACTIVE("cache")) {
                // Load from database
                $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admins` WHERE login='%s' LIMIT 1",
-                array($login), __FILE__, __LINE__);
+                       array($login), __FILE__, __LINE__);
                if (SQL_NUMROWS($result) == 1) {
                        list($ret) = SQL_FETCHROW($result);
                } // END - if
                if (SQL_NUMROWS($result) == 1) {
                        list($ret) = SQL_FETCHROW($result);
                } // END - if
@@ -1340,11 +1329,12 @@ function GET_CURRENT_ADMIN_ID () {
 
 // Get password hash from administrator's login name
 function GET_ADMIN_HASH ($aid) {
 
 // Get password hash from administrator's login name
 function GET_ADMIN_HASH ($aid) {
-       global $cacheArray;
+       // By default an invalid hash is returned
        $ret = "-1";
        $ret = "-1";
-       if (isset($cacheArray['admins']['password'][$aid])) {
+
+       if (isset($GLOBALS['cache_array']['admins']['password'][$aid])) {
                // Check cache
                // Check cache
-               $ret = $cacheArray['admins']['password'][$aid];
+               $ret = $GLOBALS['cache_array']['admins']['password'][$aid];
 
                // Update cache hits
                incrementConfigEntry('cache_hits');
 
                // Update cache hits
                incrementConfigEntry('cache_hits');
@@ -1357,7 +1347,7 @@ function GET_ADMIN_HASH ($aid) {
                        list($ret) = SQL_FETCHROW($result);
 
                        // Set cache
                        list($ret) = SQL_FETCHROW($result);
 
                        // Set cache
-                       $cacheArray['admins']['password'][$aid] = $ret;
+                       $GLOBALS['cache_array']['admins']['password'][$aid] = $ret;
                }
 
                // Free result
                }
 
                // Free result
@@ -1367,11 +1357,12 @@ function GET_ADMIN_HASH ($aid) {
 }
 //
 function GET_ADMIN_LOGIN ($aid) {
 }
 //
 function GET_ADMIN_LOGIN ($aid) {
-       global $cacheArray;
+       // By default a non-existent login is returned (other functions react on this!)
        $ret = "***";
        $ret = "***";
-       if (isset($cacheArray['admins']['login'][$aid])) {
+
+       if (isset($GLOBALS['cache_array']['admins']['login'][$aid])) {
                // Get cache
                // Get cache
-               $ret = $cacheArray['admins']['login'][$aid];
+               $ret = $GLOBALS['cache_array']['admins']['login'][$aid];
 
                // Update cache hits
                incrementConfigEntry('cache_hits');
 
                // Update cache hits
                incrementConfigEntry('cache_hits');
@@ -1384,7 +1375,7 @@ function GET_ADMIN_LOGIN ($aid) {
                        list($ret) = SQL_FETCHROW($result);
 
                        // Set cache
                        list($ret) = SQL_FETCHROW($result);
 
                        // Set cache
-                       $cacheArray['admins']['login'][$aid] = $ret;
+                       $GLOBALS['cache_array']['admins']['login'][$aid] = $ret;
                } // END - if
 
                // Free memory
                } // END - if
 
                // Free memory
@@ -1394,12 +1385,12 @@ function GET_ADMIN_LOGIN ($aid) {
 }
 // Get email address of admin id
 function GET_ADMIN_EMAIL ($aid) {
 }
 // Get email address of admin id
 function GET_ADMIN_EMAIL ($aid) {
-       global $cacheArray;
-
+       // By default an invalid emails is returned
        $ret = "***";
        $ret = "***";
-       if (isset($cacheArray['admins']['email'][$aid])) {
+
+       if (isset($GLOBALS['cache_array']['admins']['email'][$aid])) {
                // Get cache
                // Get cache
-               $ret = $cacheArray['admins']['email'][$aid];
+               $ret = $GLOBALS['cache_array']['admins']['email'][$aid];
 
                // Update cache hits
                incrementConfigEntry('cache_hits');
 
                // Update cache hits
                incrementConfigEntry('cache_hits');
@@ -1412,7 +1403,7 @@ function GET_ADMIN_EMAIL ($aid) {
                        list($ret) = SQL_FETCHROW($result_aid);
 
                        // Set cache
                        list($ret) = SQL_FETCHROW($result_aid);
 
                        // Set cache
-                       $cacheArray['admins']['email'][$aid] = $ret;
+                       $GLOBALS['cache_array']['admins']['email'][$aid] = $ret;
                        } // END - if
 
                // Free result
                        } // END - if
 
                // Free result
@@ -1424,12 +1415,12 @@ function GET_ADMIN_EMAIL ($aid) {
 }
 // Get default ACL  of admin id
 function GET_ADMIN_DEFAULT_ACL ($aid) {
 }
 // Get default ACL  of admin id
 function GET_ADMIN_DEFAULT_ACL ($aid) {
-       global $cacheArray;
-
+       // By default an invalid ACL value is returned
        $ret = "***";
        $ret = "***";
-       if (isset($cacheArray['admins']['def_acl'][$aid])) {
+
+       if (isset($GLOBALS['cache_array']['admins']['def_acl'][$aid])) {
                // Use cache
                // Use cache
-               $ret = $cacheArray['admins']['def_acl'][$aid];
+               $ret = $GLOBALS['cache_array']['admins']['def_acl'][$aid];
 
                // Update cache hits
                incrementConfigEntry('cache_hits');
 
                // Update cache hits
                incrementConfigEntry('cache_hits');
@@ -1442,7 +1433,7 @@ function GET_ADMIN_DEFAULT_ACL ($aid) {
                        list($ret) = SQL_FETCHROW($result_aid);
 
                        // Set cache
                        list($ret) = SQL_FETCHROW($result_aid);
 
                        // Set cache
-                       $cacheArray['admins']['def_acl'][$aid] = $ret;
+                       $GLOBALS['cache_array']['admins']['def_acl'][$aid] = $ret;
                }
 
                // Free result
                }
 
                // Free result
@@ -1618,14 +1609,13 @@ function IS_DEMO () {
 }
 //
 function LOAD_CONFIG ($no="0") {
 }
 //
 function LOAD_CONFIG ($no="0") {
-       global $cacheArray;
        $CFG_DUMMY = array();
 
        // Check for cache extension, cache-array and if the requested configuration is in cache
        $CFG_DUMMY = array();
 
        // Check for cache extension, cache-array and if the requested configuration is in cache
-       if ((is_array($cacheArray)) && (isset($cacheArray['config'][$no])) && (is_array($cacheArray['config'][$no]))) {
+       if ((is_array($GLOBALS['cache_array'])) && (isset($GLOBALS['cache_array']['config'][$no])) && (is_array($GLOBALS['cache_array']['config'][$no]))) {
                // Load config from cache
                // Load config from cache
-               //* DEBUG: */ echo gettype($cacheArray['config'][$no])."<br />\n";
-               foreach ($cacheArray['config'][$no] as $key => $value) {
+               //* DEBUG: */ echo gettype($GLOBALS['cache_array']['config'][$no])."<br />\n";
+               foreach ($GLOBALS['cache_array']['config'][$no] as $key => $value) {
                        $CFG_DUMMY[$key] = $value;
                } // END - foreach
 
                        $CFG_DUMMY[$key] = $value;
                } // END - foreach
 
@@ -1633,7 +1623,7 @@ function LOAD_CONFIG ($no="0") {
                if ((isset($CFG_DUMMY['cache_hits'])) && (EXT_IS_ACTIVE("cache"))) {
                        $CFG_DUMMY['cache_hits']++;
                } // END - if
                if ((isset($CFG_DUMMY['cache_hits'])) && (EXT_IS_ACTIVE("cache"))) {
                        $CFG_DUMMY['cache_hits']++;
                } // END - if
-       } elseif ((!EXT_IS_ACTIVE("cache")) || (!isset($cacheArray['config'][$no]))) {
+       } elseif ((!EXT_IS_ACTIVE("cache")) || (!isset($GLOBALS['cache_array']['config'][$no]))) {
                // Load config from DB
                $result_config = SQL_QUERY_ESC("SELECT * FROM `{!_MYSQL_PREFIX!}_config` WHERE config=%d LIMIT 1",
                        array(bigintval($no)), __FILE__, __LINE__);
                // Load config from DB
                $result_config = SQL_QUERY_ESC("SELECT * FROM `{!_MYSQL_PREFIX!}_config` WHERE config=%d LIMIT 1",
                        array(bigintval($no)), __FILE__, __LINE__);
@@ -1645,7 +1635,7 @@ function LOAD_CONFIG ($no="0") {
                SQL_FREERESULT($result_config);
 
                // Remember this config in the array
                SQL_FREERESULT($result_config);
 
                // Remember this config in the array
-               $cacheArray['config'][$no] = $CFG_DUMMY;
+               $GLOBALS['cache_array']['config'][$no] = $CFG_DUMMY;
        }
 
        // Return config array
        }
 
        // Return config array
@@ -1697,10 +1687,8 @@ function SUB_POINTS ($subject, $uid, $points) {
 
 // Update config entries
 function UPDATE_CONFIG ($entries, $values, $updateMode="") {
 
 // Update config entries
 function UPDATE_CONFIG ($entries, $values, $updateMode="") {
-       global $CSS;
-
        // Do not update config in CSS mode
        // Do not update config in CSS mode
-       if (($CSS == "1") || ($CSS == -1)) {
+       if (($GLOBALS['output_mode'] == "1") || ($GLOBALS['output_mode'] == -1)) {
                return;
        } // END - if
 
                return;
        } // END - if
 
index 4413658faae072e962d6eaae7395d0f2d8598090..2f18ab954ec8b0ea71ff8c5c16b31b3a3050acd8 100644 (file)
@@ -40,7 +40,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode or no daily reset
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!defined('__DAILY_RESET')) || (getConfig('beg_rallye') == "Y")) return;
+if (($GLOBALS['output_mode'] == 1) || (!defined('__DAILY_RESET')) || (getConfig('beg_rallye') == "Y")) return;
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Reset accounts
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Reset accounts
index 58e1e19f0d71727b415d69fa0f95bcc891f6b773..0942e4b506827a55e6c5fc4d6b01751fb972544a 100644 (file)
@@ -40,7 +40,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode or no daily reset
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
+if (($GLOBALS['output_mode'] == 1) || (!defined('__DAILY_RESET'))) return;
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Purge expired entries in _bonus_turbo
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Purge expired entries in _bonus_turbo
index 153862788311b2587765fd8aefd73d6281e54d66..4862ed3d16abd20562d4ebd9db5f53be6395cf2e 100644 (file)
@@ -40,7 +40,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode or no daily reset
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
+if (($GLOBALS['output_mode'] == 1) || (!defined('__DAILY_RESET'))) return;
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Update user profiles
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Update user profiles
index fa5248df197119fc0f1efd08edc063618aa27def..f606f1dad1bca19485a246f28de0afdb9b08f1e6 100644 (file)
@@ -40,7 +40,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode or no daily reset
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
+if (($GLOBALS['output_mode'] == 1) || (!defined('__DAILY_RESET'))) return;
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 //
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 //
index ec2db88bd8e097f861d2592869dfd7a68aa40531..bd197bfabbbdeefd5a486c70b3b75fe01884b70b 100644 (file)
@@ -40,7 +40,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode or no daily reset
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || ((!defined('__DAILY_RESET')) && (getConfig('holiday_mode') == "RESET"))) return;
+if (($GLOBALS['output_mode'] == 1) || ((!defined('__DAILY_RESET')) && (getConfig('holiday_mode') == "RESET"))) return;
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Check for holidays we need to enable and send email to user
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Check for holidays we need to enable and send email to user
index dcd49ba3a1c75d5c272a17ac3966c4af2e47002f..fc73f486c36762a17be662088c5470930269f60a 100644 (file)
@@ -40,7 +40,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode or no daily reset
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
+if (($GLOBALS['output_mode'] == 1) || (!defined('__DAILY_RESET'))) return;
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Reset surfbar counter
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Reset surfbar counter
index 62afb533184e2fb927b0dafff7d5ad1183906d1c..a63aa1d0e364a615a2cca50be1451a82079322c4 100644 (file)
@@ -40,7 +40,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode or no daily reset
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
+if (($GLOBALS['output_mode'] == 1) || (!defined('__DAILY_RESET'))) return;
 
 // Simply reset the requests here
 UPDATE_CONFIG("yoomedia_requests_remain", getConfig('yoomedia_requests_total'));
 
 // Simply reset the requests here
 UPDATE_CONFIG("yoomedia_requests_remain", getConfig('yoomedia_requests_total'));
index 8c62a7b7b7a37afaf166945aa196a5436a85ada6..e9aa80ca4525b58d80d5e11511ebb8705df3a9dc 100644 (file)
@@ -49,7 +49,7 @@ if ((basename($_SERVER['PHP_SELF']) == "install.php") || (!isBooleanConstantAndT
 if (!isConfigEntrySet('css_php')) setConfigEntry('css_php', "FILE");
 
 // Output CSS files or content or link to css.php ?
 if (!isConfigEntrySet('css_php')) setConfigEntry('css_php', "FILE");
 
 // Output CSS files or content or link to css.php ?
-if (($CSS == "1") || (getConfig('css_php') == "DIRECT")) {
+if (($GLOBALS['output_mode'] == "1") || (getConfig('css_php') == "DIRECT")) {
        // Load CSS files
        if (is_array($EXT_CSS_FILES)) {
                // Load extension's CSS files
        // Load CSS files
        if (is_array($EXT_CSS_FILES)) {
                // Load extension's CSS files
index 098df63e95b3643c941792e2f065904397117b31..af40c37c9c8bb70d291c46b87888a964460b0835 100644 (file)
@@ -40,7 +40,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode or no daily reset
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
+if (($GLOBALS['output_mode'] == 1) || (!defined('__DAILY_RESET'))) return;
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Reset the surfbar counter
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Reset the surfbar counter
index f52f5fb2de9d581acf5d6b1d38ac00fbe22ec7bd..e9264b7bcc4f6e21d2b76eb78557aba8e0b9366c 100644 (file)
--- a/index.php
+++ b/index.php
@@ -40,7 +40,7 @@ global $what, $action;
 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 
 // Set "CSS-Mode"
 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 
 // Set "CSS-Mode"
-$CSS = "0";
+$GLOBALS['output_mode'] = "0";
 
 // Set module
 $GLOBALS['module'] = "index";
 
 // Set module
 $GLOBALS['module'] = "index";
index 04f02e86ba7bc47022897983619c0ebc80cd915a..8cab9a1ce16915349606996ecd227006aa5da2d1 100644 (file)
@@ -53,7 +53,7 @@ $GLOBALS['what']   = "";
 $GLOBALS['action'] = "";
 
 // Set CSS variable for "normal mode"
 $GLOBALS['action'] = "";
 
 // Set CSS variable for "normal mode"
-$CSS = 0;
+$GLOBALS['output_mode'] = 0;
 
 // Set module
 $GLOBALS['module'] = "install";
 
 // Set module
 $GLOBALS['module'] = "install";
diff --git a/js.php b/js.php
index d108cd75bf40c27aa8c4539d1cfd475fdd6f9bfc..9ef588d72b62378a88d4f7c81ad9d8cb790a125e 100644 (file)
--- a/js.php
+++ b/js.php
@@ -49,7 +49,7 @@ $GLOBALS['action'] = "";
 // pattern is given...
 //
 // But mxchange 0.3.0 will show that in better way! :D :D :D
 // pattern is given...
 //
 // But mxchange 0.3.0 will show that in better way! :D :D :D
-$CSS = "1"; $GLOBALS['module'] = "js";
+$GLOBALS['output_mode'] = "1"; $GLOBALS['module'] = "js";
 
 // Load the required file(s)
 require("inc/config.php");
 
 // Load the required file(s)
 require("inc/config.php");
index 1214fec931112e559a7dd993d2e23fb053ac492b..1e03ef8159317fb6424659f87b8dbed1db83cf8e 100644 (file)
@@ -43,7 +43,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $GLOBALS['module'] = "lead-confirm";
 
 // Set "CSS-Mode"
 $GLOBALS['module'] = "lead-confirm";
 
 // Set "CSS-Mode"
-$CSS = "0";
+$GLOBALS['output_mode'] = "0";
 
 // Load config.php
 require("inc/config.php");
 
 // Load config.php
 require("inc/config.php");
index afeee167604d1b7e90bf42148d4196547f356f8a..31c3fdb11aa2c197d8791fd00aa8e1cb8ce7f3c5 100644 (file)
--- a/login.php
+++ b/login.php
@@ -42,7 +42,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $GLOBALS['module'] = "login";
 
 // Set "CSS-Mode"
 $GLOBALS['module'] = "login";
 
 // Set "CSS-Mode"
-$CSS = "0";
+$GLOBALS['output_mode'] = "0";
 
 // Load the required file(s)
 require("inc/config.php");
 
 // Load the required file(s)
 require("inc/config.php");
index 91801e67bc13efe975da48acdcce4a9f51626955..4371aad6f9894212fa09b79777fdb2f2d4146867 100644 (file)
@@ -39,7 +39,7 @@ global $what, $action;
 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 
 // Tell everyone we are in this module
 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 
 // Tell everyone we are in this module
-$GLOBALS['module'] = "mailid"; $CSS = -1;
+$GLOBALS['module'] = "mailid"; $GLOBALS['output_mode'] = -1;
 
 // Load the required file(s)
 require("inc/config.php");
 
 // Load the required file(s)
 require("inc/config.php");
index 71983620c52892289f18ed8e81b6ee6b1754a5b5..42c81598e86fbb4d2d32e98b3a13432e6ef50e70 100644 (file)
@@ -39,7 +39,7 @@ global $what, $action;
 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 
 // Tell everyone we are in this module
 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 
 // Tell everyone we are in this module
-$GLOBALS['module'] = "mailid";  $CSS = 0;
+$GLOBALS['module'] = "mailid";  $GLOBALS['output_mode'] = 0;
 
 // Load the required file(s)
 require("inc/config.php");
 
 // Load the required file(s)
 require("inc/config.php");
index 15e4cf4d18b78c19acc7beca439f594660485124..cdb5daf0b8b29fc4790734598132132cd87a3129 100644 (file)
@@ -40,7 +40,7 @@ require("inc/libs/security_functions.php");
 // Init "action" and "what"
 global $what, $action, $startTime;
 $GLOBALS['startTime'] = microtime(true);
 // Init "action" and "what"
 global $what, $action, $startTime;
 $GLOBALS['startTime'] = microtime(true);
-$CSS = 0;
+$GLOBALS['output_mode'] = 0;
 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $GLOBALS['userid'] = 0;
 
 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $GLOBALS['userid'] = 0;
 
diff --git a/ref.php b/ref.php
index c83f596ccb619c1e946708f3b1264d4abf8e0a0b..a9dc0ecc22d85c9b3d0fa635075b70b518d6310f 100644 (file)
--- a/ref.php
+++ b/ref.php
@@ -39,7 +39,7 @@ global $what, $action;
 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 
 // Set module
 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 
 // Set module
-$GLOBALS['module'] = "ref"; $CSS = -1;
+$GLOBALS['module'] = "ref"; $GLOBALS['output_mode'] = -1;
 
 // Load the required file(s)
 require("inc/config.php");
 
 // Load the required file(s)
 require("inc/config.php");
index a686d061f4bbd4f94e340cce266b02a32fcdb3ed..eb0060fa43f69b5ea88df499cafd8bde730f0159 100644 (file)
@@ -41,7 +41,7 @@ $GLOBALS['what'] = "";
 $GLOBALS['action'] = "";
 
 // Set this because we have no module in URI
 $GLOBALS['action'] = "";
 
 // Set this because we have no module in URI
-$GLOBALS['module'] = "show_bonus"; $CSS = 0;
+$GLOBALS['module'] = "show_bonus"; $GLOBALS['output_mode'] = 0;
 
 // Load the required file(s)
 require("inc/config.php");
 
 // Load the required file(s)
 require("inc/config.php");
index 32fbdd51953852d6c3780b4c109c3ae6401e2fe5..9ad343c377e703e1a588f455a01efed8f6ef90b6 100644 (file)
@@ -41,7 +41,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $GLOBALS['module'] = "sponsor_confirm";
 
 // Set "CSS-Mode"
 $GLOBALS['module'] = "sponsor_confirm";
 
 // Set "CSS-Mode"
-$CSS = "0";
+$GLOBALS['output_mode'] = "0";
 
 // Load the required file(s)
 require("inc/config.php");
 
 // Load the required file(s)
 require("inc/config.php");
index ba8819687e80c882f3f3c1b7f59dc932b1b76f18..a764d2236d97a490e7fbf8f3fdff974d4cfa803b 100644 (file)
@@ -41,7 +41,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $GLOBALS['module'] = "sponsor_ref";
 
 // Set "CSS-Mode"
 $GLOBALS['module'] = "sponsor_ref";
 
 // Set "CSS-Mode"
-$CSS = "0";
+$GLOBALS['output_mode'] = "0";
 
 // Load the required file(s)
 require("inc/config.php");
 
 // Load the required file(s)
 require("inc/config.php");
index c45aff14d3c416916ca344929ee2515edd0e5230..80e96057aa6887a3cea03f72000d4218f1d01497 100644 (file)
@@ -43,7 +43,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 // Set module
 $GLOBALS['module'] = "surfbar";
 $GLOBALS['refid']  = 0;
 // Set module
 $GLOBALS['module'] = "surfbar";
 $GLOBALS['refid']  = 0;
-$CSS = 0;
+$GLOBALS['output_mode'] = 0;
 $msg = null;
 
 // Load the required file(s)
 $msg = null;
 
 // Load the required file(s)
@@ -141,7 +141,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                }
 
                // All done, so fix notice for footer.php
                }
 
                // All done, so fix notice for footer.php
-               $footer = 1;
+               $GLOBALS['footer_sent'] = 1;
        } else {
                // Prepare content
                $content = "";
        } else {
                // Prepare content
                $content = "";
index 262227e7a52328595574bd7ddd8991da60b2c391..7c311fac6ffbb285986028ccae50ba84f15946c3 100644 (file)
--- a/view.php
+++ b/view.php
@@ -39,7 +39,7 @@ global $what, $action;
 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 
 // Set module
 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 
 // Set module
-$GLOBALS['module'] = "view"; $CSS = -1;
+$GLOBALS['module'] = "view"; $GLOBALS['output_mode'] = -1;
 
 // Load the required file(s)
 require("inc/config.php");
 
 // Load the required file(s)
 require("inc/config.php");