"You are here" navigation

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

magicrobotmonkey
Forum Regular
Posts: 888
Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA

Post by magicrobotmonkey »

you could use a db-based session handler rather than a cookie - that is, for the session keep track of which pages have been visited in a table lwith SESSID ORDER URL where order is an autoinc that keeps track of the page.
theperfectdrug
Forum Newbie
Posts: 24
Joined: Tue May 25, 2004 10:15 am

Post by theperfectdrug »

hm......... :roll:
User avatar
NewfieBilko
Forum Contributor
Posts: 189
Joined: Sun Jun 06, 2004 6:45 pm
Location: Newfoundland
Contact:

Post by NewfieBilko »

that actually seems like a good idea monkey.

Make a session array, which will store all the pages the user has viewed.

You still need a hirarchial structure howeever to tell which pages should be displayed if on a given page however. Or maybe I need you to elaberate a bit
User avatar
NewfieBilko
Forum Contributor
Posts: 189
Joined: Sun Jun 06, 2004 6:45 pm
Location: Newfoundland
Contact:

Post by NewfieBilko »

hmmm, yea make a sessionID ORDER URL which will allow only Pages with Lower then the page your on now to be Outputed for link
theperfectdrug
Forum Newbie
Posts: 24
Joined: Tue May 25, 2004 10:15 am

Post by theperfectdrug »

session, I'll try to do somethin' else instead. :)
User avatar
NewfieBilko
Forum Contributor
Posts: 189
Joined: Sun Jun 06, 2004 6:45 pm
Location: Newfoundland
Contact:

Post by NewfieBilko »

LOL whatever you do man, help me do it too cause i need the same thing
User avatar
NewfieBilko
Forum Contributor
Posts: 189
Joined: Sun Jun 06, 2004 6:45 pm
Location: Newfoundland
Contact:

Post by NewfieBilko »

or just send me your source ;) LOL
theperfectdrug
Forum Newbie
Posts: 24
Joined: Tue May 25, 2004 10:15 am

Post by theperfectdrug »

or just send me your source LOL
sure.

copy and paste... :D

Code: Select all

<?php ?>
p.s. check this out: http://forums.devshed.com/showthread.php?t=133041
User avatar
NewfieBilko
Forum Contributor
Posts: 189
Joined: Sun Jun 06, 2004 6:45 pm
Location: Newfoundland
Contact:

Post by NewfieBilko »

LOL nice page, this seems pretty good, did you use what those people had to say to your benifit? Have you implimented any of there code yet?

If so, post some up here already :)

PS: IM a greedy, code hordeing , mongrel
theperfectdrug
Forum Newbie
Posts: 24
Joined: Tue May 25, 2004 10:15 am

Post by theperfectdrug »

Have you implimented any of there code yet?
not yet. I've decided to search php forums over the net to find some info about breadcrumbs...so i'm still in search, maybe u'll do the same and together we will find somethin that will help us both. :roll:

I found some useful links so if you are interested I can send them to you. :)
magicrobotmonkey
Forum Regular
Posts: 888
Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA

Post by magicrobotmonkey »

can you describe what you mean by breadcrumb navigation. Do you mean you want to have a "back" button on the page itself rather than using the browsers?
theperfectdrug
Forum Newbie
Posts: 24
Joined: Tue May 25, 2004 10:15 am

Post by theperfectdrug »

breadcrumbs navigation is somethin' like this:
Home > Section 1 > sub_section 2 :)
User avatar
NewfieBilko
Forum Contributor
Posts: 189
Joined: Sun Jun 06, 2004 6:45 pm
Location: Newfoundland
Contact:

Post by NewfieBilko »

I have the following table for category/sub category :

CategoryID - int
Title - varchar
ParentCatID - int

CategoryID | Title | ParentCatID
---------- ------ ---------
1 | Foo | 1
2 | Foo Child | 1
3 | Foo Child Child | 2


I would like to dynamically create a list of links at the top of each page that will reflect how deep into the site the user is and give the user the ability to click on a link to return several layers back

For example if i have reached the Foo Child Child category, the navigation should display :

Home > Foo > Foo Child > Foo Child Child

(Home is a constant which can be hardcoded)
Any idea of a code or pseudo how i can do this loop. Bear in mind that each time i load the page i can get the CategoryID of the page i am in.

root/level1/section2/layer3/chapter4

If you have the ID of chapter4, then you need to query the database to find the parent of chapter4, layer3. You then need to query to find the parent of layer3, and so on as you move up the tree. In this example, it would require 4 queries (assuming the root level is hard coded).
Last edited by NewfieBilko on Thu Jul 08, 2004 1:51 pm, edited 1 time in total.
theperfectdrug
Forum Newbie
Posts: 24
Joined: Tue May 25, 2004 10:15 am

Post by theperfectdrug »

NewfieBilko loool
User avatar
NewfieBilko
Forum Contributor
Posts: 189
Joined: Sun Jun 06, 2004 6:45 pm
Location: Newfoundland
Contact:

Post by NewfieBilko »

I know you <3 me, now just gimme your source, or sex ;)
Post Reply