文章页调用面包屑
PHP
当前位置:<a href="{$host}">首页</a>{php}$html='';function navcate($id){ global $html; $cate = new Category; $cate->LoadInfoByID($id); $html ='>> <a href="' .$cate->Url.'" title="查看' .$cate->Name. '中的全部文章">' .$cate->Name. '</a> '.$html; if(($cate->ParentID)>0){navcate($cate->ParentID);}}navcate($article->Category->ID);global $html;echo $html;{/php}
分类页调用面包屑
PHP
当前位置:<a href="{$host}">首页</a>{php}$html='';function navcate($id){ global $html; $cate = new Category; $cate->LoadInfoByID($id); $html ='>> <a href="' .$cate->Url.'" title="查看' .$cate->Name. '中的全部文章">' .$cate->Name. '</a> '.$html; if(($cate->ParentID)>0){navcate($cate->ParentID);}}navcate($category->ID);global $html;echo $html;{/php}
2个合成一个
PHP
当前位置:<a href="{$host}">首页</a>{php}$html='';function navcate($id){ global $html; $cate = new Category; $cate->LoadInfoByID($id); $html ='>> <a href="' .$cate->Url.'" title="查看' .$cate->Name. '中的全部文章">' .$cate->Name. '</a> '.$html; if(($cate->ParentID)>0){navcate($cate->ParentID);}}if($type=='category'){ navcate($category->ID);}elseif($type=='article'){ navcate($article->Category->ID);}global $html;{if $type!='category'}>> {$title}{/if}{/php}>> {$title}