Mahor rewrite:
[mailer.git] / inc / libs / theme_functions.php
index 6fbcd9890409a194c3cdb3d73a69e7a9decbfb84..5fff9d70642ae01cd8c18a3cb5fe9166eb120b14 100644 (file)
@@ -48,7 +48,7 @@ function GET_CURR_THEME() {
        $ret = "default";
 
        // Load default theme if not empty from configuration
-       if (!empty($_CONFIG['default_theme'])) $ret = $_CONFIG['default_theme'];
+       if (getConfig('default_theme') != "") $ret = getConfig('default_theme');
 
        if (!isSessionVariableSet('mxchange_theme')) {
                // Set default theme
@@ -70,10 +70,10 @@ function GET_CURR_THEME() {
                // Installation mode active
                if ((!empty($_GET['theme'])) && (FILE_READABLE($theme))) {
                        // Set cookie from URL data
-                       set_session("mxchange_theme", $_GET['theme']);
+                       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", $_POST['theme']);
+                       set_session("mxchange_theme", SQL_ESCAPE($_POST['theme']));
                }
 
                // Set return value
@@ -154,7 +154,7 @@ function THEME_GET_VERSION ($name) {
                $cver = $cacheArray['themes']['theme_ver'][$name];
 
                // Count up
-               if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+               if (getConfig('cache_hits') > 0) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
        } elseif (GET_EXT_VERSION("cache") != "0.1.8") {
                // Load version from database
                $result = SQL_QUERY_ESC("SELECT theme_ver FROM `"._MYSQL_PREFIX."_themes` WHERE theme_path='%s' LIMIT 1",
@@ -193,7 +193,7 @@ function THEME_GET_ID ($name) {
                $id = $cacheArray['themes']['id'][$name];
 
                // Count up
-               if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+               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",
@@ -238,7 +238,7 @@ function THEME_IS_ACTIVE ($name) {
                $active = ($cacheArray['themes']['theme_active'][$name] == "Y");
 
                // Count up
-               if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+               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 theme_active FROM `"._MYSQL_PREFIX."_themes` WHERE theme_path='%s' AND theme_active='Y' LIMIT 1",
@@ -274,7 +274,7 @@ function GET_CURR_THEME_NAME () {
                $name = $cacheArray['themes']['theme_name'][$name];
 
                // Count up
-               if (isset($_CONFIG['cache_hits'])) { $_CONFIG['cache_hits']++; } else { $_CONFIG['cache_hits'] = 1; }
+               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 theme_name FROM `"._MYSQL_PREFIX."_themes` WHERE theme_path='%s' AND theme_active='Y' LIMIT 1",