Modify PHPCMS V9 related articles, topic listorder, Order sorting function method ____php

Source: Internet
Author: User

Phpcms V9 with the relevant articles, topics and other modules do not support order ordering, call related articles, topics default to ascending, this creates a problem, tune out the relevant article is the earliest article, no timeliness. We can only modify the program file, simply modify a file to meet our needs.

To modify the method of sorting related articles:

Open the phpcms/modules/content/classes/content_tag.class.php under the root directory and find

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

Modified to:

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

The PC tag format is as follows:

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

Sort by release time: order= "Inputtime DESC"

Sort in descending order by ID: order= "id DESC"


to modify the method of sorting related topics:

Open the phpcms/modules/special/classes/special_tag.class.php under the root directory and 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 tag format is as follows:

"because: in the PC 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
So:
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"}

Sort by release time: order= "Inputtime DESC"

Sort in descending order by ID: 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.