默认的排序主要有
{dede:arclist orderby=''}
[field:title/]
{/dede:arclist}
orderby='sortrank' 文档排序方式
orderby='hot' 或 orderby='click' 表示按点击数排列
orderby='sortrank' 或 orderby='pubdate' 按出版时间排列
orderby='near'
orderby='lastpost' 按最后评论时间
orderby='scores' 按得分排序
orderby='id' 按文章ID排序
orderby='rand' 随机获得指定条件的文档列表
{dede:likearticle}却没有orderby这个功能。
下面是修改方法
打开/include/taglib/likearticle.lib.php文件
找到
if( empty($arcid) || $byabs==0 ) {$orderquery = " order by arc.id desc ";}else {$orderquery = " order by ABS(arc.id - ".$arcid.") ";}
改成
if($orderby=='hot' || $orderby=='click') $orderquery = " order by arc.click $orderWay";else if($orderby == 'sortrank' || $orderby=='pubdate') $orderquery = " orderby arc.sortrank $orderWay";else if($orderby == 'id') $orderquery = " order by arc.id $orderWay";else if($orderby == 'near') $orderquery = " order by ABS(arc.id - ".$arcid.")";else if($orderby == 'lastpost') $orderquery = " order by arc.lastpost $orderWay";else if($orderby == 'scores') $orderquery = " order by arc.scores $orderWay";else if($orderby == 'rand') $orderquery = " order by rand()";else if($orderby == 'weight') $orderquery = " order by arc.weight asc";//如果没有特定设置排序则按照权重先排序else $orderquery = " order by arc.sortrank $orderWay";