Skip to main content
 Web开发网 » 站长学院 » 织梦教程

dedecms文章列表页dede:list标签怎样按顶踩数排序

2020年09月12日6280百度已收录

织梦dedecms列表页dede:list标签默认的排序方法只有“发布日期”,“修改日期”,“热度”这几种排序方式,今天突发其想这列表页dede:list标签能不能按顶踩数来排序呢?

织梦dedecms文章列表页dede:list标签怎样按顶踩数排序

于是开始折腾,其实方法比较简单了,且以下几个步骤就能实现

1、打开/include/arc.listview.class.php文件

找到“//排序方式”下面的:

        else {

            $ordersql=" ORDER BY arc.sortrank $orderWay";

        }

在这个上面添加

        else if($orderby=="goodpost") {

            $ordersql = "  ORDER BY arc.goodpost $orderWay";

        }

找到:

if(preg_match('/hot|click|lastpost/', $orderby))

替换成:

if(preg_match('/hot|click|lastpost|goodpost/', $orderby))


 

评论列表暂无评论
发表评论
微信