Reply to Re: idea/ concept behind creating breadcrumbs

Your name:

Reply:


Posted by Rik on 10/30/28 11:53

rlee0001 wrote:
> Well if you have a database then that would be a good place to start.
> If you are not currently using a database you could store the
> relationships in an include file and include_once it into each page.
>
> For a database I would do something like:
>
> "id","pagename","parent_id"
> 1,"Home",0
> 2,"Introduction",1
> 3,"History",1
> 4,"Timetable",1
> 5,"Semester1",4
> 6,"Semester2",4
> ...
>
> Then use a recursive function to "walk" up and down the tree:
>
> function printnode($node) {
> if ($node->parent_id) {
> printnode(getNode($node->parent_id));
> }
> echo $node->pagename;
> return;
> }

If you want breadcrumbs, with a hierarchical table, it might be worth it to
use the nested set model instead of the adjacency model:

http://dev.mysql.com/tech-resources/articles/hierarchical-data.html

Grtz,
--
Rik Wasmus

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация