View Single Post
Old 06-15-2008, 04:20 PM   #2 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by Aaron View Post
Yeah... It just doesn't feel like this is the right way.

I serialize an array of the home/category/.../page breadcrumbness, and then I do this... It just doesn't seem like the right method. Any help?
PHP Code:
// Develop the breadcrumb Navigation
  
public function getLocation($location) {
  
  
//Unserialize the location array.
  
$location unserialize($location);
  
$return ' ';
  foreach (
$location as $url => $title) {
    if (
$url != 'current') {
      if (
$url == ROOT) {
          
$title '<img src="'.ROOT.'resources/images/house_go.gif" alt="Go to the home page" />';
      }
      
$return .= '<a href="' $url '">' $title '</a> » ';
    }
    else {
      
// Caps insensitive
      
if (strtolower($title) == 'home'){
          return 
'<img src="'.ROOT.'resources/images/house.gif" alt="You are at the home page" />';
      }
      
$return .= $title;
    }
  }
  return 
$return
  } 
First off, you haven't declared $location as an array yet, it doesn't even try to validate it as an array, which could be something wrong, plus unserialize only works on strings.

Now, breadcrumbs are just links on a navbar correct?
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote