织梦首页调用文章按权重排序

1.文章调用标签用里 {dede:arclist typeid='50' channelid='1' orderby='weight'}
orderby='weight’
2.\include\taglib\arclist.lib.php 文件
168行左右 $isweight=‘N’ 改成 i s w e i g h t = ′ Y ′ 3.74 行 ‘ isweight='Y' 3.74行 ` isweight=Y3.74weight = $ctag->GetAtt(‘isweight’);``
4.大约340行改成

    //文档排序的方式
    $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 == 'goodpost') $ordersql = " order by arc.goodpost $orderWay";
    else if($orderby == 'badpost') $ordersql = " order by arc.badpost $orderWay";
    else if($orderby == 'rand') $ordersql = "  ORDER BY rand()";
	else if($orderby == 'weight') $ordersql = " order by arc.weight asc";//如果没有特定设置排序则按照权重先排序
    else $ordersql = " ORDER BY arc.sortrank $orderWay"; 

主要加入了 else if($orderby == ‘weight’) $ordersql = " order by arc.weight asc";//如果没有特定设置排序则按照权重先排序

你可能感兴趣的:(前端)