template, dynamic css stylesheet.

They have: 426 posts

Joined: Feb 2005

Hi all, i have an idea of what i want to create only i need a bit of help;.

I want to design a website template for my registered users whereby it has an admin backend where they can style their site and make it personal to them, so when you go to a specific url like mysite.com/user it loads up a different stylesheet to mysite.com/user2 also i need to find a way that i can write to a stylesheet through the admin side, for things like color specification, positioning, font style etc all to be stored in a registrants directory that is loaded up when you go to their specific URL mysite.com/user1...etc?

any ideas?

He has: 1,380 posts

Joined: Feb 2002

Well for a "stylesheet template" call, it would look like this in PHP:

<?php
<link href=\"/$user/style.css\" rel=\"stylesheet\" type=\"text/css\" />
?>
where "user" is their username.

As far as writing to the style sheet...you're going to have to use textfile edit calls (open file, read lines, edit lines, print back to file, save file, close file).

demonhale's picture

He has: 3,278 posts

Joined: May 2005

you will have to do a lot of coding for this to integrate well... although you can pass on a variable for the stylesheet from a file open, you need a lot of read write to as kyle mentioned...

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.