Page 3 of 3

Re: PHP Style Sheet Switcher

Posted: Tue Jun 23, 2009 5:54 pm
by katea
OK, this works great but for one small probem.

I can change the stylesheets no problem, but once I've loaded a stylsheet, then choose another, I can't go back to the stylesheet chosen before unless I reset to default.....

Kinda hard to explain, but let me run you through my process:

4 stylesheets .... Let's call them default, red, white and blue.

Clcik on red ... Great
Click on Blue ... Great
Click on White ... Great ...
Click back on Blue ... Doesn't work!

Click on default, then click back on Blue .. Great

It seems that once one stylesheet is loaded, it doesn't want to load it for a second time unless I click the default, then it's OK.

Default has obviously got a refresh or something, but the others seem to cache and hide.

Any way around this?

Thanks

Re: PHP Style Sheet Switcher

Posted: Tue Jun 23, 2009 6:06 pm
by katea
OK, this is fixed if you change the time from 86400 to 1 ....

Although, this not makes the cookie pointless doesn't it?

It would be great to have it remember it for the next time the user visits, but it's important for me to have an instant change.

Any other way of working this do you think?

Re: PHP Style Sheet Switcher

Posted: Wed Jun 24, 2009 1:30 am
by katea
Forget it, this does not work in opera or IE6.

That's a complete let down... OK, let's look for another solution.

Re: PHP Style Sheet Switcher

Posted: Wed Jun 24, 2009 9:52 am
by katea
Jquery is the way!

Works flawlessly in all browsers!

http://www.kelvinluck.com/2006/05/switch-stylesheets-with-jquery/

Re: PHP Style Sheet Switcher

Posted: Wed Apr 07, 2010 5:32 pm
by Airidas
Hi katea, can you give more instruction how to add jquery to cms made simple?
Im a litle fresh, can you give some instructions?

Many thanks.

Re: PHP Style Sheet Switcher

Posted: Thu Apr 08, 2010 9:27 am
by cyberman

Re: PHP Style Sheet Switcher

Posted: Wed May 19, 2010 9:08 am
by JM6891
Hi All,

I'm using the original method of style switcher, as described on the first page of this thread, however I've run into a problem now that my site has been transferred to a different server.

My development server spec:

PHP5.2.10
Linux
Apache 2.0

On the above server, my PHP style switcher worked fine.

Live server spec:

PHP4.3.9
Linux
Apache 2.0

On the above server, my switcher only loads the default style. When I click on the different links to load my 'medium' stylesheet, or 'large' stylesheet, the default stylesheet remains.

Is this a problem with the server or cookies perhaps? I am a complete noob to PHP and fairly new to CMSMS so any help anyone can give would be great.

Thanks in advance.

Re: PHP Style Sheet Switcher

Posted: Wed May 19, 2010 9:21 am
by JM6891
Actually, I just doubled checked my switcher.php and I hadn't amended the domain for the cookie. My bad!

Re: PHP Style Sheet Switcher

Posted: Wed May 19, 2010 4:11 pm
by JohnnyB
JM6891 wrote:Actually, I just doubled checked my switcher.php and I hadn't amended the domain for the cookie. My bad!
That was going to be my question :)
I like using the original because it isn't dependent upon javascript support.  I'm using it here for high contrast and font sizes:

remove the spaces (don't want it indexed from here ;)
www [dot] t h e  i r i s [dot] org  (need the www. )

Re: PHP Style Sheet Switcher

Posted: Thu Aug 19, 2010 2:10 pm
by sp
hey, i have added the styles witcher to a site. im using it to switching three different font-types default,large and xlarge.

so now i have the same problem like katea. you could switch to  large, then to xlarge.
but then when you click the large button again the style won't switch!
you have to switch to default first to go to large again.

mww i saw your theiris site, there it works right.
whats the difference?


sp

Re: PHP Style Sheet Switcher

Posted: Thu Aug 19, 2010 6:52 pm
by JohnnyB
sp - I think this thread has a couple different versions posted.... Do you know if you are using the one I am using?  do you have a link to your site? you can PM me.