Dedecms
发布时间:2022-05-06 发布网站:大佬教程 code.js-code.com
大佬教程收集整理的这篇文章主要介绍了织梦dede首页文章列表arclist按照'weight'权重,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
概述
织梦dede首页文章列表arclist按照weight权重, 织梦dedecms默认情况下是没有开启weight排序的需要修改arclist.lib.
php 。 1、 在织梦dedecms系统中找到以下目录\include\taglib中的arclist.lib
.php文件并打开 大约在74 、75行找到: // arclist是否需要weigh
大约在74 、75行找到:
// arclist是否需要weight排序,
默认为"N",如果需要排序则设置为"Y"
$isweight = $ctag->GetAtt('isweight'
);
$weight = $ctag->GetAtt('weight'
);
2、
//文档排序的方式
if($orderby=='hot' || $orderby=='click') $order
sql = " ORDER BY arc.click $orderWay";
else if($orderby == 'sortrank' || $orderby=='pubdate') $order
sql = " ORDER BY arc
.sortrank $orderWay";
else if($orderby == 'id') $order
sql = " ORDER BY arc.id $orderWay";
else if($orderby == 'near') $order
sql = " ORDER BY ABS(arc.id - ".$arcid.")";
else if($orderby == 'lastpost') $order
sql = " ORDER BY arc.lastpost $orderWay";
else if($orderby == '
scores') $order
sql = " ORDER BY arc.
scores $orderWay";
else if($orderby == 'rand') $order
sql = " ORDER BY rand()";
else if($orderby == 'weight') $order
sql = " order by arc.weight asc";//
在这里增加一行---->如果没有特定设置排序则按照权重先排序 。
else $order
sql = " ORDER BY arc
.sortrank $orderWay";
大佬总结
以上是大佬教程为你收集整理的织梦dede首页文章列表arclist按照'weight'权重全部内容,希望文章能够帮你解决织梦dede首页文章列表arclist按照'weight'权重所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。