Skip to main content
gamedev.net
🔒 Locked

PHP templates and strings?

Started by sathenzar Sep 12, 2005 at 2:54 PM 2 replies 450+ views
Original Post
sathenzar
sathenzar
Hey everyone, I was wondering what would be the best way to go about applying a users template to a website would be. For ex. let's say I have forums. If I want my users to be able to add their own template that maps out over the webpage. What would be the best way? Thanks in advance. [Edited by - sathenzar on September 12, 2005 10:23:46 PM]
sathenzar
sathenzar
If I'm not being specific enough, I mean like how to I take a template they specify and load it so it will still function? Like phpBB has template ability. How do I achieve that? Thanks in advance.
Colin Jeanne
Colin Jeanne
I would do something like this:

Design the site so that the appearance is completely controlled by CSS. Then to change the layout of your page you only need to tweak the stylesheet. Once you have that you can create a set of stylesheets. Add a 'User stylesheet' field to the table in your database that describes your user which holds which of your set of stylesheets the user has chosen to use. Finally, when you output the page, selectively link whichever stylesheet the user has chosen.
sathenzar
sathenzar
Thank you, I had thought of doing somthing to that effect.I didn't know the exact way of going about it. But thanks for your input. You just cleared the path on how I'm going to do this.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.