Closed Thread Icon

Topic awaiting preservation: Just for fun - PHP (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12453" title="Pages that link to Topic awaiting preservation: Just for fun - PHP (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Just for fun - PHP <span class="small">(Page 1 of 1)</span>\

 
JMJimmy
Bipolar (III) Inmate

From: Picton, Ontario, Canada
Insane since: Apr 2001

posted posted 09-27-2002 07:26

I was just wondering how people 'round these parts' parse their php webpages together?

I generally include .inc.php files which are basically bits of the html with a php object controlling things like where to find the image directory. Then some code generation for repetitive aspects.

I control the layout through a function I created so I just call

generate_layout("[insert page name here]"); and that orders, sets back ground colours, and some other stuff. That line parses in the entire main content.

How bout you?

JMJimmy

genis
Paranoid (IV) Inmate

From: Dallas, TX
Insane since: Aug 2002

posted posted 09-27-2002 07:56

I usually don't do large content sites with a repetitive look on different pages for like posting articles or whatnot.

So I like to make individual pages according to their task.
For whatever process I'm making, i make a page for every step in the process.
All needed functions are require_once'd through an outside .inc file.

All function .inc's are usually separated by what type of functions used... like image manipulation functions, filesystem manipulation, database, etc... most of the time i just use one called common.inc.

Then i use a config.inc where i set all the variables that will need the most changing from time to time or system to system.

Although this works well, I'm thinking of using Fusebox. http://www.fusebox.org/

Anyone use fusebox as an application standard?
I'll learn more about it when i'm less busy.

DmS
Paranoid (IV) Inmate

From: Sthlm, Sweden
Insane since: Oct 2000

posted posted 09-27-2002 09:43

Hi there JMJimmy.
I've been a long time advocate of separating design and code as far as possible, the way I do it nowadays is basically based on three sets of files, a db and a backend.

1. "main_include" that holds all php-functions that communicate with the database, these functions return the data in two-dimensional arrays.

2. "common_include" that holds functions specific to the presentation pages, menu generators, news functions, content functions and so on. These functions call for the db-functions, process the data into what I need in the final page using as little HTML as possible. This requires the "main_include"-file.

3. The presentation pages, these are basically straight HTML pages lacking menu, content, news and so on, these parts are replaced with function-calls from the "common_include" file. If need be, I can divide the presentation pages into different includes, header, footer, menu and so on.

4. All this relies on a flexible db-design based on pages, objects and properties with values. One page can hold several objects, each object can hold several properties. Example: Page 1 has three objects, one is text, one is images and the last is template; textobject holds the properties; heading, intro, maintext. Each propertys value holds the actual content. The same way with the imagesobject, those properties can hold path, descritpion, keywords, owner and so on. The templateobjects properties can hold what presentation page to use. As it is now I also handle users and permissiongroups in the db.

Finally I've got a generic backend that are supposed to allow admin of the data and pages of the site.
This way you can change the design of the site totally in a day by changing the html-pages and css and keep all the content "as is".
That's basically how I do it.
/Dan

{cell 260}
-{ a vibration is a movement that doesn't know which way to go }-

« BackwardsOnwards »

Show Forum Drop Down Menu