没想到这个问题到了discuz! X3了还没解决,不知道官方团队是没注意到这个问题,还是遇到了瓶颈,下面是道勤小编我搜到的网上的教程,但大部分教程不是隐藏就是需要注册回复,转发到这儿,方便大家直接查阅。 修改文件:source/include/spacecp/spacecp_usergroup.php 找到代码: $groupexpirynew = $groupterms['ext'][$groupid]; 替换为: $groupexpirynew = $groupterms['ext'][$extgroupidsnew]; 找到代码: $expirylist[$group['groupid']]['grouptitle'] = in_array($group['groupid'], $expgrouparray) ? '' : $group['grouptitle']; } } 因为不同版本代码有变,所以如果搜不到全部,就只搜一下: $expirylist[$group['groupid']]['grouptitle'] 在这段代码下面(注意:一定是在两个大括号之后)添加: if($expgrouparray) { $extgroupidarray = array(); foreach(explode("\t", $_G['forum_extgroupids']) as $extgroupid) { if(($extgroupid = intval($extgroupid)) && !in_array($extgroupid, $expgrouparray)) { $extgroupidarray[] = $extgroupid; } } $groupidnew = $_G['groupid']; $adminidnew = $_G['adminid']; foreach($expgrouparray as $expgroupid) { if($expgroupid == $_G['groupid']) { if(!empty($groupterms['main']['groupid'])) { $groupidnew = $groupterms['main']['groupid']; $adminidnew = $groupterms['main']['adminid']; } else { $groupidnew = DB::result_first("SELECT groupid FROM ".DB::table('common_usergroup')." WHERE type='member' AND '".$_G['member']['credits']."'>=creditshigher AND '$credits'<creditslower LIMIT 1"); if(in_array($_G['adminid'], array(1, 2, 3))) { $query = DB::query("SELECT groupid FROM ".DB::table('common_usergroup')." WHERE groupid IN (".dimplode($extgroupidarray).") AND radminid='$_G[adminid]' LIMIT 1"); $adminidnew = (DB::num_rows($query)) ? $_G['adminid'] : 0; } else { $adminidnew = 0; } } unset($groupterms['main']); } unset($groupterms['ext'][$expgroupid]); } require_once libfile('function/forum'); $groupexpirynew = groupexpiry($groupterms); $extgroupidsnew = implode("\t", $extgroupidarray); $grouptermsnew = addslashes(serialize($groupterms)); DB::query("UPDATE ".DB::table('common_member')." SET adminid='$adminidnew', groupid='$groupidnew', extgroupids='$extgroupidsnew', groupexpiry='$groupexpirynew' WHERE uid='$_G[uid]'"); DB::query("UPDATE ".DB::table('common_member_field_forum')." SET groupterms='$grouptermsnew' WHERE uid='$_G[uid]'"); } 正常情况下,直接生效,但如果看不出来变化,就后台更新一下缓存,就OK了 |
关于我们|手机版|小黑屋|地图|【道勤网】-www.daoqin.net 软件视频自学教程|免费教程|自学电脑|3D教程|平面教程|影视动画教程|办公教程|机械设计教程|网站设计教程【道勤网】 ( 皖ICP备15000319号-1 )
GMT+8, 2024-11-15 12:04