array(), // Unix name from filesystem 'theme_name' => array() // Title ); // Only activated themes for the user $add = " WHERE `theme_active`='Y'"; // Is there admin? if (isAdmin()) { // Then display all themes $add = ''; } // END - if // Select all themes we want $result = sqlQuery('SELECT `theme_path`, `theme_name` FROM `{?_MYSQL_PREFIX?}_themes` ' . $add . ' ORDER BY `theme_name` ASC', __FUNCTION__, __LINE__); // Load all themes while ($row = sqlFetchArray($result)) { // Load it's theme.php file if found if (isThemeReadable($row['theme_path'])) { // And save all data in array 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 } // END - while // Free the result sqlFreeResult($result); // Construct selection form for the box template // @TODO Can't this be rewritten to an API function? $OUT = ''; foreach ($themesArray['theme_unix'] as $key => $theme) { $OUT .= '