Home  >  Article  >  Backend Development  >  phpcms v9中专题用的面包屑导航怎么写哟

phpcms v9中专题用的面包屑导航怎么写哟

WBOY
WBOYOriginal
2016-06-13 12:14:271168browse

phpcms v9中专题用的面包屑导航如何写哟
估计很多人会说用{catpos($catid)},告诉你吧,我试了,不行,因为前提是在专题里用.

当然换了{catpos($specialid)}
也不行,难道v9专题不能用面包屑的功能,非要二次开发吗!晕
这可是最起码的功能哈

好了,如果非要二次的话,请你给指条思路
------解决思路----------------------
catpos本来就是用来获取栏目路径的,专题不属于栏目。下面是我改的代码,觉得可以的话就拿去吧

<br />function catpos($catid, $symbol=' > '){<br />	$category_arr = array();<br />	$siteids = getcache('category_content','commons');<br />	$siteid = $siteids[$catid];<br />	$category_arr = getcache('category_content_'.$siteid,'commons');<br />	if(!isset($category_arr[$catid])) {<br />		$db = pc_base::load_model('module_model');<br />		$info = $db->get_one('`module`=\''.$_GET['m'].'\'');<br />		return $info['name'].'  ';<br />	}<br />	$pos = '';<br />	$siteurl = siteurl($category_arr[$catid]['siteid']);<br />	$arrparentid = array_filter(explode(',', $category_arr[$catid]['arrparentid'].','.$catid));<br />	foreach($arrparentid as $catid) {<br />		$url = $category_arr[$catid]['url'];<br />		if(strpos($url, '://') === false) $url = $siteurl.$url;<br />		$pos .= '<a href="'.$url.'">'.$category_arr[$catid]['catname'].'</a>'.$symbol;<br />	}<br />	return $pos;<br />}<br />

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn