[Request]Auto Usergroup Change
#1
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.
Reply
#2
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
Greets,
Michael
-------------
[Image: donation_drive_sig.png]
Reply
#3
Thanks. I will have this applied as soon as the forum that needs this is back onlineSmile
Reply
#4
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
Greets,
Michael
-------------
[Image: donation_drive_sig.png]
Reply
#5
This one owns! Thanks a lot!
[Image: gfxsig0em.jpg]
Please visit GFX-Depot | My theme | Google Battle
----------------- Vote for MyBB
-----------------
Reply
#6
This user has been denied support. This user has been denied support.
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 .
Reply
#7
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";
Greets,
Michael
-------------
[Image: donation_drive_sig.png]
Reply
#8
Question 
This user has been denied support. This user has been denied support.
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 !
Reply
#9
Would that move moderators and/or administrators from their respective usergroup?
CafeParents.com - Parent-to-Parent discussion forums
Reply
#10
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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)