Hi Ian,
I don't know if I'm getting the hole idea of what you're looking for,
but here's something. I'm using a schema that was written by Ying Zhang
for the "myMarket" PHP application which is like this:
a) One "main file" which holds all the site's configurations, like DB
settings and golbals (OO Script). It also contains an object that will
call the scripts locations:
[snip]
/* define a generic object */
class object {};
/* setup the configuration object */
$CFG = new object;
$CFG->dbhost = "localhost";
$CFG->dbname = "dbname";
$CFG->dbuser = "dbuser";
$CFG->dbpass = "dbpassword";
$CFG->wwwroot = "/directory";
$CFG->dirroot = "/directory";
$CFG->templatedir = "$CFG->dirroot/templates"; // Here's your standard
files
$CFG->libdir = "$CFG->dirroot/lib"; // Lib for DB & custom handling
$CFG->imagedir = "$CFG->wwwroot/images";
[snip]
b) When every page is called (i.e. /news/index.php), all the files
required to make that page look like you want to, all the "templates"
are called like this:
include("mainfile.php"); // needed before any else
include("logobanner.php");
include("navbar.php");
include("leftmenu.php");
// HERE'S YOUR PAGE'S CONTENT
include("rightmenu.php");
include("copyright.php");
I'm using this schema every since I found it, 'cause it is teaching me A
LOT and is very handy when I need to change something like the header of
footer of a hole site.
Hope this helps you.
Cesar Aracena
Neuquen, Argentina.
> -----Mensaje original-----
> De: Randum Ian [mailto:[EMAIL PROTECTED]]
> Enviado el: S�bado, 15 de Junio de 2002 04:42 p.m.
> Para: PHP
> Asunto: [PHP] Can I use a template with this site?
>
> Hi All, Hope you are all well.
>
> I am coding a website for a client and they involve a series of files:
>
> logobanner.php
> navbar.php
> leftmenu.php
> main.php
> rightmenu.php
> copyright.php
>
> These are all just simple HTML files which are placed in a Global dir
> apart
> from main.php which is in the same dir as the index.php file. Is there
a
> way
> where I can have one index.php file which calls all the Global files
and
> only the relevant main.php file? Kind of like a simple template
system?
>
> For example at the moment I have this for my dir pattern:
>
> /global/
> -logobanner.php
> -navbar.php
> -leftmenu.php
> -rightmenu.php
> -copyright.php
> /home/
> -index.php
> -main.php
> /news/
> -index.php
> -main.php
>
> When /news/index.php is called, all the global files are called along
with
> the main.php that is in the News dir, the same for all the others in
their
> respective dirs.
>
> Am I overlooking an important function or script that can do this
without
> being too complicated?
>
> Please let me know, Ian.
> ---
> Randum Ian
> DJ / Reviewer / Webmaster, DancePortal (UK) Limited
> [EMAIL PROTECTED]
> http://www.danceportal.co.uk
> DancePortal.co.uk - Global dance music media
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php