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
new to PHP, which way to code?
Moderator: General Moderators
-
fractalvibes
- Forum Contributor
- Posts: 335
- Joined: Thu Sep 26, 2002 6:14 pm
- Location: Waco, Texas
php Tools
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
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
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.
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
google for "php template", i found smarty template engine. Might be that answers my question.
Thanks
-Hy
Thanks
-Hy