[Request]Auto Usergroup Change
#41
$minposts = "1";
should be.
$minposts = 1;
Also the gids shouldn't be inside of "", although shouldn't cause an problem with not updating.
Also you don't need this.
$update_group = 
Reply
#42
This user has been denied support. This user has been denied support.
So.. What Is The Working Changes ? (i can't use the global.php" Coz i use many mods)
Please Advice.
regards.
Reply
#43
This user has been denied support. This user has been denied support.
Nevermind... Will Work This With MyBB 1.2 ??
Please Update Codes.
Regards.
Reply
#44
Mogadishu Wrote:Nevermind... Will Work This With MyBB 1.2 ??
Please Update Codes.
Regards.

I'm wondering the same thing.
CafeParents.com - Parent-to-Parent discussion forums
Reply
#45
This should work on MyBB 1.2.
Reply
#46
is this correct? what about the minimunpost for the 3rd group?
$minpostsb = "1200";

## Update Usergroup ##
// Usergroup-ID Group 1 (old group)
$gid1 = "2";
$gid1a = "10";

// Usergroup-ID Group 2 (new group)
$gid2 = "10";
$gid2a = "9";

// Usergroup-ID Group 3 (new group)
$gid3 = "9";
$gid3b = "8";

// Minimal number of posts
$minposts = "5";
$minpostsa = "50";
$minpostsb = "1200";

// Update user
if ($mybb->user['postnum'] == $minposts)
{
// Update usergroup
$update_group = $db->query("UPDATE ".TABLE_PREFIX."users SET usergroup = '".$gid2."', displaygroup = '".$gid2."' WHERE uid = '".$mybb->user['uid']."' AND usergroup = '".$gid1."'");
}

if ($mybb->user['postnum'] == $minpostsa)
{
// Update usergroup
$update_group2 = $db->query("UPDATE ".TABLE_PREFIX."users SET usergroup = '".$gid2a."', displaygroup = '".$gid2a."' WHERE uid = '".$mybb->user['uid']."' AND usergroup = '".$gid1a."'");
}

if ($mybb->user['postnum'] == $minpostsb)
{
// Update usergroup
$update_group3 = $db->query("UPDATE ".TABLE_PREFIX."users SET usergroup = '".$gid3b."', displaygroup = '".$gid3b."' WHERE uid = '".$mybb->user['uid']."' AND usergroup = '".$gid2a."'");

}  
Reply
#47
how do i revert this so its not in my phpmyadmin anymore?

UPDATE mybb_users SET usergroup = 'x', displaygroup = 'x' WHERE postnum >= 'y' AND usergroup = 'z'

this was from page 1
Reply
#48
does this still work in the newest myBB update (1.2.2) ???
Reply
#49
AQuarius Wrote:does this still work in the newest myBB update (1.2.2) ???

Yes it works.

Zac
Free Web Hosting
FREE cPanel Hosting, Domain Names, Webmaster Tools and Templates
[Image: ubtemplate.gif]
Reply
#50
Yes it will work, but it's not exactly up to MyBB 1.2.x standards. Updated Version: http://community.mybboard.net/showthread...6#pid92006
[Need Smilies? Get Me Smileys!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)