Re: Breadcrumbs help
| From: | Sebastian | Date: | Wed, 19 Mar 2003 19:47:12 +0000 |
| Subject: | Re: Breadcrumbs help | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-140333@lists.php.net to get a copy of this message | ||
well, the problem with that is most of my files are called 'index.php'
cheers,
- Sebastian
----- Original Message -----
From: "Diego Fulgueira" <diegoful@prodigy.net.mx>
| Sebastian wrote:
| > 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 " <b>»</b> <a
| > href=\"$locationHref\">$locationText</a>";
| > }
| > echo "\n";
| > }
| >
| > LocatorLine()
| > ?>
| >
| > cheers,
| > - Sebastian
|
| I would have an array for directories and another for files. Putting all
in
| the same array makes it messy. Cheers.
|