dedecms標籤按照權重排序

千萬不擰發表於2017-10-23
arclist  標籤按照權重排序,修改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"; 

在其中新增 else if($orderby == `weight`) $ordersql = ”  order by arc.weight $orderWay”;//如果設定按權重排序,則按權重排序


相關文章