织梦dede:flink标签支持limit属性的方法

打开 /include/taglib/flink.lib.php 文件

找到

$attlist="type|textall,row|24,titlelen|24,linktype|1,typeid|0";

修改为

$attlist="type|textall,row|24,titlelen|24,linktype|1,typeid|0,limit|0,10";

找到

$equery = "SELECT * FROM dede_flink $wsql order by sortrank asc limit 0,$totalrow";

修改为

if(!$limit){

        $equery = "SELECT * FROM dede_flink $wsql order by sortrank asc limit 0,$totalrow";

    }else{

        $equery = "SELECT * FROM dede_flink $wsql order by sortrank asc limit $limit";

    }

调用法:

{dede:flink limit='0,7' type='text' titlelen="24"  typeid="0"}[field:link /]{/dede:flink}

{dede:flink limit='7,7' type='text' titlelen="24"  typeid="0"}[field:link /]{/dede:flink}

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/a5474dda8072cb76aae7ef67b047ecca.html