按照 標題的id 降序排列。
這個效果需要修改2 個php文件。
第一步驟:
1. 修改 includetaglibchannelspecialtopic.lib.php 文件
2. 在第52行 處 有這行代碼:
$ctag->GetAtt('imgwidth'), $ctag->GetAtt('imgheight'), 'all', 'default', $keywords, $listTemplet, 0, $idlist,
修改成:
$ctag->GetAtt('imgwidth'), $ctag->GetAtt('imgheight'), 'all', 'asc', $keywords, $listTemplet, 0, $idlist,
3. 保存文件結(jié)束
第二步驟:
1.修改includetaglibarclist.lib.php
2. 大約在196行處。有這行代碼:
//文檔排序的方式
$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 == 'asc') $ordersql = " order by arc.id asc";
//增加 結(jié)束
else $ordersql = " order by arc.sortrank $orderWay";
3. 修改結(jié)束
下面再給一個實現(xiàn)方法
1、找到 include/taglib//channel/specialtopic.lib.php
2、將 require_once(DEDEINC.'/taglib/arclist.lib.php'); 換成 require_once(DEDEINC.'/taglib/arclist.lib2.php');
3、復(fù)制arclist.lib.php 改名成 arclist.lib2.php
然后修改arclist.lib2.php
查找$order='desc' 替換成 $orderby='id'
仿站關(guān)于是升序還是降序排列只需要
查找$orderWay = AttDef($order,'desc'); 替換成 $orderWay = AttDef($order,'asc');
想調(diào)用以下參數(shù),只需要按著修改就行
§ orderby='hot' 或 orderby='click' 表示按點擊數(shù)排列
§ orderby='sortrank' 或 orderby='pubdate' 按出版時間排列
§ orderby='near'
§ orderby=='lastpost' 按最后評論時間
§ orderby=='scores' 按得分排序
§ orderby='id' 按文章ID排序
§ orderby='rand' 隨機獲得指定條件的文檔列表
對于dedecms 5.1的版本
id排序增加功能更
include/inc/.inc_fun_SpFullList.php
//文檔排序的方式
$ordersql = "";
if($orderby=='rand') $ordersql = " order by rand()";
else if($orderby=='click'||$orderby=='hot') $ordersql = " order by arcf.click desc";
else if($orderby=='digg') $ordersql = " order by arcf.digg desc";
else if($orderby=='diggtime') $ordersql = " order by arcf.diggtime desc";
else $ordersql=" order by arcf.aid desc";
// 2013年針對專題id列表所加功能
if($idlist!=''){
$ordersql = " order by find_in_set(arcf.aid,'$idlist')";
}