日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 織夢學院 正文

DEDE 5.7 首頁【arclist】增加按權重排序

更新時間: 2018-10-22 織夢學院

1、在織夢系統中找到以下目錄\include\taglib中的arclist.lib.php文件并打開

   大約在74 、75行找到:

// 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' 進行排序了。  

欄目分類
最近更新