Let me begin by saying I feel like a moron. I've done this once before and got it to work with no problems whatsoever. That said, I am trying to make some different site skins for my sister's frihost website (which will explain why the stuff in the code doesn't match up with my info, I hope).
I followed the guide on this site: http://www.domesticat.net/skins/howto.php. It worked for me before, when I was simply using layouts with a different header picture but overall the same structure. That was on a different host before we/she moved the site to frihost. Now I am trying to do slightly more complex layouts using divs instead of tables so that the layouts can be more diverse. There's less formatting code on the pages now, so I figured it would be easier to do the whole skin thing.
So I went in and altered the code that I had used successfully to reflect the new formats. I thought that formatting was all I changed, but I can't seem to get the new skin to "stick" past the test/selection page. What I mean is that the new skin shows up no problem after clicking "make this my skin", but once you click back to the index page the old skin shows up again. I think this means I'm setting the cookie wrong, but I'm a total php newbie and it really could be anything. I've been over and over the code for the last week and can't find what I'm doing wrong, so I'm hoping someone here can enlighten me (and that it's not some really idiotic, simple mistake that'll make me facepalm at my own stupidity).
The problem site is found (in all its stunted, not functioning glory) here: http://www.chocolate-roses.org/test/index.php
This is the code that I have to set the cookie for the skin (it's pretty much identical to that found in the tutorial, with this site's parameters plugged in):
This code then calls the correct header (basically the stylesheet link and menu) to include based on the skin that should be set. At this point the footer is the same for both skins, so I only include the default footer.txt at the bottom of each page.
A sample page code then looks like this:
I'm really hoping someone can tell me what I'm messing up or missing and what I should do to fix it. Please help me!
I followed the guide on this site: http://www.domesticat.net/skins/howto.php. It worked for me before, when I was simply using layouts with a different header picture but overall the same structure. That was on a different host before we/she moved the site to frihost. Now I am trying to do slightly more complex layouts using divs instead of tables so that the layouts can be more diverse. There's less formatting code on the pages now, so I figured it would be easier to do the whole skin thing.
So I went in and altered the code that I had used successfully to reflect the new formats. I thought that formatting was all I changed, but I can't seem to get the new skin to "stick" past the test/selection page. What I mean is that the new skin shows up no problem after clicking "make this my skin", but once you click back to the index page the old skin shows up again. I think this means I'm setting the cookie wrong, but I'm a total php newbie and it really could be anything. I've been over and over the code for the last week and can't find what I'm doing wrong, so I'm hoping someone here can enlighten me (and that it's not some really idiotic, simple mistake that'll make me facepalm at my own stupidity).
The problem site is found (in all its stunted, not functioning glory) here: http://www.chocolate-roses.org/test/index.php
This is the code that I have to set the cookie for the skin (it's pretty much identical to that found in the tutorial, with this site's parameters plugged in):
| Code: |
| <?
$total_skins = 2; $default_skin = 1; if (isset($_REQUEST['newskin'])) { $newskin=(int)$_REQUEST['newskin']; if ( ($newskin<1) OR ($newskin>$total_skins) ) $newskin=$default_skin; } elseif (isset($_REQUEST['skin'])) { $newskin=(int)$skin; if ( ($skin<1) OR ($skin>$total_skins) ) $newskin=$default_skin; } else $newskin=$default_skin; $skin=$newskin; setcookie ('skin', "", time() - 3600); setcookie('skin',$newskin,time()+(86400*365),'/'); setcookie('skin',$newskin,time()+(86400*365),'/','.chocolate-roses.org'); $skin=$newskin; $headervar = "/home/chalchih/domains/chocolate-roses.frih.net/public_html/test/nav/header"; $footervar = "/home/chalchih/domains/chocolate-roses.frih.net/public_html/test/nav/footer"; $extension = ".txt"; ?> |
This code then calls the correct header (basically the stylesheet link and menu) to include based on the skin that should be set. At this point the footer is the same for both skins, so I only include the default footer.txt at the bottom of each page.
| Code: |
| <? include($headervar.$skin.$extension); ?> |
A sample page code then looks like this:
| Code: |
| <? include("cookiecheck.php"); ?>
<html> <head> <title>Chocolate Roses Cosplay</title> <? include($headervar.$skin.$extension); ?> <h1>Welcome!</h1> <p>blahblahblahblah</p> <? include('nav/footer.txt'); ?> |
I'm really hoping someone can tell me what I'm messing up or missing and what I should do to fix it. Please help me!
