array(), // Unix name from filesystem 'theme_name' => array(), // Title 'theme_author' => array(), // Theme author's name 'theme_email' => array(), // Author's email address 'theme_url' => array(), // URL were you can download it from 'theme_ver' => array(), // Version number of theme ); // Read directory "themes" $handle = opendir(PATH."theme/") or mxchange_die("Cannot read themes dir!"); while ($entry = readdir($handle)) { // Construct absolute theme.php file name $INC = sprintf("theme/%s/theme.php", $entry); if (($entry != ".") && ($entry != "..") && (FILE_READABLE($INC)) && (THEME_IS_ACTIVE($entry))) { // Found a valid directory so let's load it's theme.php file LOAD_INC($INC); // Add found theme to array $THEMES['theme_unix'][] = $entry; $THEMES['theme_name'][] = $THEME_NAME; $THEMES['theme_author'][] = $THEME_AUTHOR; $THEMES['theme_email'][] = $THEME_EMAIL; $THEMES['theme_url'][] = $THEME_URL; $THEMES['theme_ver'][] = $THEME_VERSION; } // END - if } // END - while // Close directory closedir($handle); // Sort array by Uni* name array_pk_sort($THEMES, array("theme_name")); // Generate output lines for the template $OUT = ""; $SW = 2; foreach ($THEMES['theme_unix'] as $key => $unix) { $default = ""; if (get_session('mxchange_theme') == $unix) $default = " selected=\"selected\""; // Add row $OUT .= " ".$THEMES['theme_name'][$key]." ".$THEMES['theme_author'][$key]." ".$THEMES['theme_url'][$key]." v".$THEMES['theme_ver'][$key]." \n"; $SW = 3 - $SW; } if (empty($OUT)) { // No themes found??? $OUT = " ".LOAD_TEMPLATE("admin_settings_saved", true, getMessage('MEMBER_NO_THEMES_FOUND'))." \n"; } define('__THEME_LIST', $OUT); // Load template LOAD_TEMPLATE("member_themes"); // ?>