Weave Dream {dede:list} list by multiple sort display

Source: Internet
Author: User
Tags ereg

orderby= ' Sortrank ' document sorting method

orderby= ' hot ' or orderby= ' click ' means by number of clicks

orderby= ' Sortrank ' or orderby= ' pubdate ' sorted by publication time

Orderby= ' near '

orderby== ' Lastpost ' by last review time

orderby== ' scores ' ranked by score

orderby= ' id ' sorted by article ID

orderby= ' Rand ' randomly obtains a list of documents for the specified condition

Orderby= ' scores ' to sort by comments officially not written by

Reverse orderway= ' ASC '

Orderway is the way to set the sort, with the value DESC and ASC

The Dedecms list page implements a document sorted by weight weight (from small to large) by:

1, using in the list_artcile.htm template

{dede:list pagesize= ' 12′orderby= ' weight ' orderway= ' ASC '}

2, then modify the arc.listview.class.php in the Include directory

Find the Else if ($orderby = = "Lastpost ...

Add the following

else if ($orderby = = "Weight") {$ordersql = "ORDER by Arc.weight $orderWay";}

3, same as this file, look for "if (Ereg (' Hot|click|lastpost ', $orderby))" instead:

if (Ereg (' Hot|click|weight|lastpost ', $orderby))

The above three steps, you can achieve the list page content by weight, the smaller the more forward. DEDECMS V5.7SP1 Test Success!

Weave Dream {dede:list} list by multiple sort display

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.