Subversion Repositories travelsized

Rev

Rev 3 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?PHP
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * This file is part of Travelsized CMS
 *              A content management system with modules, based on wiki syntax
 *
 * Author: Dan Jensen <admin@leinir.dk>
 * Copyright 2003/2004
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * The GNU General Public License is available at: http://www.gnu.org/copyleft/
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */


$themesfolder = "$setup_folder/themes/";
// Get the names of the folders containing themes
$fp = opendir($themesfolder);
while ($file = readdir($fp)) {
        if ($file != "." && $file != "..") {
                //Only include the folder, if there is actually a theme in there
                if (file_exists("$themesfolder$file/theme.html")) $theme_folder[] = $file;
        }
}
closedir($fp);

// Get the human names of the themes, contained inside a file name.txt
foreach ($theme_folder as $key => $value) {
        if (file_exists("$themesfolder$value/name.txt")) {
                $fp = fopen("$themesfolder$value/name.txt", "r");
                $theme_name[] = fread($fp, filesize("$themesfolder$value/name.txt"));
                fclose($fp);
        } else {
                $theme_name[] = $value;
        }
}

$theme_options_file = "$setup_folder/theme_options.php";
// Set the default options, they will be over-written below if the file exists...
$theme_options = array(
                        "theme_follows_menu" => "1",
                        "force_follow" => "0");
if (file_exists($theme_options_file)) include("$theme_options_file");
?>