views:

18

answers:

2

I would like to implement a facility like Orkut offers where user is able to configure the colors and style for the site, and the changed styles will be used for the user.

I would like the user to be able to enter the color combinations for the site background, top navigation, and left navigation.

Can some one please let me know what all technologies/techniques are involved into this? Any pointers will be helpful. Thanks.

A: 

Here’s a couple of questions asking how to do something similar in Ruby-on-Rails:

There might be some useful hints in there. (I’ve never implemented anything like this myself.)

Paul D. Waite
+1  A: 

The easiest way is to do something like this: (PHP)

<?php 
//Query database, find the user's colors and create the $bgColor, $leftColor and $topColor variables
?>
<style type="text/css">
<?php echo "body { background-color: $bgColor; }"; ?>
<?php echo "div.left { background-color: $leftColor; }"; ?>
<?php echo "div.top { background-color: $topColor; }"; ?>
</style>

You can make this work on any language.

Guilherme Oenning
Make sure do to some escaping on the user-submitted values for colour before writing them to the database, of course.
Paul D. Waite