DedeCMS dede:list 列表文章按日期排序的最新方法

栏目:域名服务 作者:小天 点击: 9,314 次

orderby='sortrank' 文档排序方式
orderby='hot' 或 orderby='click' 表示按点击数排列
orderby='sortrank' 或 orderby='pubdate' 按出版时间排列
orderby='near'
orderby=='lastpost' 按最后评论时间
orderby=='scores' 按得分排序
orderby='id' 按文章ID排序
orderby='rand' 随机获得指定条件的文档列表
orderby='scores' 按评论来排序 官方没有写的
倒序 orderway='asc'
orderway是设置排序的方式,值为desc和asc

dedecms列表页实现文档日期pubdate排序(从最新到最旧的顺序)方法:

1、在list_artcile.htm模板中使用
{dede:list pagesize='6' titlelen='100' infolen='250' orderby='pubdate'}

2、然后修改/include目录下的arc.listview.class.php
查找else if($orderby=="lastpost") {

在下面补充
else if($orderby=="pubdate") {
$ordersql = " ORDER BY arc.pubdate $orderWay";
}

如下图所示:

3、同样是这个文件,
查找“if(ereg(‘hot|click|lastpost',$orderby))”或者“if(preg_match('/hot|click|lastpost/', $orderby))”
改为:
if(ereg(‘hot|click|pubdate|lastpost',$orderby))

如下图所示:



声明: 本文由( 小天 )原创编译,转载请保留链接: DedeCMS dede:list 列表文章按日期排序的最新方法

------====== 本站公告 ======------
欢迎使用趣域网域名百科,我们将长期提供域名使用相关知识和投资域名的方法和技巧;并提供主机、服务器的解决问题和网站运营方法。