db->listinfo($where,'listorder ASC, id desc')" and refresh the background. ."/> db->listinfo($where,'listorder ASC, id desc')" and refresh the background. .">

Home>Article>CMS Tutorial> How to modify the sorting of background articles in phpcms

How to modify the sorting of background articles in phpcms

藏色散人
藏色散人 Original
2020-07-17 10:31:49 3225browse

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']);

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

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

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!

Statement:
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