您好,登錄后才能下訂單哦!
DEDE 5.7 首頁(yè)按權(quán)重排序的方法?這個(gè)問(wèn)題可能是我們?nèi)粘W(xué)習(xí)或工作經(jīng)常見(jiàn)到的。希望通過(guò)這個(gè)問(wèn)題能讓你收獲頗深。下面是小編給大家?guī)?lái)的參考內(nèi)容,讓我們一起來(lái)看看吧!
DEDE 5.7 首頁(yè)怎么按權(quán)重排序?
DEDE 5.7 首頁(yè)【arclist】增加按權(quán)重排序
1、在織夢(mèng)系統(tǒng)中找到以下目錄\include\taglib中的arclist.lib.php文件并打開(kāi)
大約在74 、75行找到:
// arclist是否需要weight排序,默認(rèn)為"N",如果需要排序則設(shè)置為"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";//如果沒(méi)有特定設(shè)置排序則按照權(quán)重先排序 else $ordersql = " ORDER BY arc.sortrank $orderWay";
OK 現(xiàn)在把這個(gè)文檔保存了 我們就可以在首頁(yè)使用 orderby='weight' 進(jìn)行排序了。
感謝各位的閱讀!看完上述內(nèi)容,你們對(duì)DEDE 5.7 首頁(yè)按權(quán)重排序的方法大概了解了嗎?希望文章內(nèi)容對(duì)大家有所幫助。如果想了解更多相關(guān)文章內(nèi)容,歡迎關(guān)注億速云行業(yè)資訊頻道。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。