Menus & Navigation
|
|
|
|
<?php /*
* Breadcrumbs, version 1.02
* This code is copyright (c) Peter Bowyer, and is released
* under the lesser general public license (LGPL). Please leave this
* notice intact!
* This code was originally written for the F2S unofficial
* support site <http://www.users.f2s.com>
*
* If you modify the code, please let me know. I am always
* after improvements! Contact me at <peter@mapledesign.co.uk>
*
*/
// If your server doesn't support $HTTP_HOST variable, uncomment the lower
// variable, and enter your site name. Do not remove the trailing slash! $site = "http://".$HTTP_HOST."/"; // $site = "http://www.yoursite.com/";
// If you are on a windows machine you may have to alter this line. $str = $PHP_SELF;
ereg("^(.+)/.+\..+$", $str, $part); $str = $part[1]; $str = substr($str, 1);
// Define the names you want given to each of the directories
// e.g. directory test has the label Test which will be visible $label = array("test"=>"Test",
"faq"=>"FAQ/Tutorials",
"phorum"=>"Forums",
"links"=>"Links",
"asp2php"=>"ASP2PHP",
"whatsnew"=>"What's New",
"us"=>"Useful Stuff");
if (ereg("/", $str)){ $arr = split("/", $str); $num = count($arr);
for($i=0; $i < $num; ++$i){
echo(" > <a href="". $site . $arr[$i] ."/">".$label[$arr[$i]]."</a>");
$site = $site . $arr[$i] ."/";
}
}elseif (ereg("[a-zA-Z_]{1,}$",$str)){ $arr = $str;
echo(" > <a href="http://".$HTTP_HOST."/".$arr."/">".$label[$arr]."</a>"); }else{
echo("");
}
?>
|
|
|
Usage Example
|
<a href="http://www.users.f2s.com">Home</a> > <a href="http://www.users.f2s.com/whatsnew">What's New</a>
|
|
|
Rate This Script
|
|
|
|