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

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

WBOY
Release: 2016-06-13 12:14:27
Original
1222 people have browsed it

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 />
Copy after login

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template