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()) $add = ''; // Select all themes we want $result = SQL_QUERY('SELECT `theme_path`,`theme_name` FROM `{?_MYSQL_PREFIX?}_themes` ' . $add . ' ORDER BY `theme_name` ASC', __FUNCTION__, __LINE__); // Load all themes while ($content = SQL_FETCHARRAY($result)) { // 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 loadInclude($inc); array_push($themesArray['theme_unix'], $content['theme_path']); array_push($themesArray['theme_name'], $GLOBALS['theme_data']['name']); } // END - if } // END - while // Free the result SQL_FREERESULT($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 .= '