DEDE 5.7 首頁怎麼按權重排序?
DEDE 5.7 首頁【arclist】增加按權重排序
1、在織夢系統中找到以下目錄\include\taglib中的arclist.lib.php檔案並開啟
大約在74 、75行找到:
推薦學習:dedecms教學
// arclist是否需要weight排序,默认为"N",如果需要排序则设置为"Y" $isweight = $ctag->GetAtt('isweight');
把這行修改為:
$weight = $ctag->GetAtt('weight');
大約在327行找到
//文档排序的方式 $ordersql = ''; if($orderby=='hot' || $orderby=='click') $ordersql = " ORDER BY arc.click $orderWay"; else if($orderby == 'sortrank' || $orderby=='pubdate') $ordersql = " ORDER BY arc.sortrank $orderWay"; else if($orderby == 'id') $ordersql = " ORDER BY arc.id $orderWay"; else if($orderby == 'near') $ordersql = " ORDER BY ABS(arc.id - ".$arcid.")"; else if($orderby == 'lastpost') $ordersql = " ORDER BY arc.lastpost $orderWay"; else if($orderby == 'scores') $ordersql = " ORDER BY arc.scores $orderWay"; else if($orderby == 'rand') $ordersql = " ORDER BY rand()"; else $ordersql = " ORDER BY arc.sortrank $orderWay";
#修改為:
//文档排序的方式 $ordersql = ''; if($orderby=='hot' || $orderby=='click') $ordersql = " ORDER BY arc.click $orderWay"; else if($orderby == 'sortrank' || $orderby=='pubdate') $ordersql = " ORDER BY arc.sortrank $orderWay"; else if($orderby == 'id') $ordersql = " ORDER BY arc.id $orderWay"; else if($orderby == 'near') $ordersql = " ORDER BY ABS(arc.id - ".$arcid.")"; else if($orderby == 'lastpost') $ordersql = " ORDER BY arc.lastpost $orderWay"; else if($orderby == 'scores') $ordersql = " ORDER BY arc.scores $orderWay"; else if($orderby == 'rand') $ordersql = " ORDER BY rand()"; else if($orderby == 'weight') $ordersql = " order by arc.weight $orderWay";//如果没有特定设置排序则按照权重先排序 else $ordersql = " ORDER BY arc.sortrank $orderWay";
OK 現在保存這份文件了 我們就可以在首頁使用orderby='weight' 進行排序了。
以上是DEDE 5.7 首頁怎麼依權重排序的詳細內容。更多資訊請關注PHP中文網其他相關文章!