[PHP] RE: How should I do this site...?

2001-12-19 Thread Philip Hallstrom

unset will unset a varialbe.  In the case I had I used to make sure that
my $subAry was being unset before using it (I use it several places since
several sections had sub sections).

And yes, you can nest this as deep as you want since it is really just a
tree.  You start at the top and walk all the way down...

And yes, you could generate a navbar (or breadcrumbing).  As you walk the
tree just append the name to say $breadcrumb and then you'd have it.

-philip

On Wed, 19 Dec 2001, Martin Hughes wrote:

> Thank you!
>
> What is the point of using "unset" here (sorry - newbie question I know but
> I'm learning all the time :o))
>
> Is it possible therefore to create more than 2 levels this way? If my
> heirachy goes 3 or 4 levels deep in some places? And could I also get a
> navbar to be generated dynamically from it (on my site the  of the
> page, , the  text for the heading image, and the nav bar
> entry will all be the same, with the exception of the  also having
> the other levels in it, for example (3 levels deep):
> The Music of Les Miserables | Synthesizers | Korg Triton
>
> Thanks,
>
> Martin
>
> =
> Assistant Musical Director "Crazy For You" - February 2002
> 177 Hull Road, York YO10 3JY
> 07815 151 970 / 01904 427 537
> [EMAIL PROTECTED] / [EMAIL PROTECTED]
> =
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] RE: How should I do this site...?

2001-12-19 Thread Martin Hughes

Thank you!

What is the point of using "unset" here (sorry - newbie question I know but
I'm learning all the time :o))

Is it possible therefore to create more than 2 levels this way? If my
heirachy goes 3 or 4 levels deep in some places? And could I also get a
navbar to be generated dynamically from it (on my site the  of the
page, , the  text for the heading image, and the nav bar
entry will all be the same, with the exception of the  also having
the other levels in it, for example (3 levels deep):
The Music of Les Miserables | Synthesizers | Korg Triton

Thanks,

Martin

=
Assistant Musical Director "Crazy For You" - February 2002
177 Hull Road, York YO10 3JY
07815 151 970 / 01904 427 537
[EMAIL PROTECTED] / [EMAIL PROTECTED]
=


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: How should I do this site...?

2001-12-19 Thread Philip Hallstrom

I just did this for a site awhile back.  All the pages use the same
template, but you could modify pretty easily.Build out an array like
the one below that defines your entire site heirarchy.  In my example, I
set the url, title, alttext (for the image button), the image name (for
javascript rollovers), urls to active/inactive states for the button, and
an option image header.  The example below would create a primary
navigation consisting of "home" and "products" and products would have a
sub nav of the latter three elements.  You could easily add a "template"
variable to control what template to use.

Each of my pages then sets a variable for where it is (ie
"/products/howitworks") which is passed to a function that builds the
template, and the navigation, etc... works all right for me.

$navAry['home']->url = "/";
$navAry['home']->title = "Foobar, LLC.";
$navAry['home']->alttext = "Home";
$navAry['home']->imgname = "btn_home";
$navAry['home']->img_a = "/img/btn_home_a.gif";
$navAry['home']->img_i = "/img/btn_home_i.gif";

$navAry['products']->url = "/products/";
$navAry['products']->title = "Foobar | Products";
$navAry['products']->header = "/img/hdl_product.gif";
$navAry['products']->alttext = "The Product";
$navAry['products']->imgname = "btn_products";
$navAry['products']->img_a = "/img/btn_products_a.gif";
$navAry['products']->img_i = "/img/btn_products_i.gif";


unset($subAry);
$subAry['howitworks']->url = "/products/howitworks.php";
$subAry['howitworks']->title = "Foobar | Products | How it Works";
$subAry['howitworks']->header = "/img/hdl_product_howitworks.gif";
$subAry['howitworks']->alttext = "How it Works";
$subAry['howitworks']->imgname = "btn_products_howitworks";
$subAry['howitworks']->img_a = "/img/btn_sub_howitworks_a.gif";
$subAry['howitworks']->img_i = "/img/btn_sub_howitworks_i.gif";

$subAry['security']->url = "/products/security.php";
$subAry['security']->title = "Foobar | Products | Security";
$subAry['security']->header = "/img/hdl_product_security.gif";
$subAry['security']->alttext = "Security";
$subAry['security']->imgname = "btn_products_security";
$subAry['security']->img_a = "/img/btn_sub_security_a.gif";
$subAry['security']->img_i = "/img/btn_sub_security_i.gif";

$subAry['isplicensing']->url = "/products/isplicensing.php";
$subAry['isplicensing']->title = "Foobar | Products | ISP Licensing";
$subAry['isplicensing']->header = "/img/hdl_product_isp.gif";
$subAry['isplicensing']->alttext = "ISP Licensing";
$subAry['isplicensing']->imgname = "btn_products_isplicensing";
$subAry['isplicensing']->img_a = "/img/btn_sub_isp_licns_a.gif";
$subAry['isplicensing']->img_i = "/img/btn_sub_isp_licns_i.gif";

$navAry['products']->sub = $subAry;

On Wed, 19 Dec 2001, Martin Hughes wrote:

> Heya,
>
> OK - I have a site I've been working on on and off for a while. It started
> as a static page, then I changed it so it uses php. This was great - until I
> started putting content in the design. I now have about 300 *.inc files for
> the site, and updating them is a joke!
>
> The site is designed in a heirachical way:
>
> Top
>   Section 1
> id 1
> id 2
> id 3
> id 4
>   Section 2
> id 1
> id 2
> id 3
>   Section 3
> id 1
> id 2
> id 3
> id 4
> etc...
>
> I'm using 1 file for the code - index.php?sect=XX&id=XX and the nav menus
> are dynamically generated and populated on the page along with the content
> which is filled by an inc file in directory: root/php/"sectname"/"id".inc
> where "sectname" is the name of a section defined in an array in index.php
> (eg, section 6 is "synthesizers"). The images and headings on the page are
> also dynamically generated (images have a number eg "2.jpg" for the heading
> of section 2 etc.)
>
> In sections 6 though, ids 2-6 are based on one template, so i have 5 files:
> 2.inc, 3.inc, ... 6.inc all exactle the same, just containing  require_once('php/synthesizers/template.inc') ?>
> This seems somewhat stupid.
>
> Oer X-Mas & New Year, I want to entirely recodethe site so it is more "user
> friendly" for me to maintain. I am slowly getting better and better at php
> so it should be good.
>
> Does ANYONE have any pointers as to how to start and do this thing. Any
> ideas for how my site should be layed out (directory-wise etc - is it easier
> to have 1 directory per section and hold everything in it - images included,
> or is it best to have a separate img/ directory??).
>
> many thanks all - Seasons greets!!
>
> Martin
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-m