OT? super included needed....
| From: | Soulhuntre | Date: | Wed, 10 May 2000 10:05:00 +0000 |
| Subject: | OT? super included needed.... | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-14719@lists.php.net to get a copy of this message | ||
Hiya :)
The last time I had a fast question like this, this list was kind enough to
help me out - in fact I contracted a PHP programmer from a reply to my last
desperat need :)
Hopefully, this is not too off topic, if so, I will not post any future
questions here in this way.
One of the reasons to put it HERE is that this is the best place to find
PHP4 savvy people...
Why post?
=========
I am fairly sure someone has one of these floating around out there!
The problem
===========
I want to be able to "include" files into my webpages, but also maintain the
ability to over-ride the files if need be.
So, consider....
/
index.html
snippets/
menu.html
footer.html
department1/
index.html
people.html
department2/
index.html
costs.html
snippets/
menu.html
inventory/
index.html
Postulate a function, called "super_include( filename, extradir )" where
filename was something to be found ( menu.html? ) and extradir was the name
of a optional supplemental directory ( snippets ).
In the case of /department2/inventory/index.html, super_include(
'menu.html', 'snippets' ) should find and include
/department2/snippets/menu.html.
In the case of /department2/inventory/index.html, super_include(
'footer.html', 'snippets' ) should find and include /snippets/footer.html.
In the case of /department1/index.html, super_include( 'footer.html',
'snippets' ) should find and include /snippets/footer.html.
In theory, this could nest rather deeply, with each file picking up the
element "deepest" that satisfies the needs if super_include.
In a perfect world, it would do this in URL-space, not filesystem-space so
that it woudl know enough to stop at the top level of the website... BUT if
if had to happen at the filesystem level (the directory functions) a config
file could define the highest level to go to.
Ken
---
Soulhuntre
(icq# 275066)
http://www.soulhuntre.com - my world
http://www.dotpublishing.com - my income
http://www.virtualchemy.com - my company
http://www.the-estate.com - my passion