$attlist = 'typeid|0,row|20,cacheid|';
修改成
$attlist = 'typeid|0,row|20,cacheid|,channelid|';
2. 找到
//获得类别ID总数的信息
$typeids = array();
if($typeid==0 || $typeid=='top') {
$tpsql = " reid=0 AND ispart<>2 AND ishidden<>1 AND channeltype>0 ";
}
else
{
if(!preg_match('#,#', $typeid)) {
$tpsql = " reid='$typeid' AND ispart<>2 AND ishidden<>1 ";
}
else {
$tpsql = " id IN($typeid) AND ispart<>2 AND ishidden<>1 ";
}
}
在其后增加
if (!empty($channelid)) {
$tpsql .= " and channeltype in ($channelid)";
}
这个语句必须加在之后,
$dsql->SetQuery("SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
FROM `zuimoban_arctype` WHERE $tpsql ORDER BY sortrank ASC LIMIT $totalnum");
语句之前。 武林网标红了增加语句,请仔细比较,以免混淆!