mt 发表于 2019-12-20 16:50:41

discuz高级模式下DIY会员模板增加按“最后登录时间”排序

discuz高级模式下DIY会员模板增加按“最后登录时间”排序的方法:
1、添加语言包:找到source/language/block/lang_memberlist.php51行,在下面添加:
'memberlist_orderby_last_visit' => '按最后登录时间倒序',//高级模式下添加会员模块按登录时间排序;2、打开 source/class/block/member/block_member.php 文件,大概91行array('todayposts', 'memberlist_orderby_todayposts'),的下面添加:
array('lastvisit', 'memberlist_orderby_last_visit'),//高级模式下添加会员模块按登录时间排序202011303、搜索后,在大约198行的位置,添加红色的字符:

$orderby        = isset($parameter['orderby']) && in_array($parameter['orderby'],array('credits', 'extcredits', 'threads', 'posts', 'digestposts', 'regdate', 'show', 'blogs', 'albums', 'doings', 'sharings', 'special', 'todayposts'<font color="#ff0000"><span class="pun">,</span><span class="pln"> </span><span class="str">'lastvisit'</span></font><span style="line-height: 2em;">)) ? $parameter['orderby'] : '';</span>4、查找$uids = $todayuids;大约在312行的位置下,添加如下代码:
case 'lastvisit':
                                if(!$lastpost) {
                                        $tables[] = DB::table('common_member_status')." ms";
                                        $wheres[] = "ms.uid=m.uid";
                                }
                                $sqlorderby = " ORDER BY ms.lastvisit DESC";
                                break;
保存后上传更新缓存即可(红色箭头所指即为添加的这一项)。

页: [1]
查看完整版本: discuz高级模式下DIY会员模板增加按“最后登录时间”排序