<?php
$styles = array(
1 => get_bloginfo('template_url').'/styles/style_midnight.css',
2 => get_bloginfo('template_url').'/styles/style_red.css',
3 => get_bloginfo('template_url').'/styles/style_black.css',
4 => get_bloginfo('template_url').'/styles/style_blue.css');
$db_defined_style = get_option('aq2_color');
/*
This is the name of the cookie. If you change it, you must change the
javascript as well.
*/
$stylecookie = $_COOKIE["simon360_style"];
/*
Please be sure to read the readme file before using this script, as it
explains in detail how to use it.
*/
function aq2_links() {
switch ($stylecookie) {
foreach ($style_array as $stylesheet) {
case $casenum:
echo ' <link rel="stylesheet" type="text/css" media="screen" href="'.$stylesheet.'" id="style"/>';
break;
$casenum++
}
default:
echo ' <link rel="stylesheet" type="text/css" media="screen" href="'.$styles[$db_defined_style].'" id="style"/>';
break;
}
}
aq2_links();
/*
Now we'll define a function that takes a few parameters, and outputs the
<link> declaration.
*/
function extra_options($cname,$stylesheet,$id) {
if ($_COOKIE[$cname]==1) {
echo ' <link rel="stylesheet" type="text/css" media="screen" href="'.$stylesheet.'" id="'.$id.'"/>';
}
}
/*
If you wanted to add a new switch for a <link> with the ID "foo", the cookie
the switch named "bar", and a stylesheet named "foobar.css", for example, you
would simply type
extra_options("bar","foobar.css","foo")
This would write out the <link> in your header (or wherever the function is
placed, but header is recommended), and the javascript provided would work for
that ID and cookie.
*/
?>