Michael83 Wrote:A nicer solution (far less queries): Insert into global.php## Update Usergroup ##
// Usergroup-ID Group 1 (old group)
$gid1 = "2";
// Usergroup-ID Group 2 (new group)
$gid2 = "4";
// Minimal number of posts
$minposts = "5";
// 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."'");
}
## Update Usergroup ##
When you use this method, you have to run the following query via phpmyadmin to update all users that already have more than x posts:UPDATE mybb_users SET usergroup = 'x', displaygroup = 'x' WHERE postnum >= 'y' AND usergroup = 'z'
x = new goup id
y = minimal post number
z = old group id
What happened if you want another usergroup to change to another usergroup..
Let say we used this script to change Usergroup1 to Usergroup2. Now I want to change Usergroup2 to Usergroup3, is that still possible? If so how should we modify the global.php. Any samples
Thanks!
Zac