时间:2021-07-01 10:21:17 帮助过:5人阅读
function catpos($catid, $symbol=' > '){
$category_arr = array();
$siteids = getcache('category_content','commons');
$siteid = $siteids[$catid];
$category_arr = getcache('category_content_'.$siteid,'commons');
if(!isset($category_arr[$catid])) {
$db = pc_base::load_model('module_model');
$info = $db->get_one('`module`=\''.$_GET['m'].'\'');
return $info['name'].' ';
}
$pos = '';
$siteurl = siteurl($category_arr[$catid]['siteid']);
$arrparentid = array_filter(explode(',', $category_arr[$catid]['arrparentid'].','.$catid));
foreach($arrparentid as $catid) {
$url = $category_arr[$catid]['url'];
if(strpos($url, '://') === false) $url = $siteurl.$url;
$pos .= ''.$category_arr[$catid]['catname'].''.$symbol;
}
return $pos;
}