X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Flibs%2Ftheme_functions.php;h=ed45abc62e3bfd0996a296399d7d2d29ab2a80fe;hp=f8fd66dbd5a1fc2a764fd40bc186fd5963f128fe;hb=7cb246c51e8634735aaf24e546bcbc46c5ce3833;hpb=4001187f22197f55e5a1f211fc8defcc180f7c32 diff --git a/inc/libs/theme_functions.php b/inc/libs/theme_functions.php index f8fd66dbd5..ed45abc62e 100644 --- a/inc/libs/theme_functions.php +++ b/inc/libs/theme_functions.php @@ -1,7 +1,7 @@ array() // Title ); + // Only activated themes for the user + $add = " WHERE `theme_active`='Y'"; + + // Do we have admin? + if (isAdmin()) $add = ''; + + // Select all themes we want + $result = SQL_QUERY("SELECT + `theme_path`, `theme_name` +FROM + `{?_MYSQL_PREFIX?}_themes` +".$add." +ORDER BY + `theme_name` ASC", __FILE__, __LINE__); + // Load all themes while ($content = SQL_FETCHARRAY($result)) { - // Load it's theme.php file - $INC = sprintf("theme/%s/theme.php", SQL_ESCAPE($content['theme_path'])); - if (INCLUDE_READABLE($INC)) { + // Construct relative include file name + $inc = sprintf("theme/%s/theme.php", secureString($content['theme_path'])); + + // Load it's theme.php file if found + if (isIncludeReadable($inc)) { // And save all data in array - LOAD_INC($INC); + loadInclude($inc); $themesArray['theme_unix'][] = $content['theme_path']; - $themesArray['theme_name'][] = $THEME_NAME; + $themesArray['theme_name'][] = $GLOBALS['theme_data']['name']; } // END - if } // END - while - // Sort whole array by title - array_pk_sort($themesArray, array("theme_name")); + // Free the result + SQL_FREERESULT($result); // Construct selection form for the box template - $OUT = ""; + $OUT = ''; foreach ($themesArray['theme_unix'] as $key => $theme) { $OUT .= "