06-18-2008, 01:42 AM
|
#5 (permalink)
|
|
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
|
There's a lot of different ways you could go about it. I think he's referring to a method of using the URI to build a breadcrumb, not one based on any database. Off the top of my head,
PHP Code:
function crumby ($szCurPage, $szSeperator='»', $szRoot=NULL) { $aPath = explode('/', $_SERVER['REQUEST_URI']);
$szTrail = (isset($szRoot)) ? 'http://'.$szRoot.'/' : 'http://'.$_SERVER['HTTP_HOST'].'/';
$szReturn = ' <a href="'.$szTrail.'">Home</a> '.$szSeperator;
$intLoop = count($aPath)-1;
for($i=1; $i < $intLoop; $i++) {
$szTitle = ucwords(str_replace('_', ' ', $aPath[$i])); $szTrail .= $aPath[$i].'/';
$szReturn .= ' <a href="'.$szTrail.'">'.$szTitle.'</a> '.$szSeperator; }
$szReturn .= ' <strong>'.$szCurPage.'</strong>';
return $szReturn; }
echo crumby('You Are Here!');
This method wouldn't work well with unreadable URI's, but it's a start.
-m
|
|
|
|