User based look & feel customization of site

Thread Solved

Join Date: Nov 2008
Posts: 5
Reputation: sayaan is an unknown quantity at this point 
Solved Threads: 0
sayaan sayaan is offline Offline
Newbie Poster

User based look & feel customization of site

 
0
  #1
Nov 24th, 2008
Hi everybody,
I'm new in this forum, I'm a PHP developer looking for good solutions for changing colors, fonts, styles of a site on the fly. The idea is, the user will be given options to customize his/her web site's font, color of various elements etc. and then the site will be built accordingly. The look and feel will vary based on the user.

Can anyone give me a good solution how this can be done in a very efficient way.

Sayaan
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 62
Reputation: PomonaGrange is an unknown quantity at this point 
Solved Threads: 3
PomonaGrange PomonaGrange is offline Offline
Junior Poster in Training

Re: User based look & feel customization of site

 
0
  #2
Nov 24th, 2008
There are a lot of ways that you could do this. One way would be to use sessions to store some info.

You can use a form like this one...

  1. <form id="theme" action="" method="post">
  2. <p>
  3. <select name="Color">
  4. <option>please select a Color ...</option>
  5. <option value="green">Green</option>
  6. <option value="blue">Blue</option>
  7. <option value="orange">Orange</option>
  8. <option value="purple">Purple</option>
  9. </select>
  10.  
  11. <select name="Font">
  12. <option>please select a Font ...</option>
  13. <option value="green">Green</option>
  14. <option value="blue">Blue</option>
  15. <option value="orange">Orange</option>
  16. <option value="purple">Purple</option>
  17. </select>
  18. <input type="submit" value="Change Theme">
  19. </p>
  20. </form>

Then place the following lines at the top of each php page....

  1. <?
  2. session_start();
  3.  
  4. if(isset($_POST['Font'])) {$_SESSION['Font'] = $_POST['Font'];}
  5. if(isset($_POST['Color'])) {$_SESSION['Color'] = $_POST['Color'];}
  6.  
  7. ?>

Then in your <head> section echo your css theme....

  1. <?
  2. echo "<style type 'text/css'>";
  3.  
  4. echo "p {color: ".$_SESSION['Color']." font-size: ".$_SESSION['Font']."}"; ?>
  5. echo "</style>";

You would have to echo the session color and font throughout your css file.
You could also have predefined styles and use a similar session result.

Please note: I haven't tested this, but I think it might work.

There are probably better ways of doing this, but hope it helps.
There are alot of people smarter than me, BUT at least I try to be of some help. Of coarse I'm not perfect, I need help too.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC