...

View Full Version : Saving a stylesheet with javascript



visiondemocracy
04-13-2005, 05:33 PM
Hi folks,
I am making a very configurable site right down to a floating object that a user can drag anywhere. What I'd like to do is have an option for users to "save" their site changes, probably with a cookie or using their IP. The site is similar to my.yahoo.com (http://my.yahoo.com) but is more focused. I want users to be able to change things like the color scheme, and the location of some objects, which I can handle, and then "save" those particular settings for when they come back.

I've figured out that I can do everything in a CSS so what I need is for a user to "save" the current stylesheet. I could put everything inline but the problem is, when a user changes the location of an object, it doesn't change the stylesheet or source code. I'd like it to do that if possible.

Anyone have any ideas?

Thanks in advance for your help.

A1ien51
04-13-2005, 06:16 PM
The cookie is limited to the amount of info it can hold. You really need to use a server side langauge to hold the changes. That is how the big sites do it so you can log in anywhere and get your personal defaults.

Eric

visiondemocracy
04-13-2005, 07:05 PM
Good point. Plus I anticipate a lot of my visitors to have dynamic IPs like Universities, etc. Do you (or anyone else) have any suggestions for the server-side code?

Thanks for the timely response!

Cyrus

A1ien51
04-13-2005, 07:17 PM
What does your server support...that is where you need to start...

Eric

visiondemocracy
04-13-2005, 07:25 PM
I believe it supports most major scripts including PERL, PHP, MySQL is definately supported.

I just realized that if I can find a membership script that sets which stylesheet to use based on either a cookie or IP, I would be 1/2 way to my goal. I would then only need to figure out how to allow a user's modifications to create a new stylesheet.

I realize this would take up a lot of space as more users came, but I think it would be worth it.

If you go to http://www.cyruspatten.com/test.html You can see a rough idea of what I'm trying to do. The floating box can be moved by the user, and I want it to be in the place the user moves it to the next time they visit. Later I will incorporate a million other features.

Cyrus



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum