PDA

View Full Version : PHP, MYSQL & Skinning Design Advice


big_winston
07-08-2003, 01:56 PM
Hi,

I have been using PHP for around 8 months now. Got to say I love the language and the power it has over ASP (which I now spit on! :)).

I program mainly for fun as my job is in no way involved with PHP.

I have been looking at how PHP forum applications such as IVB, PHPBB and WBB (and the portals you can add on for each) are designed to be totally customisable, allowing users the power to create their own skins and make a PHPBB board for example, look totally different to the next one.

I am interested in writing an application similar to a forum (but not as complex), perhaps something like a guest book for now to teach me how to design applications like PHP using skins and HTML templates.

My understanding so far I feel is pretty limited. I understand that (in the case of WBB) all skins are stored in a database from template (.tpl) files that are copied into the database when the install php file is executed. These templates are then passed from the database to the eval() function which loads the templates empty $variables with the values the variables of the same name store. Thats it!

So if you guys out there could shed some light as to how the skins work and how I could go about creating a small application that I can create skins for, I would really appreciate it. Also, any tutorials covering these areas would be very much appreciated.

Many Thanks In Advance,

BW :thumbsup:

ReadMe.txt
07-08-2003, 07:06 PM
Because it interacts so well with HTML, PHP is very easy to skin. The easiest and simplest way to skin is to use a PHP file as your CSS file, this way depending on a cookie or session variable you can include differet files.

The other way is simple templating. Most site created with PHP will either include the opening tags and headers, insert content and then include the closing info or will load up all the content data as variables and include the layout page. Either of these methods can be adapted for skinning by simply using an IF statement to conditionally include differnt files depending on the value of a session or cookie.