global $MODULE, $db;
if(!$CAT) return '';
$arrparentids = $CAT['catid'];
$arrparentid = explode(',', $arrparentids);
$pos = '';
$target = $target ? ' target="_blank"' : '';
$CATEGORY = array();
$result = $db->query("SELECT catid,moduleid,catname,linkurl FROM {$db->pre}category WHERE catid=($arrparentids)");
while($r = $db->fetch_array($result)) {
$CATEGORY[$r['catid']] = $r;
}
foreach($arrparentid as $catid) {
if(!$catid || !isset($CATEGORY[$catid])) continue;
$pos .= ''.$CATEGORY[$catid]['catname'].'';
}
return $pos;
}
在include/global.func.php里面插入这段代码,前台可以用{cat_name($CAT)}来获取当前栏目名称