• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 
Author Message
 Post subject: style switcher
PostPosted: Thu Dec 30, 2004 12:20 am 
Hi,

I'm having problem getting cmsmadesimple to read cookies.

Set Cookie
style.php
\$1:
<?php
setcookie ('sitestyle', $set, time()+31536000, '/', '.mydomain.com', '0');
header("Location: $HTTP_REFERER");
?>


Read Cookie
user plugin called style
\$1:
<link rel="stylesheet" type="text/css"
   media="screen" title="User
Defined Style" href="<?php echo
(!$sitestyle)?'style':$sitestyle ?>.css" />


The problem is that when i switch the style to another style, it would use the default. I'd try echoing to see if it reads the cookie, but no luck.

I'd try using it outside cmsmadesimple, and it works.


Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: style switcher
PostPosted: Thu Dec 30, 2004 8:01 am 
The user plugin is already php, so you don't need the tags.
try changing your "style" userplugin to:
\$1:
echo '<link rel="stylesheet" type="text/css"
   media="screen" title="User Defined Style" href="' .
   (!$sitestyle)?'style':$sitestyle . '.css" />';


Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: style switcher
PostPosted: Fri Dec 31, 2004 9:22 am 
I'd tried your suggestion. It didn't work. Thanks anyway.

I got it to work by myself. I'll post the code for the style switcher later.


Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: style switcher
PostPosted: Sat Jan 01, 2005 5:05 pm 
Thank You.

I will look forward to that. I need a style switcher to differenciate the layout for visually Impaired and non-visually impaired.


Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: style switcher
PostPosted: Tue Jan 04, 2005 3:29 am 
here's the code

called this style.php
\$1:
<?php
setcookie ('sitestyle', $set, time()+31536000, '/', '.coolzeroz.com', '0');
header("Location: $HTTP_REFERER");
?>


Place this code in plugin and call it style
\$1:
if ($_COOKIE["sitestyle"]  == "")
{
   echo "default.css"
}
else
{
echo "$_COOKIE["sitestyle"].css";
}
 


After , place this code
\$1:
{style}


To call the script

\$1:
<a href="style.php?set=default">Change to Default</a>


Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: style switcher  Topic is solved
PostPosted: Tue Jan 04, 2005 3:33 am 
After , place this code
\$1:
<link rel="stylesheet" type="text/css" href="{style}" title="default" />


Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: style switcher
PostPosted: Tue Jan 04, 2005 3:40 am 
delete this post... the code does not work.


Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: style switcher
PostPosted: Tue Jan 04, 2005 10:27 am 
Offline
Administrator
Administrator
User avatar

Joined: Fri Jun 11, 2004 6:58 pm
Posts: 3329
Location: Fairless Hills, Pa USA
See http://forum.cmsmadesimple.org/viewtopic.php?t=318 for the correct code.

_________________
http://about.me/tedkulp


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: Cyc


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Hosting Nation - Managed CMSMS Hosting