//指定了多个栏目时,不再获取子类的id if( preg_match('#,#', $typeid) ) //如果typeid字段匹配逗号, 就是说typeid调用多个栏目,例如:typeid=“2,3,8”
{
//指定了getall属性或主页模板例外
if($getall==1 || empty($refObj->Fields['typeid']))
{
$typeids = explode(',', $typeid);
foreach($typeids as $ttid) {
$typeidss[] = GetSonIds($ttid);
}
$typeidStr = join(',', $typeidss);
$typeidss = explode(',', $typeidStr);
$typeidssok = array_unique($typeidss);
$typeid = join(',', $typeidssok);
}
$orwheres[] = " arc.typeid IN ($typeid)"; //导致typeid='2,3,8'情况下不能调用副栏目问题产生的地方
}
else //如果typeid不匹配逗号,就是调用一个栏目 例如 typeid="2"
{
//处理交叉栏目
$CrossID = '';
if($ctag->GetAtt('cross')=='1')
{
$arr = $dsql->GetOne("SELECT `id`,`topid`,`cross`,`crossid`,`ispart`,`typename` FROM `dede_arctype` WHERE id='$typeid' ");
if( $arr['cross']==0 || ( $arr['cross']==2 && trim($arr['crossid']=='') ) )
{
$orwheres[] = ' arc.typeid IN ('.GetSonIds($typeid).')';
}
else
{
$selquery = '';
if($arr['cross']==1) {
$selquery = "SELECT id,topid FROM `dede_arctype` WHERE typename LIKE '{$arr['typename']}' AND id<>'{$typeid}' AND topid<>'{$typeid}' ";
}
else {
$arr['crossid'] = preg_replace('#[^0-9,]#', '', trim($arr['crossid']));