Log in

View Full Version : themes



auriaks
10-07-2009, 08:35 PM
hi, i have question about site themes.
i have css built site which is looking black. Now i had made other style, and i want to create style choosing option in my browser.
you want black theme? you go to options, choose black theme and that theme apllies to your account, until you change it again. is there php script for that or some other way... (sorry for my bad language). Thanks a lot :)

djr33
10-08-2009, 01:12 AM
You need to have user accounts. Or you can use PHP sessions.

Either way, you will store a variable (in the database, in the $_SESSION data, etc.) and that variable will be something like $theme = 'black'.

Based on that value, you can just load a different stylesheet on your page. (....stylesheet src="<?php echo $theme; ?>.css"...)

If you want to customize the html on the page as well, that is more difficult, but you can do it the same way-- load the layout html based on the session variable. But that means a lot of coding to make the same content for different layouts.

auriaks
10-08-2009, 12:14 PM
but how to rewrite $theme variable to my db because i have to save choosen name(black) in ppl account place. is there php command for rewriting? like updating user info in webpage. Thanks

auriaks
10-08-2009, 08:39 PM
noone knows? :(