define('SERVER_URL', "http://www.mxchange.org");
// Current SVN revision
-define('CURR_SVN_REVISION', "676");
+define('CURR_SVN_REVISION', "677");
// Take a prime number which is long (if you know a longer one please try it out!)
define('_PRIME', 591623);
return $return;
}
+// Get current theme name
+function GET_CURR_THEME() {
+ global $INC_POOL, $_CONFIG, $CSS, $cacheArray;
+
+ // The default theme is 'default'... ;-)
+ $ret = "default";
+
+ // Load default theme if not empty from configuration
+ if (getConfig('default_theme') != "") $ret = getConfig('default_theme');
+
+ if (!isSessionVariableSet('mxchange_theme')) {
+ // 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>");
+ // Get theme from cookie
+ $ret = get_session('mxchange_theme');
+
+ // Is it valid?
+ if (THEME_GET_ID($ret) == 0) {
+ // Fix it to default
+ $ret = "default";
+ } // END - if
+ } elseif ((!isBooleanConstantAndTrue('mxchange_installed')) && ((isBooleanConstantAndTrue('mxchange_installing')) || ($CSS == true)) && ((!empty($_GET['theme'])) || (!empty($_POST['theme'])))) {
+ // Prepare FQFN for checking
+ $theme = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($_GET['theme']));
+
+ // Installation mode active
+ if ((!empty($_GET['theme'])) && (FILE_READABLE($theme))) {
+ // Set cookie from URL data
+ set_session("mxchange_theme", SQL_ESCAPE($_GET['theme']));
+ } elseif (FILE_READABLE(sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($_POST['theme'])))) {
+ // Set cookie from posted data
+ set_session("mxchange_theme", SQL_ESCAPE($_POST['theme']));
+ }
+
+ // Set return value
+ $ret = get_session('mxchange_theme');
+ } else {
+ // Invalid design, reset cookie
+ set_session("mxchange_theme", $ret);
+ }
+
+ // Add (maybe) found theme.php file to inclusion list
+ $theme = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($ret));
+
+ // Try to load the requested include file
+ if (FILE_READABLE($theme)) $INC_POOL[] = $theme;
+
+ // Return theme value
+ return $ret;
+}
+
+// Get id from theme
+function THEME_GET_ID ($name) {
+ global $cacheArray, $_CONFIG;
+
+ // Is the extension "theme" installed?
+ if (!EXT_IS_ACTIVE("theme")) {
+ // Then abort here
+ return 0;
+ } // END - if
+
+ // Default id
+ $id = 0;
+
+ // Is the cache entry there?
+ if (isset($cacheArray['themes']['id'][$name])) {
+ // Get the version from cache
+ $id = $cacheArray['themes']['id'][$name];
+
+ // Count up
+ if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+ } elseif (GET_EXT_VERSION("cache") != "0.1.8") {
+ // Check if current theme is already imported or not
+ $result = SQL_QUERY_ESC("SELECT id FROM `"._MYSQL_PREFIX."_themes` WHERE theme_path='%s' LIMIT 1",
+ array($name), __FILE__, __LINE__);
+
+ // Entry found?
+ if (SQL_NUMROWS($result) == 1) {
+ // Fetch data
+ list($id) = SQL_FETCHROW($result);
+ } // END - if
+
+ // Free result
+ SQL_FREERESULT($result);
+ }
+
+ // Return id
+ return $id;
+}
+
//////////////////////////////////////////////////
// //
// AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS //
define('ADMIN_BUILD_STATUS_HANDLER', "Status-Handler");
define('TASK_SUBJ_EXTENSION_DEACTIVATED', "Erweiterung deaktiviert");
define('ADMIN_SUBJECT_EXTENSION_DEACTIVATED', "Automatische Deaktivierung einer Erweiterung");
-define('FATAL_EXTENSION_LOADED', "Erweiterung <u>%s/u> bereits geladen!");
+define('FATAL_EXTENSION_LOADED', "Erweiterung <u>%s</u> bereits geladen!");
define('ADMIN_ACCESS_DENIED', "Zugriff auf diesen Adminmenüpunkt nicht gestattet.");
define('ADMIN_URL_BLACKLIST_DISABLED', "URL-Sperrliste ist deaktiviert.");
require($INC);
}
-// Always make sure the session management is initialized first
-require_once(PATH."inc/session.php");
-
-// Dirty fix for dublicate function
-if (!function_exists('GET_CURR_THEME')) {
-// Get current theme name
-function GET_CURR_THEME() {
- global $INC_POOL, $_CONFIG, $CSS, $cacheArray;
-
- // The default theme is 'default'... ;-)
- $ret = "default";
-
- // Load default theme if not empty from configuration
- if (getConfig('default_theme') != "") $ret = getConfig('default_theme');
-
- if (!isSessionVariableSet('mxchange_theme')) {
- // 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>");
- // Get theme from cookie
- $ret = get_session('mxchange_theme');
-
- // Is it valid?
- if (THEME_GET_ID($ret) == 0) {
- // Fix it to default
- $ret = "default";
- } // END - if
- } elseif ((!isBooleanConstantAndTrue('mxchange_installed')) && ((isBooleanConstantAndTrue('mxchange_installing')) || ($CSS == true)) && ((!empty($_GET['theme'])) || (!empty($_POST['theme'])))) {
- // Prepare FQFN for checking
- $theme = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($_GET['theme']));
-
- // Installation mode active
- if ((!empty($_GET['theme'])) && (FILE_READABLE($theme))) {
- // Set cookie from URL data
- set_session("mxchange_theme", SQL_ESCAPE($_GET['theme']));
- } elseif (FILE_READABLE(sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($_POST['theme'])))) {
- // Set cookie from posted data
- set_session("mxchange_theme", SQL_ESCAPE($_POST['theme']));
- }
-
- // Set return value
- $ret = get_session('mxchange_theme');
- } else {
- // Invalid design, reset cookie
- set_session("mxchange_theme", $ret);
- }
-
- // Add (maybe) found theme.php file to inclusion list
- $theme = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($ret));
-
- // Try to load the requested include file
- if (FILE_READABLE($theme)) $INC_POOL[] = $theme;
-
- // Return theme value
- return $ret;
-}
-} // END - if
-
function THEME_SELECTION_BOX($mod, $act, $wht, $result) {
// Construction URL
$FORM = URL."/modules.php?module=".$mod;
return $cver;
}
-// Get id from theme
-function THEME_GET_ID ($name) {
- global $cacheArray, $_CONFIG;
-
- // Is the extension "theme" installed?
- if (!EXT_IS_ACTIVE("theme")) {
- // Then abort here
- return 0;
- } // END - if
-
- // Default id
- $id = 0;
-
- // Is the cache entry there?
- if (isset($cacheArray['themes']['id'][$name])) {
- // Get the version from cache
- $id = $cacheArray['themes']['id'][$name];
-
- // Count up
- if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
- } elseif (GET_EXT_VERSION("cache") != "0.1.8") {
- // Check if current theme is already imported or not
- $result = SQL_QUERY_ESC("SELECT id FROM `"._MYSQL_PREFIX."_themes` WHERE theme_path='%s' LIMIT 1",
- array($name), __FILE__, __LINE__);
-
- // Entry found?
- if (SQL_NUMROWS($result) == 1) {
- // Fetch data
- list($id) = SQL_FETCHROW($result);
- } // END - if
-
- // Free result
- SQL_FREERESULT($result);
- }
-
- // Return id
- return $id;
-}
-
// Checks wether a theme is found in db
function THEME_CHECK_EXIST ($name) {
// Get theme and is it not nul?
// Run daily reset
require_once(PATH."inc/check-reset.php");
- // Create missing configuration file
- if (!function_exists('GET_CURR_THEME')) {
- // Load dummy theme functions
- require_once(PATH."inc/theme-dummy.php");
- } // END - if
-
// Load admin include file if he is admin
if (IS_ADMIN()) {
// Administrative functions
require_once(PATH."inc/databases.php");
require_once(PATH."inc/session.php");
- // Create missing configuration file
- if (!function_exists('GET_CURR_THEME')) {
- // Load dummy theme functions
- require_once(PATH."inc/theme-dummy.php");
- } // END - if
-
// Check if we are in installation routine
$installPhp = basename($_SERVER['PHP_SELF']);
if (($installPhp != "install.php") && ($CSS != "1") && ($CSS != -1)) {
<?php
-/************************************************************************
- * MXChange v0.2.1 Start: 12/16/2008 *
- * =============== Last change: 12/16/2008 *
- * *
- * -------------------------------------------------------------------- *
- * File : theme-dummy.php *
- * -------------------------------------------------------------------- *
- * Short description : Dummy functions for theme manager *
- * -------------------------------------------------------------------- *
- * Kurzbeschreibung : Platzhalter-Funktionen fuer Theme-Manager *
- * -------------------------------------------------------------------- *
- * *
- * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder *
- * For more information visit: http://www.mxchange.org *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
- * MA 02110-1301 USA *
- ************************************************************************/
-
-// Some security stuff...
-if (!defined('__SECURITY')) {
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
- require($INC);
-} elseif (EXT_IS_ACTIVE("theme")) {
- // Abort loading here
- ADD_FATAL(sprintf(FATAL_EXTENSION_LOADED, "theme"));
- return;
-}
-
-// Dummy getter for current theme
-function GET_CURR_THEME () {
- return "default";
-}
-
-//
+// DEPRECATED!
?>