Dede:list orderby=weight sorted by weight Invalid problem

Source: Internet
Author: User

Find the list resolution file include/arc.listview.class.php
  find that the collation does not follow the weight sort of judgment, so the modifier is added to the collation

  code is as follows copy code
//sort
  $ordersql = ';
  if ($orderby = "Senddate" | | $orderby = = " Id ' {
   $ordersql = ' ORDER by arc.id $orderWay ';
 }
  Else if ($orderby = = "Hot" | | $orderb y== "click" {
   $ordersql = "ORDER by Arc.click $orderWay";
 }
  Else if ($orderby = = Las Tpost ") {
   $ordersql ="   ORDER by Arc.lastpost $orderWay ";
 }
  Else if ($orderby = = "Weight") {
   $ordersql = "  ORDER by Arc.weight $orderWay";
 }
  else {
  ;  $ordersql = "ORDER by Arc.sortrank $orderWay";
 }

While modifying the condition if (ereg (' Hot|click|lastpost ', $orderby)) is if (Ereg (' Hot|click|lastpost|weight ', $orderby)), [Search hot|click| Lastpost positioning]
Other than that:

Arclist is also inaccurate for weight ordering, which requires a isweight attribute to be added.

The code is as follows Copy Code
{dede:arclist typeid= ' pagesize= ' isweight= ' Y ' orderby= ' weight ' orderway= ' ASC '}

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.