织梦dedecms在使用LIST标签时,orderby=weight 按权重排序无效问题 ,下面言归正传。
1:找到list解析文件include/arc.listview.class.php
发现排序规则里面并没有按照weight排序的判断,于是乎修改程序加入排序规则
05 | if ($orderby== "senddate" || $orderby== "id" ) { |
07 | $ordersql= " order by arc.id $orderWay" ; |
11 | else if ($orderby== "hot" || $orderby== "click" ) { |
13 | $ordersql = " order by arc.click $orderWay" ; |
17 | else if ($orderby== "lastpost" ) { |
19 | $ordersql = " order by arc.lastpost $orderWay" ; |
23 | else if ($orderby== "weight" ) { |
25 | $ordersql = " order by arc.weight $orderWay" ; |
31 | $ordersql= " order by arc.sortrank $orderWay" ; |
|
同时修改条件 if(ereg('hot|click|lastpost',$orderby)) 为 if(ereg('hot|click|lastpost|weight',$orderby)) 。
另外arclist 对weight的排序也不准确,需要加上一个isweight的属性
{dede:arclist typeid='32' pagesize='20' isweight='Y' orderby='weight' orderway='asc'} 。
发表评论
评论列表(0条)