]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-theme_edit.php
Some functions rewritten to hungarian notation, handling of array rewritten
[mailer.git] / inc / modules / admin / what-theme_edit.php
index b5a697ffcc3f34e5d018a38491e23c9cb49dd116..ef64b514125890f7c0043e4dd49a124d9dcb5ece 100644 (file)
@@ -35,6 +35,9 @@
 if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
+} elseif (!EXT_IS_ACTIVE("theme")) {
+       addFatalMessage(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "theme"));
+       return;
 }
 
 // Add description as navigation point
@@ -51,14 +54,14 @@ if ($SEL > 0) {
                if (isset($_POST['status'])) {
                        // Change status
                        if ($_POST['active'][$id] == "Y") {
-                               $SQL = "UPDATE "._MYSQL_PREFIX."_themes SET theme_active='N' WHERE id='".$id."' LIMIT 1";
+                               $SQL = "UPDATE `"._MYSQL_PREFIX."_themes` SET theme_active='N' WHERE id='".$id."' LIMIT 1";
                        } else {
-                               $SQL = "UPDATE "._MYSQL_PREFIX."_themes SET theme_active='Y' WHERE id='".$id."' LIMIT 1";
+                               $SQL = "UPDATE `"._MYSQL_PREFIX."_themes` SET theme_active='Y' WHERE id='".$id."' LIMIT 1";
                        }
                        $OUT = ADMIN_THEMES_UPDATED;
                } elseif (isset($_POST['del'])) {
                        // Delete themes
-                       $SQL = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_themes WHERE id='".$id."' LIMIT 1";
+                       $SQL = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_themes` WHERE id='".$id."' LIMIT 1";
                        $OUT = ADMIN_THEMES_DELETED;
                }
 
@@ -79,7 +82,7 @@ if ($SEL > 0) {
        $POST['default_theme'] = SQL_ESCAPE($_GET['default_theme']);
 
        // Set session
-       set_session("mxchange_theme", $POST['default_theme']);
+       set_session('mxchange_theme', $POST['default_theme']);
 
        // Set it in config and current theme as well
        global $currTheme;
@@ -95,11 +98,9 @@ $THEME_MODE = "test";
 
 // Generate output lines for the template
 $OUT = ""; $SW = 2;
-$result = SQL_QUERY("SELECT id, theme_path, theme_active, theme_ver, theme_name FROM "._MYSQL_PREFIX."_themes ORDER BY theme_path", __FILE__, __LINE__);
-if (SQL_NUMROWS($result) > 0)
-{
-       while(list($id, $unix, $active, $ver, $name) = SQL_FETCHROW($result))
-       {
+$result = SQL_QUERY("SELECT id, theme_path, theme_active, theme_ver, theme_name FROM `"._MYSQL_PREFIX."_themes` ORDER BY theme_path", __FILE__, __LINE__);
+if (SQL_NUMROWS($result) > 0) {
+       while(list($id, $unix, $active, $ver, $name) = SQL_FETCHROW($result)) {
                // Load theme in test mode
                require(PATH."theme/".$unix."/theme.php");