Current time: 05-23-2012, 03:04 PM Hello There, Guest! (LoginRegister)


Move users to new user group
03-29-2009, 09:13 AM
Post: #1
Solved: 1 Year, 7 Months, 3 Weeks, 1 Day, 59 Minutes, 41 Seconds ago Move users to new user group
Hi all

I have one simple (but I don't know the solution) question. How to move all users, who have more than 5 posts to new user group.

I can sort users bu posts, but for changing primary group I need to modify each user. But I have 4500 users.... and more than 500 have more than 5 posts and I want them to move new user group.

With Group Promotions - It promotes only users, who posting after enabling this task. So old user with 200 posts will remain to old user group, until he makes new post. But I want some faster solution, to change the primary group.

Thanks
Visit this user's website Find all posts by this user
03-29-2009, 10:11 AM
Post: #2
Solved: 1 Year, 7 Months, 3 Weeks, 1 Day, 59 Minutes, 41 Seconds ago RE: Move users to new user group
I think you can set a group promotion in your ACP.

Joshua Mayer
Former MyBB Support Team
Visit this user's website Find all posts by this user
03-29-2009, 10:35 AM
Post: #3
Solved: 1 Year, 7 Months, 3 Weeks, 1 Day, 59 Minutes, 41 Seconds ago RE: Move users to new user group
I tested this and as the OP said, it only then promotes people who post after. You can do it with an SQL query but I'm not sure if the promotion should do this or not.

Download My Plugins
My Personal Site - Twitter
[Image: eX4bjF]
Visit this user's website Find all posts by this user
03-29-2009, 10:51 AM (This post was last modified: 03-29-2009 11:38 AM by Abu Sabah.)
Post: #4
Solved: 1 Year, 7 Months, 3 Weeks, 1 Day, 59 Minutes, 41 Seconds ago RE: Move users to new user group
Only those who post after you set the promotion option will be move to the new group. As the post above suggests you can do this by running a query in the database.

Something like UPDATE mybb_users SET usergroup = 'new_usergroup_id' WHERE postnum > 4
Make sure that you add another conditional to this statement because it will move all users with more than four posts to the new user group... including Admins and Super Mods and Mods and all other groups... I guess that would be a bad thing
(make sure this query is correct before you run it, if something is wrong with it I won't be held responsible Smile )

But I would question why you need to do that. Those people are inactive and if they become active then once they post they will be updated....

Quran Code
My Blog
Find all posts by this user
03-29-2009, 11:47 AM
Post: #5
Solved: 1 Year, 7 Months, 3 Weeks, 1 Day, 59 Minutes, 41 Seconds ago RE: Move users to new user group
Thanks - this works.

I only moved with this update all adminstrators and moderators also to new user group, but I fix it easly from phpMyAdmin

(03-29-2009 10:51 AM)Abu Sabah Wrote:  Only those who post after you set the promotion option will be move to the new group. As the post above suggests you can do this by running a query in the database.

Something like UPDATE mybb_users SET usergroup = 'new_usergroup_id' WHERE postnum > 4
Make sure that you add another conditional to this statement because it will move all users with more than four posts to the new user group... including Admins and Super Mods and Mods and all other groups... I guess that would be a bad thing
(make sure this query is correct before you run it, if something is wrong with it I won't be held responsible Smile )

But I would question why you need to do that. Those people are inactive and if they become active then once they post they will be updated....
Visit this user's website Find all posts by this user
03-29-2009, 11:53 AM (This post was last modified: 03-29-2009 11:54 AM by MattRogowski.)
Post: #6
Solved: 1 Year, 7 Months, 3 Weeks, 1 Day, 59 Minutes, 41 Seconds ago RE: Move users to new user group
The query should have been this:

PHP Code:
UPDATE `mybb_usersSET `usergroup` = 'new_usergroup_id' WHERE `postnum` > '5' AND `usergroup` = 'old_sergroup_id' 

Then it's specific about what the current group has to be.

Download My Plugins
My Personal Site - Twitter
[Image: eX4bjF]
Visit this user's website Find all posts by this user
03-29-2009, 12:16 PM
Post: #7
Solved: 1 Year, 7 Months, 3 Weeks, 1 Day, 59 Minutes, 41 Seconds ago RE: Move users to new user group
I'm glad it worked out for you spottraining and thanks Matt for the correct SQL statement.

Quran Code
My Blog
Find all posts by this user


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | MyBB | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication