<var id="xvh3p"><noframes id="xvh3p"><var id="xvh3p"></var><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing>
<var id="xvh3p"><strike id="xvh3p"><var id="xvh3p"></var></strike></var><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<span id="xvh3p"><noframes id="xvh3p"><dl id="xvh3p"></dl>
<span id="xvh3p"><noframes id="xvh3p">
<dl id="xvh3p"><noframes id="xvh3p">
<listing id="xvh3p"><noframes id="xvh3p"><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<th id="xvh3p"><strike id="xvh3p"></strike></th>
<dl id="xvh3p"><noframes id="xvh3p">
<th id="xvh3p"><noframes id="xvh3p">

观点

互联网+时代,说建站,谈运营与网络营销

dedecms频道标签channel支持limit属性

时间:2020-12-15

先上调用标签

{dede:channel type='top' row='8' limit='0,1' currentstyle="<li><ahref='~typelink~'class='thisclass'>~typename~</a></li>"}<li><ahref='[field:typelink/]'>[field:typename/]</a></li>{/dede:channel}

相比默认的标签只是多了一个limit='0,1'属性,其效果就是调用0位置起始1条数据。

打开include\taglib\channel.lib.php,找到

$attlist = "typeid|0,reid|0,row|100,col|1,type|son,currentstyle|,cacheid|";修改为$attlist = "typeid|0,reid|0,row|100,col|1,type|son,currentstyle|,cacheid|,limit|";

然后在

$line=empty($row)?100:$row;

之后添加

//limit条件$limit=trim(preg_replace('#limit#is','',$limit));if($limit!=''){$limitsql=" LIMIT $limit ";}else{$limitsql=" LIMIT 0,$line ";}最后批量查找limit0,$line

替换为

$limitsql

至此完成。

0
首页
案例
关于
联系