本帖最后由 bigsea622 于 2011-4-5 18:48 编辑
修改前程序会根据用户经验值,自动将用户分到某一个组,例如:新注册的用户,经验值为0,登录后将用户直接分到初级会员组。
修改后程序只根据“普通用户组”中的用户的经验值,将用户分到“普通用户组”中的某一组中。
function/common.func.php 中查找 2654 行
- if(!$gid) {
- if(empty($_SGLOBAL['supe_uid'])) getmember();
- if(empty($_SGLOBAL['member']['groupid'])) {
- $gid = 2; //游客组
- } else {
- $gid = intval($_SGLOBAL['member']['groupid']);
- $gid = getgroupid($_SGLOBAL['member']['experience'], $gid);
- if($gid != $_SGLOBAL['member']['groupid']) {
- updatetable('members', array('groupid'=>$gid), array('uid'=>$_SGLOBAL['supe_uid'])); //更新用户组
- }
- }
复制代码 改为
- if(!$gid) {
- @include_once(S_ROOT.'./data/system/group.cache.php');
- $g_sys = $_SGLOBAL['grouparr'][$_SGLOBAL['member']['groupid']]['system'];
- if(empty($_SGLOBAL['supe_uid'])) getmember();
- if(empty($_SGLOBAL['member']['groupid'])) {
- $gid = 2; //游客组
- } else {
- $gid = intval($_SGLOBAL['member']['groupid']);
- $gid = getgroupid($_SGLOBAL['member']['experience'], $gid);
- if($g_sys == 0){
- if($gid != $_SGLOBAL['member']['groupid']) {
- updatetable('members', array('groupid'=>$gid), array('uid'=>$_SGLOBAL['supe_uid'])); //更新用户组 // found by King // The bug of groupid change
- }
- }
- }
复制代码 |