Heavy rewrite:
[mailer.git] / inc / libs / theme_functions.php
index ff9e5e3497297cb6348b51c708204abd1b3f3da5..44363a8c7cc42d1f8ebb72afc8e975ae7d4d5f09 100644 (file)
@@ -68,7 +68,7 @@ function generateThemeSelectionBox ($mod, $act, $wht, $result) {
        } // END - while
 
        // Sort whole array by title
-       array_pk_sort($themesArray, array("theme_name"));
+       array_pk_sort($themesArray, array('theme_name'));
 
        // Construct selection form for the box template
        $OUT = '';
@@ -85,7 +85,7 @@ function generateThemeSelectionBox ($mod, $act, $wht, $result) {
        );
 
        // Return generated selection
-       return LOAD_TEMPLATE("theme_select_form", true, $content);
+       return LOAD_TEMPLATE('theme_select_form', true, $content);
 }
 
 // Get version from name
@@ -93,11 +93,11 @@ function THEME_GET_VERSION ($name) {
        // Is the extension 'theme' installed?
        if (!EXT_IS_ACTIVE('theme')) {
                // Then abort here
-               return "!.!";
+               return '!.!';
        } // END - if
 
-       // Default version "number"
-       $cver = "?.?";
+       // Default version 'number'
+       $cver = '?.?';
 
        // Is the cache entry there?
        if (isset($GLOBALS['cache_array']['themes']['theme_ver'][$name])) {
@@ -108,8 +108,8 @@ function THEME_GET_VERSION ($name) {
                incrementConfigEntry('cache_hits');
        } 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",
-               array($name), __FUNCTION__, __LINE__);
+               $result = SQL_QUERY_ESC("SELECT `theme_ver` FROM `{!_MYSQL_PREFIX!}_themes` WHERE `theme_path`='%s' LIMIT 1",
+                       array($name), __FUNCTION__, __LINE__);
 
                // Entry found?
                if (SQL_NUMROWS($result) == 1) {
@@ -151,8 +151,8 @@ function isThemeActive ($name) {
                incrementConfigEntry('cache_hits');
        } 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",
-               array($name), __FUNCTION__, __LINE__);
+               $result = SQL_QUERY_ESC("SELECT `theme_active` FROM `{!_MYSQL_PREFIX!}_themes` WHERE `theme_path`='%s' AND `theme_active`='Y' LIMIT 1",
+                       array($name), __FUNCTION__, __LINE__);
 
                // Is the theme active and installed?
                $active = (SQL_NUMROWS($result) == 1);
@@ -170,7 +170,7 @@ function getCurrentThemeName () {
        // Is the extension 'theme' installed?
        if (!EXT_IS_ACTIVE('theme')) {
                // Then abort here
-               return "default";
+               return 'default';
        } // END - if
 
        // Get the Uni* name
@@ -185,8 +185,8 @@ function getCurrentThemeName () {
                incrementConfigEntry('cache_hits');
        } 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",
-               array($name), __FUNCTION__, __LINE__);
+               $result = SQL_QUERY_ESC("SELECT `theme_name` FROM `{!_MYSQL_PREFIX!}_themes` WHERE `theme_path`='%s' AND `theme_active`='Y' LIMIT 1",
+                       array($name), __FUNCTION__, __LINE__);
 
                // Load theme name
                list($name) = SQL_FETCHROW($result);
@@ -203,7 +203,7 @@ function getCurrentThemeName () {
 $GLOBALS['curr_theme'] = getCurrentTheme();
 
 // Check if new theme is selcted
-if ((REQUEST_ISSET_POST(('new_theme'))) && (REQUEST_POST('new_theme') != $GLOBALS['curr_theme'])) {
+if ((REQUEST_ISSET_POST('new_theme')) && (REQUEST_POST('new_theme') != $GLOBALS['curr_theme'])) {
        // Set new theme for guests
        $newTheme = REQUEST_POST('new_theme');
 
@@ -216,5 +216,5 @@ if ((REQUEST_ISSET_POST(('new_theme'))) && (REQUEST_POST('new_theme') != $GLOBAL
        ADD_INC_TO_POOL(sprintf("%stheme/%s/theme.php", constant('PATH'), $newTheme));
 } // END - if
 
-//
+// [EOF]
 ?>