打开/include/taglib/channelartlist.lib.php文件
找到
$attlist= 'typeid|0,row|20,cacheid|';
改成
$attlist= 'typeid|0,row|20,cacheid|,limit|';
找到
$dsql->SetQuery”
在它前面加入
$limit= trim(preg_replace('#limit#is', '', $limit));
if($limit!='') $limitsql= " LIMIT $limit ";
else$limitsql= " LIMIT 0,$totalnum";
找到
$dsql->SetQuery("SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,
siteurl,sitepath FROM `zmb_arctype` WHERE $tpsqlORDER BY sortrank ASC LIMIT $totalnum");
改成
$dsql->SetQuery("SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,
moresite,siteurl,sitepath FROM zmb_arctype WHERE $tpsql ORDER BY sortrank ASC $limitsql");
前端调用
{dede:channelartlist limit='0,1'}{/dede:channelartlist}