This is a script to change the theme of my site. But unfortunately it dosnt work.....
PHP Code:
<?php
if(isset($_COOKIE["colorscheme"])){
if($_COOKIE["colorscheme"] == "black"){
echo '<link href="/style/black.css" rel="stylesheet" type="text/css" />';
}elseif($_COOKIE["colorscheme"] == "white"){
echo '<link href="/style/black.css" rel="stylesheet" type="text/css" />';
}
}else{
echo '<link href="/style/black.css" rel="stylesheet" type="text/css" />';
}
echo '<link href="/style/all.css" rel="stylesheet" type="text/css" />';
?>
Code:
<script type="text/javascript">
//Colour Scheme Cookie Set
function setcolorscheme(){
sitetheme = getCookie(colorscheme){
if(sitetheme == black){
function setCookie(colorscheme,white,expiredays){
var exdate=new Date()
exdate.setDate(exdate.getDate()+expiredays)
document.cookie=colorscheme+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
}
}
if(sitetheme == white){
function setCookie(colorscheme,black,expiredays){
var exdate=new Date()
exdate.setDate(exdate.getDate()+expiredays)
document.cookie=colorscheme+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
}
}
}
}
</script>
HTML Code:
<a onclick="setcolorscheme()" style="width:50px; height:50px; display:block;" href="#">
</a>
Edit:
http://dudeking.co.uk its set to the button in the top right which says white and has a down arrow