jump to content

<?
/*
 * themes.php3 - to be included at the top of all php3 files which
 *             need to be themed
 *     e.g. 
 *        <? include("themes.php3"); ?>
 * Aug 08, 1999
 */

// array which holds the theme names and corresponding CSS files
$themes = array(  "Default"     =>  "index.txt"
                , "Alien Glow"   =>  "alienglow.txt"
                , "Green Earth"   =>  "greenearth.txt"
                , "Old Lace"   =>  "oldlace.txt"
                );
$ButtonLabel = "Go";
$ThisFile = "themes.php3";

if ( $chose == $ButtonLabel ){
     // set the theme
    SetCookie("Theme",$w_theme,time()+3600000);
     // and go back to where you came from
    Header("Location: $HTTP_REFERER");
    exit;
}
// if a theme is not already chosen, assign Default
if($Theme == '') {
    SetCookie("Theme","Default",time()+3600000);
    $Theme = "Default";
}
echo  "<link rel=\"stylesheet\" type=\"text/css\" href=\"styles/".$themes[$Theme]. "\">\n";

/*
 * selthm      - provides a list to choose themes
 *               when a theme is choosen, sets it as well
 * vsbabu@csoft.net
 * Aug 08, 1999
 */
function selthm() {
global $themes;
global $Theme;
global $ThisFile;
global $ButtonLabel;
     // print a theme selector
    echo  "Please choose a theme and hit <B>$ButtonLabel</B>\n";
    if ( $Theme == '' )
        $Theme="Default";
    echo  "<table border=\"0\"><tr><td><form name=\"choosetheme\" action=\"$ThisFile\">\n".
          "<small><select name=\"w_theme\">\n";
    reset($themes);
    do {
        $thmname = key ($themes) ;
        if ( $Theme == $thmname )
            echo  "<option value=\"$thmname\" SELECTED>$thmname</option>\n";
        else
            echo  "<option value=\"$thmname\">$thmname</option>\n";
    } while (next($themes));
    echo  "</select></td><td>\n".
         "<input type=\"submit\" name=\"chose\" value=\"$ButtonLabel\"></small>\n".
          "</form></td></tr></table>\n";
          //"<a href=\"selthm.php3?chose=Go\">use</a></small>\n".
}
/*
 * listthm      - prints the list of themes
 * vsbabu@csoft.net
 * Aug 08, 1999
 */
function listthm() {
global $themes;
global $Theme;
echo "<OL>\n";
reset($themes);
do {
    $thmname = key ($themes) ;
    if ( $Theme == $thmname )
        echo  "<LI><A HREF=\"styles/".$themes[$thmname]. "\">$thmname</A> - <B>Current Theme</B></LI>\n";
    else
        echo  "<LI><A HREF=\"styles/".$themes[$thmname]. "\">$thmname</A></LI>\n";
} while (next($themes));
echo "</OL>\n";
}
?>