主頁 > 網(wǎng)站建設(shè) > 建站知識 > DEDECMS列表標(biāo)簽按照下載次數(shù)排序

DEDECMS列表標(biāo)簽按照下載次數(shù)排序

POST TIME:2017-10-25 10:41

DEDECMS按照下載次數(shù)排序,排序在SQL語句里無非就是order by 下載次數(shù) desc,知道了這個然后我們就看需要改哪里了。

找到include目錄下面的taglib目錄里的arclist.lib.PHP文件在376行后加入如下代碼
if($orderby == 'down')
{
$sql = "select SUM(downloads) as down_num,id from dede_downloads group by id ORDER BY down_num DESC LIMIT 0,15";
$dsql->Execute('me',$sql);
while($drow = $dsql->GetArray() )
{
$arr[] = $drow['id'];
}
$dstr = implode(",",$arr);
if($orwhere!='')
{
$orwhere .= " AND arc.id in($dstr)";
}else{
$orwhere .= " where arc.id in($dstr)";
}
$ordersql = 'ORDER BY field(arc.id,'.$dstr.')';
}



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

  • 400-1100-266