Page 1 of 1
new to PHP, which way to code?
Posted: Mon Apr 28, 2003 8:57 pm
by lazi_me
I'm looking for the best way to code a photo album website using PHP. There are many free sourceforge projects using PHP. Howerver, they are not very clean.
I would like to be able to change themes, skin, etc. There are patTemplate, class/struct structure, and others structure/template that I do not know of, etc. Which way is better and you would recommend to use?
Thanks
-Hy
Posted: Mon Apr 28, 2003 11:06 pm
by fractalvibes
Extensive use of CSS? Perhaps you need several different stylesheets and associate with a particular photo or album? Unsure of what you are asking, exactly.
PhilJ.
php Tools
Posted: Tue Apr 29, 2003 4:24 pm
by lazi_me
Not much CSS, the idea is just having three framesets. Toolbar frame, consists of several buttons such as next, prev, index links. TOC frame, consists of thumbnails. Content frame, consists of album view or image view.
I saw people code everything (HTML code and PHP code) in one file. Now, that's pretty hard to change and customize. I'm looking for a way to separate HTML presentation and PHP logic code so that it is easier to maintain and customize.
-Hy
Posted: Tue Apr 29, 2003 8:29 pm
by McGruff
This is very easy to do - no template classes required.
Create a bunch of html templates for whole pages and bits of pages as necessary. Echo out php vars in the templates. Include the templates where you need them.
Now you can edit html templates (and a CSS file attached to the templates) to change the look of your site without touching the code. An html editor like dreamWeaver which stores libraries of common elements makes that easier still.
Well almost: I find there are often one or two places where it makes sense to apply some html in the script (eg the alternating bgcolors for posts on this page). If you can define constants or vars for these items and stick them in a configuration section at the top of a php file, it makes it easy to edit later.
Personally I'd ditch the frames - nothing but trouble imho.
smarty template engine
Posted: Tue Apr 29, 2003 8:44 pm
by lazi_me
google for "php template", i found smarty template engine. Might be that answers my question.
Thanks
-Hy