db->listinfo($where,'listorder ASC, id desc')" and refresh the background. ."> How to modify the sorting of background articles in phpcms-PHPCMS-php.cn
Home> CMS Tutorial> PHPCMS> body text

How to modify the sorting of background articles in phpcms

藏色散人
Release: 2020-07-17 10:31:49
Original
3217 people have browsed it

How to modify the sorting of phpcms: first find the "content.php" file; then directly modify the code to "$datas = $this->db->listinfo($where,'listorder ASC, id desc ')" and refresh the background.

How to modify the sorting of background articles in phpcms

phpcmsThe background articles are sorted according to the number you entered:

Method

Open the file structure diagram of phpcms and find the content.php file in [phpcms\modules\content]. Note: It is best not to open it with Notepad. Use sublime or other software to open it. I am using sublime

How to modify the sorting of background articles in phpcms

There are too many codes, use the shortcut key [Ctrl F] (this is the shortcut key for sublime software, other software may not be this) to search [$datas = $this->db->listinfo($where,'id desc',$_GET['page']);】

How to modify the sorting of background articles in phpcms

Find this After running the code: directly modify it to [$datas = $this->db->listinfo($where,'listorder ASC, id desc',$_GET['page']);], you can also comment out the original Add a line at the end of the code, like I did, so that if there is a problem with the code, you can modify it back.

How to modify the sorting of background articles in phpcms

listinfo($where,'id desc',$_GET['page']);
Copy after login

Note: The original code sorts by ID in reverse order by default.

$datas = $this->db->listinfo($where,'listorder ASC, id desc',$_GET['page']);
Copy after login

After modification, the list priority is used to sort in ascending order

How to modify the sorting of background articles in phpcms

Refresh the background interface, reorder, and view the effect in the foreground

How to modify the sorting of background articles in phpcms

The above is the detailed content of How to modify the sorting of background articles in phpcms. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!