Jump to content


Photo

PHP Themes


  • Please log in to reply
5 replies to this topic

#1 ItsWesYo

ItsWesYo
  • Members
  • PipPipPip
  • Advanced Member
  • 110 posts

Posted 01 August 2006 - 06:12 PM

I was wondering on how you would make different themes for your site.

Example: A person happens to see your site and wants to view it in a different color.

Is there a way I can do that using cookies or something?

#2 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 01 August 2006 - 06:53 PM

I have seen this done many ways, the best way is to have 2 CSS and a link
Design A / Design B
on click, you can either store in cookies
or record IP (Can be heavy on server)
or use the GET method
mywebsite.com/index.php?design=b
Tell me the problem, I will try tell you the solution

#3 ronverdonk

ronverdonk
  • Members
  • PipPipPip
  • Advanced Member
  • 277 posts
  • LocationNetherlands

Posted 01 August 2006 - 06:59 PM

You make as many CSS files as you want styles. Make a select box on your screen, user selects the style and a JavaScript program loads the CSS file to use. That is basically it. I use it for selecting font sizes fot the visually impaired users.

Ronald  ;D
RTFM is an almost extinct art form, it should be subsidized.

#4 ItsWesYo

ItsWesYo
  • Members
  • PipPipPip
  • Advanced Member
  • 110 posts

Posted 01 August 2006 - 07:18 PM

Ronald, would you be able to help me with the javascript and such?

#5 ronverdonk

ronverdonk
  • Members
  • PipPipPip
  • Advanced Member
  • 277 posts
  • LocationNetherlands

Posted 01 August 2006 - 07:31 PM

Actually I am using the FREE Style Sheet Switch v1.0 package from dynamic drive. The link to the package is

http://www.dynamicdr...eetswitcher.htm

It uses cookies to save the choice of the user. I have implemented it some time ago and it works fine.
If you still need help, drop me a message.

Ronald  ;D
RTFM is an almost extinct art form, it should be subsidized.

#6 ryanlwh

ryanlwh
  • Staff Alumni
  • Advanced Member
  • 511 posts

Posted 01 August 2006 - 09:28 PM

or you can save the choice in the database and load it on runtime too
<link src="/css/design<?php echo $designNo ?>.css">

Please use EDIT * 100...
Please use
or [php] * 1000...

PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users