home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
mcgregor.k12.mn.us
/
www.mcgregor.k12.mn.us.tar
/
www.mcgregor.k12.mn.us
/
crumbs.php
< prev
next >
Wrap
Text File
|
2010-09-07
|
1KB
|
45 lines
<link href="style.css" rel="stylesheet" type="text/css" />
3<?php
function breadCrumb($PATH_INFO) {
global $page_title, $root_url;
// Remove these comments if you like, but only distribute
// commented versions.
// Replace all instances of _ with a space
$PATH_INFO = str_replace("_", " ", $PATH_INFO);
// split up the path at each slash
$pathArray = explode("/",$PATH_INFO);
// Initialize variable and add link to home page
if(!isset($root_url)) { $root_url=""; }
$breadCrumbHTML = '<p></p><a href="'.$root_url.'/" title="Home Page" >Home</a> ';
// initialize newTrail
$newTrail = $root_url."/";
// starting for loop at 1 to remove root
for($a=1;$a<count($pathArray)-1;$a++) {
// capitalize the first letter of each word in the section name
$crumbDisplayName = ucwords($pathArray[$a]);
// rebuild the navigation path
$newTrail .= $pathArray[$a].'/';
// build the HTML for the breadcrumb trail
$breadCrumbHTML .= '<a href="'.$newTrail.'">'.$crumbDisplayName.'</a class="LgBodyBold"> > ';
}
// Add the current page
if(!isset($page_title)) { $page_title = "Current Page"; }
$breadCrumbHTML .= '<p> <strong>'.$page_title.'</strong></p>';
// print the generated HTML
print($breadCrumbHTML);
// return success (not necessary, but maybe the
// user wants to test its success?
return true;
}
?>