时间:2021-07-01 10:21:17 帮助过:31人阅读
/** * 栏目标签 * @param $data */ public function category($data) { $data['catid'] = intval($data['catid']); $array = array(); $siteid = $data['siteid'] && intval($data['siteid']) ? intval($data['siteid']) : get_siteid(); $categorys = getcache('category_content_'.$siteid,'commons'); $site = siteinfo($siteid); $i = 1; foreach ($categorys as $catid=>$cat) { if($i>$data['limit']) break; if((!$cat['ismenu']) || $siteid && $cat['siteid']!=$siteid) continue; if (strpos($cat['url'], '://') === false) { $cat['url'] = substr($site['domain'],0,-1).$cat['url']; } if($cat['parentid']==$data['catid']) { $array[$catid] = $cat; $i++; } } return $array; }