how to apply themes

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
eshban
Forum Contributor
Posts: 184
Joined: Mon Sep 05, 2005 1:38 am

how to apply themes

Post by eshban »

hi,

i want to implement themes in my project. means i have different themes in a themes folder. The admin has rights to change and apply a new theme. i want that there is a list which shows all themes. when admin apply theme 1, then the header, footer and css of the complete site is change according to theme 1 .

how can i implement this. what is the logic behind this.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Read up on template engines. We've talked about them ad nauseum here.

Smarty
eshban
Forum Contributor
Posts: 184
Joined: Mon Sep 05, 2005 1:38 am

Post by eshban »

i don't want to use templates. just want to done through simple code
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

then you'll need to write code that can 1) retrieve the "active" theme to accurately pull the header/footer/css files 2) allow for scripted fetching of each of those files.

Both are not difficult, typically. The first is a simple database query. The second is often a matter of using the correct path (using the results of the database query) to build the proper path to find the files in.
Post Reply