// Get version from name
function THEME_GET_VERSION ($name) {
- global $cacheArray;
-
// Is the extension "theme" installed?
if (!EXT_IS_ACTIVE("theme")) {
// Then abort here
$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
- $cver = $cacheArray['themes']['theme_ver'][$name];
+ $cver = $GLOBALS['cache_array']['themes']['theme_ver'][$name];
// Count up
incrementConfigEntry('cache_hits');
// 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
$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
- $active = ($cacheArray['themes']['theme_active'][$name] == "Y");
+ $active = ($GLOBALS['cache_array']['themes']['theme_active'][$name] == "Y");
// Count up
incrementConfigEntry('cache_hits');
// 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
$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
- $name = $cacheArray['themes']['theme_name'][$name];
+ $name = $GLOBALS['cache_array']['themes']['theme_name'][$name];
// Count up
incrementConfigEntry('cache_hits');
}
// Initialize variables
-$currTheme = GET_CURR_THEME();
+$GLOBALS['curr_theme'] = GET_CURR_THEME();
// Check if new theme is selcted
-if ((!empty($_POST['new_theme'])) && ($_POST['new_theme'] != $currTheme)) {
+if ((!empty($_POST['new_theme'])) && ($_POST['new_theme'] != $GLOBALS['curr_theme'])) {
// Set new theme for guests
$newTheme = $_POST['new_theme'];
set_session('mxchange_theme', $newTheme);
// Remove current from array and set new
- $theme = sprintf("%stheme/%s/theme.php", constant('PATH'), $currTheme);
+ $theme = sprintf("%stheme/%s/theme.php", constant('PATH'), $GLOBALS['curr_theme']);
unset($INC_POOL[array_search($theme, $INC_POOL)]);
$INC_POOL[] = sprintf("%stheme/%s/theme.php", constant('PATH'), $newTheme);
} // END - if