Ok, code time. At the moment I'm using a model whereby every page checks a variable and applies a theme to the page depending on that variable. The variable is set by the pulldown menu, or, if it's the first time to the site, the variable is empty and gets created by a "if variable doesn't exist" piece of code. That code is ina seperate file, along with the code that takes the variable sent from the selectbox and turns it into the variable all pages check for, before returning to the index.php page. Sounds a little complicated, but basically there are only 3 types of pages:
Content pages - they display their content in the stored theme.
Index.htm - forwards to index.php yet my friends pc never forwards! He must ahve javascript disabled or something. Anyone know a way to get it to forward otherwise I'll ahve to have a text link for people like him.
Index.php - this page creates the frameset and puts the top page int he top frame that ahs the name title{$THEME}.php, thus, the theme chosen effects what title page is shown. It also loads the basic hopmepage content into the below frame.
Theme.php - this page takes $themeselect (output from selectbox on all title pages) and puts it into $THEME. All pages read this variable and apply the appropriate $THEME.css
It's a clever system, although it's basic. However, things are still only working as well as they are for me for one friend. Other people have server errors and things, I really don't understand it.
To see it in action, goto
Here is the code for some pages:
Theme.php
Code:
<?
session_start();
session_register("THEME");
if (!$themeselect) {
$themeselect = washu;
}
$THEME = $themeselect;
header("Location: index.php");
?>
Titlewashu.php pulldown box code
Code:
<form name="ThemeForm" action="theme.php" method="post">
<select size="1" name="themeselect" onchange="parent.frames.location.href='theme.php?themeselect='+ThemeForm.themeselect.options[ThemeForm.themeselect.selectedIndex].value;ThemeForm.submit();">
<option selected value="">Select Theme</option>
<option value="washu">Washu</option>
<option value="ryoko">Ryoko</option>
<option value="">Naru</option>
<option value="">Tama-chan</option>
<option value="">Ranma</option>
</select>
</form>
Index.php
Code:
<?
session_start();
echo '<html>'; echo "\n";
echo '<head>'; echo "\n";
echo '<title>All Anime Home</title>'; echo "\n";
echo '<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">'; echo "\n";
echo '<META NAME="description" CONTENT="Host your anime here!">'; echo "\n";
echo '<META NAME="resource-type" CONTENT="document">'; echo "\n";
echo '<META NAME="author" CONTENT="All Anime">'; echo "\n";
echo '<META NAME="distribution" CONTENT="Global">'; echo "\n";
echo '<META NAME="keywords" CONTENT="Host your anime here!">'; echo "\n";
echo '<META NAME="revisit-after" CONTENT="5 days">'; echo "\n";
if (!$THEME) $THEME = washu;
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$THEME.css\">\n";
?>
</head>
<frameset rows="121,*" border="0" frameborder="0">
<? echo"<frame name=\"title\" src=\"title{$THEME}.php\" target=\"main\" scrolling=\"auto\" noresize marginwidth=\"0\" marginheight=\"0\">" ?>
<? echo"<frame name=\"main\" src=\"home.php\" target=\"_self\" scrolling=\"auto\" marginwidth=\"0\" marginheight=\"0\">" ?>
<noframes>
<body bgcolor=white>
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>
</frameset>
</html>
The start to every content page (title differs)
Code:
<?
session_start();
echo '<html>'; echo "\n";
echo '<head>'; echo "\n";
echo '<title>All Anime Home</title>'; echo "\n";
echo '<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">'; echo "\n";
echo '<META NAME="description" CONTENT="Host your anime here!">'; echo "\n";
echo '<META NAME="resource-type" CONTENT="document">'; echo "\n";
echo '<META NAME="author" CONTENT="All Anime">'; echo "\n";
echo '<META NAME="distribution" CONTENT="Global">'; echo "\n";
echo '<META NAME="keywords" CONTENT="Host your anime here!">'; echo "\n";
echo '<META NAME="revisit-after" CONTENT="5 days">'; echo "\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$THEME.css\">\n";
?>
Ok well I hope someone actually understands that and can see any problems with the system as evidently there must be some =( Thanks for anyone taking time to even look at this!