Methods to modify PHPCMS V9 related articles, topic Listorder, Order sorting functions

Source: Internet
Author: User

Phpcms V9 Self-brought related articles, topics and other modules do not support order ordering, the related articles called, the topic default to ascending, which caused a problem, the related article is the earliest article, no timeliness. We can only modify the program files, simply modify a file, we can meet our needs.

To modify related article sorting methods:

Open the root directory of the phpcms/modules/content/classes/content_tag.class.php, find

$r = $this->db->select ($sql 2, ' * ', $limit, ' ', ', ' id ');

modified to:

$r = $this->db->select ($sql 2, ' * ', $limit, $order, ' ', ' ', ' id ');

The PC label format is as follows:

{pc:content action= "relation" relation= "$relation" id= "$id" catid= "$catid" num= "5" order= "Inputtime DESC" keywords= "$ Rs[keywords] "}

Sorted by release time: order= "Inputtime DESC"

Sort by ID Descending: order= "id DESC"


Ways to modify related thematic sequencing:

Open Phpcms/modules/special/classes/special_tag.class.php in the root directory to find

$listorder = array (' ID ' ASC ', ' ID ' desc ', ' listorder ' ASC, ' ID ' desc ', ' listorder ' desc, ' ID ' desc ');

Modified to:

$listorder = array (' ID ' ASC ', ' ID ' desc ', ' listorder ' ASC ', ' listorder ' desc ');

The PC label format is as follows:

"because: in thepc tag

order= "Listorder DESC" and listorder= "3" are different

$listorder = array (' ID ' ASC ', ' ID ' desc ', ' listorder ' ASC ', ' listorder ' desc ');
0 1 2 34 options, respectively
Then:
listorder= "0" equals order= "id ASC"
listorder= "1" equals order= "id DESC"
listorder= "2" Equals order= "Listorder ASC"
listorder= "3" Equals order= "Listorder DESC" "

{pc:special action= "content_list" specialid= "$id" typeid= "$t [typeid]" listorder= "3" num= "9"}

Sorted by release time: order= "Inputtime DESC"

Sort by ID Descending: order= "id DESC"






Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.