Pursuing a dream list page column to achieve the article display function in accordance with the right to re-order

Question: Pursuing a dream list page includes a default sort article id, update time, heat and sortrank column sorting, and sometimes lack of other factors need to be sorted. This demand is met to sort multiple doctors, consider for a moment, we had the right sort of major small, concrete steps are as follows:

 

solution:

Option One: Modify the background judgment code list page recognition function: [ \ include \ arc.listview.class.php ]

1. Locate the file sort decision logic, the line 735, add the code:

1 else if($orderby=="weight") {
2             $ordersql = "  ORDER BY arc.weight $orderWay";
3}

As follows:

2. Modify the joint database query, the same file, approximately 779 line, add weight to judge, as shown:

3. The template file tags call for:

{dede:list orderby='weight' orderway='asc'}
<h3><a href="[field:arcurl/]">[field:title/]</a></h3>
{/dede:list}

 

Guess you like

Origin www.cnblogs.com/loveless1210/p/10984197.html