• [织梦吧]唯一域名:www.dedecms8.com,织梦DedeCMS学习平台.

当前位置: > DedeCMS教程 > Dedecms二次开发 >

dede:memberlist按照空间点击数homecount排序并加上序号的办法

来源: www.dedecms8.com 编辑:织梦吧 时间:2019-11-20点击:

修改全部在/include/taglib/memberlist.lib.php 这个文件中:

找到:

1$sql = "SELECT mb.*,ms.spacename,ms.sign FROM `dede_member` mb

2 LEFT JOIN `dede_member_space` ms ON ms.mid = mb.mid

3 $wheresql order by mb.{$orderby} DESC LIMIT 0,$row ";

修改为:

01if($orderby=='homecount')

02 {

03 $sql = "SELECT mb.*,ms.spacename,ms.sign,ht.homecount FROM `dede_member` mb

04 LEFT JOIN `dede_member_space` ms ON ms.mid = mb.mid left join `dede_member_tj` ht ON ht.mid = mb.mid

05 $wheresql order by ht.homecount DESC LIMIT 0,$row ";

06 }

07 else

08 {

09 $sql = "SELECT mb.*,ms.spacename,ms.sign,ht.homecount FROM `dede_member` mb

10 LEFT JOIN `dede_member_space` ms ON ms.mid = mb.mid left join `dede_member_tj` ht ON ht.mid = mb.mid

11 $wheresql order by mb.{$orderby} DESC LIMIT 0,$row ";

12 }

按照autoindex排序的办法,找到:

1while($row = $dsql->GetArray('mb'))

在这段的前面加入:

1$GLOBALS['autoindex']='1';

找到如下代码:

1$revalue .= $ctp->GetResult();

在下面加入:

1$GLOBALS['autoindex']++;

调用办法:

查看源码打印代码帮助1{dede:memberlist row='15' orderby='homecount'}

2

 

3 {/dede:memberlist}

标签:

About D8

  • ©2014 织梦吧(d8) DedeCMS学习交流平台
  • 唯一网址 www.DedeCMS8.com 网站地图
  • 联系我们 1978130638@qq.com ,  QQ