> How do I make a Where am I bar ? How to plan and realize it ?
> Is someone out there who can help with that ?
Here is a snippet i use for my sites:
--- snippet ---
<?
// set the root topic
$roottopic = 14;
// set the current topic's id. this depends on
// wheter an article or a topic is being displayed currently.
if ($topic) {
$t = $topic->id;
} elseif ($article) {
$t = $article->topic;
}
if ($t) {
// topic or article is active
// walk through the topic tree up to the main topic (id=14)
while ($currtopic = mgd_get_topic($t)) {
if ($t==$roottopic) {
// if the main topic is reached, we'll display a like to the
// root page instead of a topic link
// this creates the appropriate HREF
$location = "<A href=\"/\" >Home</a> :: " . $location;
} else {
// if the topic is not the main topic we'll create a link to the
// /topic/ page
// this creates the appropriate HREF
$location = "<A href=\"/topic/" .$t . ".html\">" . $currtopic->name .
"</a> :: " . $location;
}
$t = $currtopic->up;
}
// now display the nifty breadcrumb bar
echo "$location";
} else {
// no topic or article active
// walk through the page tree up to the main page (ROOT)
function pwalk($id, $lev) {
if (!$id || !($p = mgd_get_page($id))) return;
pwalk($p->up,$lev+1);
for ($i=$lev;$i;$i--)
$url=$url . "../";
if ($url) printf('<a href="%s">',$url);
printf('%s', htmlentities($p->title));
if ($url) printf('</a> :: ');
}
pwalk($midgard->page.up,0);
}
?>
--- snippet ---
It's a slight modification of a function posted to this list earlier.
Daniel
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]