Site skins - how to switch images
Posted: Sat Jan 25, 2003 9:17 am
Hi PHP gurus! A silly little newbie is waiting for the touch of your wisdom
I'm working on making my site skinnable. I do not mean something sofisticated, just different color schemes and matching images.
I've been searching a lot, found some nice scripts and tuts (e.g from A List Apart, Domesticat.net etc), made them work for me but run into a problem. All these scripts are only allow to switch CSS and/or page header/footer but I want to switch images for each skin, ALL images, including bullets, buttons etc. I know I could do it like that:
and so on.
but I'm terrified with the thought of listing all images for each skin this way
What I want is to have it like they do in ready-made CMS:
But since I'm new to PHP I have no clue how to implement that. So help, hints, links would be greatly appreciated. TIA
I'm working on making my site skinnable. I do not mean something sofisticated, just different color schemes and matching images.
I've been searching a lot, found some nice scripts and tuts (e.g from A List Apart, Domesticat.net etc), made them work for me but run into a problem. All these scripts are only allow to switch CSS and/or page header/footer but I want to switch images for each skin, ALL images, including bullets, buttons etc. I know I could do it like that:
Code: Select all
<?php
switch ($theme){
case "green":
$stylesheet = "skins/green/style.css";
$logo = "<img src="skins/green/logo.gif" alt="" width="48" height="48" />";
$bullet = "<img src="skins/green/bullet.gif" alt="" width="7" height="7" />";
break;
.....
?>but I'm terrified with the thought of listing all images for each skin this way
What I want is to have it like they do in ready-made CMS:
Code: Select all
<img src="{$skinpath}/logo.gif" alt="" width="48" height="48" />But since I'm new to PHP I have no clue how to implement that. So help, hints, links would be greatly appreciated. TIA