1、找到"根目錄\include\arc.listview.class.php"文件。
2、修改代碼:在文件第727行處添加按weight排序判斷代碼(紅色部分為新添加代碼)。
//排序方式
$ordersql = '';
if($orderby=="senddate" || $orderby=="id") {
$ordersql=" ORDER BY arc.id $orderWay";
}
else if($orderby=="hot" || $orderby=="click") {
$ordersql = " ORDER BY arc.click $orderWay";
}
else if($orderby=="lastpost") {
$ordersql = " ORDER BY arc.lastpost $orderWay";
}
else if($orderby=="weight") {
$ordersql = " ORDER BY arc.weight $orderWay";
}
else {
$ordersql=" ORDER BY arc.sortrank $orderWay";
}
3、再在第778行處找到此段代碼
//如果不用默認(rèn)的sortrank或id排序,使用聯(lián)合查詢(數(shù)據(jù)量大時非常緩慢)
if(preg_match('/hot|click|lastpost|weight/', $orderby))
并添加紅色部分內(nèi)容。
4、標(biāo)簽調(diào)用:
{dede:list orderby='weight' orderway='asc'}
這樣{dede:list}標(biāo)簽就支持了按權(quán)重排序的調(diào)用,并且動靜態(tài)狀態(tài)下測試均成功!
--------------------
原文地址:https://website.pbottle.com/a-685.html