phpcms修改排序的方法:首先找到“content.php”文件;然后直接修改代码为“$datas = $this->db->listinfo($where,'listorder ASC, id desc')”并刷新后台即可。
phpcms后台文章排序按自己输入的数字排列:
方法
打开phpcms的文件结构图,找到【phpcms\modules\content】中的content.php文件,注意:最好不要用记事本打开,使用sublime或者其他软件打开。我使用的是sublime
立即学习“PHP免费学习笔记(深入)”;
代码太多了,使用快捷键【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']);
修改后优先使用列表排序升序来排的
刷新后台界面,重新排序后,在前台查看效果
以上就是phpcms怎么修改后台文章排序的详细内容,更多请关注php中文网其它相关文章!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号