首先要记住权重排序的标签是:orderby=‘weight’
DEDE 5.7 首页【arclist】增加按权重排序
在织梦系统中找到以下目录\include\taglib中的arclist.lib.php文件并打开;
大约在170行找到
$innertext='', $arcid=0, $idlist='', $channelid=0, $limit='', $att='', $order='desc', $subday=0, $noflag='',$tagid='', $pagesize=0, $isweight='N')
把这里的$isweight='N'
改为$isweight='Y'
大约在340行上面找到
微信号:gaogaojie5
添加微信好友, 获取更多信息
复制微信号
添加微信好友, 获取更多信息
复制微信号
//文档排序的方式 $ordersql = ''; if($orderby=='hot' || $orderby=='click') $ordersql = " ORDER BY arc.click $orderWay"; else if($orderby == 'sortrank' || $orderby=='pubdate') $ordersql = " ORDER BY arc.sortrank $orderWay"; else if($orderby == 'id') $ordersql = " ORDER BY arc.id $orderWay"; else if($orderby == 'near') $ordersql = " ORDER BY ABS(arc.id - ".$arcid.")"; else if($orderby == 'lastpost') $ordersql = " ORDER BY arc.lastpost $orderWay"; else if($orderby == 'scores') $ordersql = " ORDER BY arc.scores $orderWay"; //功能:增加按好评数和差评数调用 else if($orderby == 'goodpost') $ordersql = " order by arc.goodpost $orderWay"; else if($orderby == 'badpost') $ordersql = " order by arc.badpost $orderWay"; else if($orderby == 'rand') $ordersql = " ORDER BY rand()"; else $ordersql = " ORDER BY arc.sortrank $orderWay";
改为
//文档排序的方式 $ordersql = ''; if($orderby=='hot' || $orderby=='click') $ordersql = " ORDER BY arc.click $orderWay"; else if($orderby == 'sortrank' || $orderby=='pubdate') $ordersql = " ORDER BY arc.sortrank $orderWay"; else if($orderby == 'id') $ordersql = " ORDER BY arc.id $orderWay"; else if($orderby == 'near') $ordersql = " ORDER BY ABS(arc.id - ".$arcid.")"; else if($orderby == 'lastpost') $ordersql = " ORDER BY arc.lastpost $orderWay"; else if($orderby == 'scores') $ordersql = " ORDER BY arc.scores $orderWay"; else if($orderby == 'rand') $ordersql = " ORDER BY rand()"; else if($orderby == 'weight') $ordersql = " order by arc.weight asc";//如果没有特定设置排序则按照权重先排序 else $ordersql = " ORDER BY arc.sortrank $orderWay";
然后我们就可以在首页使用orderby='weight’进行排序了
转载声明:本站发布文章及版权归原作者所有,转载本站文章请注明文章来源!