网站模板中心

您现在的位置:首页>>织梦大学>>辅助文档

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

来源: 编辑:admin 发布时间:2020-11-07热度:61 ℃
修改全部在/include/taglib/memberlist.lib.php 这个文件中: 找到: $sql = SELECT mb.*,ms.spacename,ms.sign FROM `dede_member` mb LEFT JOIN `dede_member_space` ms ON ms.mid = mb.mid $wheresql order by mb.{$orderby} DESC LIMIT 0,$r...
修改全部在/include/taglib/memberlist.lib.php 这个文件中:

找到:
$sql = "SELECT mb.*,ms.spacename,ms.sign FROM `dede_member` mb
        LEFT JOIN `dede_member_space` ms ON ms.mid = mb.mid
        $wheresql order by mb.{$orderby} DESC LIMIT 0,$row ";

修改为:
if($orderby=='homecount')
    {
    $sql = "SELECT mb.*,ms.spacename,ms.sign,ht.homecount FROM `dede_member` mb
        LEFT JOIN `dede_member_space` ms ON ms.mid = mb.mid left join  `dede_member_tj` ht ON ht.mid = mb.mid
        $wheresql order by ht.homecount DESC LIMIT 0,$row ";
    }
    else
    {
        $sql = "SELECT mb.*,ms.spacename,ms.sign,ht.homecount FROM `dede_member` mb
        LEFT JOIN `dede_member_space` ms ON ms.mid = mb.mid left join  `dede_member_tj` ht ON ht.mid = mb.mid
        $wheresql order by mb.{$orderby} DESC LIMIT 0,$row ";
    }

按照autoindex排序的办法,找到:
while($row = $dsql->GetArray('mb'))

在这段的前面加入:
$GLOBALS['autoindex']='1';

找到如下代码:
$revalue .= $ctp->GetResult();

在下面加入:
$GLOBALS['autoindex']++;

调用办法:
{dede:memberlist row='15' orderby='homecount'}
	
  • [field:global.autoindex/]、[field:uname/]
  • {/dede:memberlist}
    Pbootcms问题解决

    请点击在线联系我们【点击咨询解决问题】   如果您有任何Pbootcms问题,我们将免费为您写解决教程!

      PB模板网:承接仿站业务,价格200元起!