时间:2021-07-01 10:21:17 帮助过:23人阅读
catpos本来就是用来获取栏目路径的,专题不属于栏目。下面是我改的代码,觉得可以的话就拿去吧
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;}
catpos本来就是用来获取栏目路径的,专题不属于栏目。下面是我改的代码,觉得可以的话就拿去吧
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;}
catpos本来就是用来获取栏目路径的,专题不属于栏目。下面是我改的代码,觉得可以的话就拿去吧
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;}
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])) return ''; $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;}
catpos本来就是用来获取栏目路径的,专题不属于栏目。下面是我改的代码,觉得可以的话就拿去吧
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;}
catpos本来就是用来获取栏目路径的,专题不属于栏目。下面是我改的代码,觉得可以的话就拿去吧
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;}