PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Thu Aug 22, 2019 3:16 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Fri Sep 03, 2004 11:09 am 
Offline
Forum Regular
User avatar

Joined: Tue Jul 30, 2002 10:21 am
Posts: 852
Location: Trinidad, West Indies


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 03, 2004 12:13 pm 
Offline
Neighborhood Spidermoddy
User avatar

Joined: Mon Mar 29, 2004 4:24 pm
Posts: 31559
Location: Bothell, Washington, USA


Last edited by feyd on Fri Aug 26, 2005 11:53 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 05, 2004 4:56 pm 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13592
Location: New York, NY, US

_________________
(#10850)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 06, 2004 2:58 am 
Offline
DevNet Resident
User avatar

Joined: Tue Mar 16, 2004 11:03 am
Posts: 1425
Location: Aachen, Germany
There are actually two methods of storing trees in a database, the adjacency list model, and the modified preorder tree traversal algorithm. They are both listed with some examples on the following page:



For menus I would keep with the adjacency model (should not be too deep and so little recursion). If dealing with a complex multilevel structure I tend to use the other.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 06, 2004 5:03 am 
Offline
DevNet Master

Joined: Tue Jan 20, 2004 12:11 am
Posts: 4897
Location: Leuven, Belgium
This is the solution i prefer:


And there is even a PHP implementation:


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 06, 2004 6:45 am 
Offline
Forum Commoner

Joined: Wed May 21, 2003 6:16 pm
Posts: 46
As you have mentioned menuTrees. There is a very beautiful JS menu class, that helped me a lot building a tree [1]. Have a look !

Perhaps its of some use, (i.e. I wrote some very ugly recursive function to built a PHP File Explorer, that lists all dirs and files in a root dir) [2]

_yak

[1] http://www.destroydrop.com/javascripts/tree/
[2] http://upload.digidop.net/dirlist.php


Top
 Profile  
 
PostPosted: Mon Sep 06, 2004 9:47 am 
Offline
Forum Regular
User avatar

Joined: Tue Jul 30, 2002 10:21 am
Posts: 852
Location: Trinidad, West Indies


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group