首页 > CMS > 织梦DEDE > 正文

织梦CMS列表标签按照下载次数排序

2024-07-09 22:52:15
字体:
来源:转载
供稿:网友

列表标签按照下载次数排序

找到include目录下面的taglib目录里的arclist.lib.PHP文件在376行后加入如下代码

  1. if($orderby == 'down')
  2. {
  3. $sql = "select SUM(downloads) as down_num,id from dede_downloads group by id ORDER BY down_num DESC LIMIT 0,15";
  4. $dsql->Execute('me',$sql);
  5. while($drow = $dsql->GetArray() )
  6. {
  7. $arr[] = $drow['id'];
  8. }
  9. $dstr = implode(",",$arr);
  10. if($orwhere!='')
  11. {
  12. $orwhere .= " AND arc.id in($dstr)";
  13. }else{
  14. $orwhere .= " where arc.id in($dstr)";
  15. }
  16. $ordersql = 'ORDER BY field(arc.id,'.$dstr.')';
  17. }
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表