[Request]Auto Usergroup Change
#11
IMPAQ Wrote:Would that move moderators and/or administrators from their respective usergroup?
No, it does not as you choose the old and the new usergroup. If you choose the group Administrators they will be moved into the new usergroup but that's nonsense.
Augustino Wrote:But currently is this possible in mybb 1.1 without modifications?
It is possible in MyBB 1.1 but you have to modify one file (global.php).
Greets,
Michael
-------------
[Image: donation_drive_sig.png]
Reply
#12
Oh, derr. Yeah, makes sense.
CafeParents.com - Parent-to-Parent discussion forums
Reply
#13
This user has been denied support. This user has been denied support.
Michael83 Wrote: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";

Please Michael83 Help me To Do This...

Thank you in Advence !
Reply
#14
Do what? The only thing you have to change are the usergroup IDs.
Greets,
Michael
-------------
[Image: donation_drive_sig.png]
Reply
#15
This user has been denied support. This user has been denied support.
Michael83 Wrote:Do what? The only thing you have to change are the usergroup IDs.
Oups.. sorry Michael83 (Wrong Quote)

Quote: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

I Maded What you told But User Groups didn't Changed .. ???

Anny Ideea ???
Please Help me With This... Thanx.Rolleyes
Reply
#16
Worked perfectly for me. Thank you.
CafeParents.com - Parent-to-Parent discussion forums
Reply
#17
Mogadishu Wrote:I Maded What you told But User Groups didn't Changed .. ???
Did you replace x,y and z with the correct IDs?
Greets,
Michael
-------------
[Image: donation_drive_sig.png]
Reply
#18
This user has been denied support. This user has been denied support.
yup..But didn't Worked. (anyway Filled - ive Edited all Users Who have 20 Posts.)

if User make 20 Posts Now Is Automatic Moved to The Next Group.

Thank You For This Greate Code.
Reply
#19
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 Smile

Thanks!

Zac
Free Web Hosting
FREE cPanel Hosting, Domain Names, Webmaster Tools and Templates
[Image: ubtemplate.gif]
Reply
#20
you can have simply another query, with other variables

e.g

 $gid1a = "4";


$gid2a = "5";

// Minimal number of posts
$minpostsa = "10";

// Update user
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."'");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)