if(страница != главная) {
echo 'Главная >';
}
if(страница...)
static public function get_breadcrumbs($url){
global $perfix,$db;
$bred.="<a href='/'>Главная</a>";
$url = $_SERVER['REQUEST_URI'];
$urls = explode("/",$url);
$geturl = "/";
$cu = count($urls);
for($c=0;$c++<=$cu-2;){
$breadcrumbs = $db->prepare("select * from `".$perfix."pages` where `name`=?");
$breadcrumbs->execute(array($urls[$c]));
$count = $breadcrumbs->rowCount();
if($count==0){
$bread = $db->prepare("select * from `".$perfix."catalog` where `url`=?");
$bread->execute(array($urls[$c]));
$row=$bread->fetch();
$r = $breadcrumbs->fetch();
print_r($r);
$geturl.=$row['url'];
$bred.="/ ".$row['name'];
}else{
$r = $breadcrumbs->fetch();
if(!$r['name']==""){
$geturl.=$r['name'];
$bred.="/ <a href='".$geturl."'>".$r['title']."</a>";
}
}
}
return $bred;
}