Web Environment
So, how do I work this? The php scripts are still under construction. Eventually this will run as a multi-styled multi-homed environment. But for now
please restrain yourself to using one style/home.
Directory Structure From the webhome there are a few directories that need explanation..
- home dir - This is the current webhome (named appropriately). All documents should be placed in this directory.
- images - An image directory - good for general images or images used in multiple locations. (Though, sometimes it's
better to leave images in the same directory as the webpage.)
- php - Holds useful php libraries/include files.
- js - Holds useful javascript files.
- style - Contains encapsulated include files that define the look and feel of the webpage. Subdirectories exist for each style defined.
Currently the only style is aei. Under the aei directory there is a php script called style-lib.php that actually creates the webpage.
The theory here is that I can change the display of a webpage without affecting content or vice versa.
The index.php file All called documents are pulled through the index.php program.
The link will look something like http://www.aei.on.ca/index.php/style/directory/file.htm.
Notice a couple of things in the link. First, the style is specified after the index.php. When changing style definitions we can simply
modify the link in the browser to change how the page looks. (Maybe we can use this for a secure/admin config or for having multiple
sites hitting the same content without a lot of coding.
File Naming Conventions Since index.php is calling the body for each page, and since I don't have unlimited programming
time, the body page (ie. the file that holds the body text for the webpage) needs to follow a very specific format.
First, the page must be named *.htm. It's gotta be ".htm". That's all I'm looking for. (Keep in mind, this will be included into
index.php, so it can contain php code. [yay])
Second, the information defining a directory is contained in the index.htm file for that directory. So, you really should have one.
(I intend to create a function that will list all items in a directory with images and descriptions as needed. It's in the pipe.)
PHP Variables in the Body Page Each page needs to have some variables set for the index.php and other routines. Instead of getting
into a detailed description, I'll just give the example of what was used for this page...
<!--PHP
$prog_author="David Rutherford";
$prog_email="druther@aei.on.ca";
$prog_name="Web Environment";
$prog_title="How to use this web environment";
$prog_desc="Instructions on how to setup and maintain the current web environment.";
$prog_keywords="";
$prog_hide=0; //Hide this page in the menu? 0-no, 1-yes
$prog_order=10; //Listing order in the menu
$prog_image=""; //address of an image to associate with this page.. Not yet used
PHP-->
|
So, index.php grabs the *.htm files extracts the variables defined above and builds the webpage environment around the page.
So far, so good. This way I don't need to program menus or descriptions, links, help, navigation keys, etc. It's all contained in index.php and it's supporting functions.
If you're interested in building your website using my PHP code please contact me.
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|