]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/theme_functions.php
Renamed ifSqlHasZeroNums() to ifSqlHasZeroNumRows() and improved some queries.
[mailer.git] / inc / libs / theme_functions.php
index 09dee2dd5df886db06016112589d0edebd708c44..9fc37f2872ce444e10442f1d655fad44b77d2416 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2015 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -77,13 +77,10 @@ ORDER BY
 
        // Load all themes
        while ($row = sqlFetchArray($result)) {
-               // Construct relative include file name
-               $inc = sprintf("theme/%s/theme.php", secureString($row['theme_path']));
-
                // Load it's theme.php file if found
-               if (isIncludeReadable($inc)) {
+               if (isThemeReadable($row['theme_path'])) {
                        // And save all data in array
-                       loadInclude($inc);
+                       loadInclude(sprintf('theme/%s/theme.php', secureString($row['theme_path'])));
                        array_push($themesArray['theme_unix'], $row['theme_path']);
                        array_push($themesArray['theme_name'], $row['theme_name']);
                } // END - if
@@ -154,7 +151,7 @@ function getThemeVersion ($name) {
 // Checks whether a theme is found in db
 function ifThemeExists ($name) {
        // Get theme and is it not nul?
-       return (((isExtensionActive('theme')) || (getModule() == 'admin')) && (getThemeId($name) > 0));
+       return (((isExtensionActive('theme')) || (getModule() == 'admin')) && (isValidId(getThemeId($name))));
 }
 
 // Checks if a theme is active
@@ -250,13 +247,13 @@ function getActualTheme () {
                } // END - if
        } elseif ((!isInstalled()) && ((isInstalling()) || (isHtmlOutputMode())) && ((isGetRequestElementSet('theme')) || (isPostRequestElementSet('theme')))) {
                // Prepare filename for checking
-               $themeFile = sprintf("theme/%s/theme.php", getRequestElement('theme'));
+               $themeFile = sprintf('theme/%s/theme.php', getRequestElement('theme'));
 
                // Installation mode active
-               if ((isGetRequestElementSet('theme')) && (isIncludeReadable($theme))) {
+               if ((isGetRequestElementSet('theme')) && (isThemeReadable(getRequestElement('theme')))) {
                        // Set cookie from URL data
                        setMailerTheme(getRequestElement('theme'));
-               } elseif (isIncludeReadable(sprintf("theme/%s/theme.php", postRequestElement('theme')))) {
+               } elseif ((isPostRequestElementSet('theme')) && (isThemeReadable(postRequestElement('theme')))) {
                        // Set cookie from posted data
                        setMailerTheme(postRequestElement('theme'));
                }