Breadcrumbs help

From: Date: Wed, 19 Mar 2003 19:03:54 +0000
Subject: Breadcrumbs help
Groups: php.general 
Request: Send a blank email to php-general+get-140325@lists.php.net to get a copy of this message
hello all. this code creates dynamic breadcrumbs, ie: home > site nav > community I am having a bit of a time trying to make it so it doesn't hyperlink the current page thats being viewed, any help is appreciated. <? $LocationMappings = array( "view.php" => "site map", "company" => "about", "articles" => "news" ); function LocatorLine() { global $SCRIPT_NAME, $LocationMappings; $file=1; // 1 Doesn't show the file name, 0 Does $locationArray = explode("/",$SCRIPT_NAME); $locationHref = ""; echo '<span class="smalltext">:: <a href="/">main page</a></span>'; for($i=1; $i<count($locationArray)-$file; $i++) { if ( !empty($LocationMappings[$locationArray[$i]]) ) { $locationText = $LocationMappings[$locationArray[$i]]; } else { $locationText = ucwords($locationArray[$i]); //Uppercase letters } $locationHref .= "/" . $locationArray[$i]; echo "&nbsp;<b>&raquo;</b>&nbsp;<a href=\"$locationHref\">$locationText</a>"; } echo "\n"; } LocatorLine() ?> cheers, - Sebastian

« previous php.general (#140325) next »