csscustomizationuser-customization

How can I implement an Orkut-like user facility to change site colors and style?


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.


Solution

  • 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.