让dede:channelartlist支持channelid调用。 如:{dede:channelartlist channelid='1'}
解决:打开include/taglib/channelartlist.lib.php
1. 找到代码
//处理标记属性、innertext
$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");
语句之前。 织梦58标红了增加语句,请仔细比较,以免混淆!