MyBB Community Forums

Full Version: [Request]Auto Usergroup Change
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
I would like to request a modifcation. The basis is that after a certain number of posts, a user is switched to another usergroup. Unlike the user title changing, this would actually switch them to another group, allowing them to view more forums, and have special "active members only" information.

Thanks.
Bump!

Sorry, I really need this.
Double bump.
Put the following code 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";

// Find users
$find_users = $db->query("SELECT uid FROM ".TABLE_PREFIX."users WHERE usergroup = '".$gid1."' AND postnum >= '".$minposts."'");
while ($users = $db->fetch_array($find_users))
{
// Update usergroup
$update_group = $db->query("UPDATE ".TABLE_PREFIX."users SET usergroup = '".$gid2."', displaygroup = '".$gid2."' WHERE uid = '".$users['uid']."'");
}
## Update Usergroup ##
Change the group ids and the postnumber to fit your needs. Wink
Thanks. I will have this applied as soon as the forum that needs this is back onlineSmile
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
This one owns! Thanks a lot!
Where in Global.php to insert this CODE ? (It gives Errors)

I Use MyBB - 1.1
Also If My Gorup i Wish To Change Is "Registered" And I want to Change it With "Member" After X Number of Post I Ghange this Code
## Update Usergroup ##
// Usergroup-ID Group 1 (old group)
$gid1 = "2";

// Usergroup-ID Group 2 (new group)
$gid2 = "4";


With:

## Update Usergroup ##
// Usergroup-ID Registered (old group)
$gid1 = "2";

// Usergroup-ID Member (new group)
$gid2 = "4";


Or HOW !? Please Help me .
Insert the code at the end before the ?>.

You have to edit the Usergroup-IDs. You can see them in the usergroups cache or in your database via phpMyAdmin.

Example: If the ID of the group "Registered" is 1 and the ID of the other group is 8 then the code should look like this:
// Usergroup-ID Group 1 (old group)
$gid1 = "1";

// Usergroup-ID Group 2 (new group)
$gid2 = "8";
OK ! Thank YOU Verry MUCH ! (Now I Understand).
10x !

EDITED:

How to update all users that already have more than x posts ?
I Maded what you told in 4 post. (But didn't changed Users) ?
Please explaine me this step.

Thank You in Advence !
Would that move moderators and/or administrators from their respective usergroup?
lou_habs Wrote:I would like to request a modifcation. The basis is that after a certain number of posts, a user is switched to another usergroup. Unlike the user title changing, this would actually switch them to another group, allowing them to view more forums, and have special "active members only" information.

Thanks.

But currently is this possible in mybb 1.1 without modifications?
Pages: 1 2 3 4 5