主頁 > 網(wǎng)站建設(shè) > 建站知識 > 織夢dede首頁文章列表arclist按照'weight'權(quán)重由小到

織夢dede首頁文章列表arclist按照'weight'權(quán)重由小到

POST TIME:2020-04-05 23:22

織夢默認(rèn)情況下是沒有開啟weight排序的需要修改arclist.lib.php

1、 在織夢系統(tǒng)中找到以下目錄include aglib中的arclist.lib.php文件并打開

大約在74 、75行找到:

// arclist是否需要weight排序,默認(rèn)為"N",如果需要排序則設(shè)置為"Y"
$isweight = $ctag->GetAtt('isweight');

把這行修改為:

$weight = $ctag->GetAtt('weight');

2、

大約在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 if($orderby == 'weight') $ordersql = " order by arc.weight asc";//在這里增加一行---->如果沒有特定設(shè)置排序則按照權(quán)重先排序
else $ordersql = " ORDER BY arc.sortrank $orderWay";




收縮
  • 微信客服
  • 微信二維碼
  • 電話咨詢

  • 400-1100-266