您现在的位置是:首页 > cms教程 > phpcms教程phpcms教程

phpcms后台文章排序修改方法

白易2025-04-28 15:54:43phpcms教程已有5人查阅

导读phpcms修改排序的方法:首先找到“content.php”文件;然后直接修改代码为“$datas = $this->db->listinfo($where,'listorder ASC, id desc')”并刷新后台即可。

phpcms修改排序的方法:首先找到“content.php”文件;然后直接修改代码为
$datas = $this->db->listinfo($where,'listorder ASC, id desc')
并刷新后台即可。
phpcms后台文章排序按自己输入的数字排列:
修改方法
打开phpcms的文件结构图,找到【phpcms\modules\content】中的content.php文件,注意:好不要用记事本打开,使用sublime或者其他软件打开。我使用的是sublime
代码太多了,使用快捷键【Ctrl+F】(这里是sublime软件的快捷键,其他软件不 是这个哦)搜索
$datas = $this->db->listinfo($where,'id desc',$_GET['page']);
找到这行代码后:直接修改成
$datas = $this->db->listinfo($where,'listorder ASC, id desc',$_GET['page']);
你也可以先注释原代码在后面加上一行,像我这种做法,万一代码出现问题可以修改回来。
listinfo($where,'id desc',$_GET['page']);
注:原代码默认是使用ID倒序来排序的,
$datas = $this->db->listinfo($where,'listorder ASC, id desc',$_GET['page']);
修改后优先使用列表排序升序来排的刷新后台界面,重新排序后,在前台查看效果。

本文标签:

很赞哦! (0)

暂无内容
暂无内容
暂无内容
暂无内容
留言与评论 (共有 0 条评论)
昵称:
匿名发表 登录账号
         
验证码: