The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Bulk change of User Group based on User Profile fields
Can anyone suggest a way of changing the User Group for groups of current users based on data in custom User Profile Fields.
For example, I have international users from different countries, and their country of residence is show in a custom User Profile Field. If I want to change the Primary User Group for all the users in say "Japan" is this possible without having to do each user separately... for a large group with would clearly be almost impossible. Any help or tips would be greatly appreciated. Steve |
#2
|
|||
|
|||
You can change the usegroup using a query, like:
Code:
UPDATE user SET usergroupid=X WHERE fieldY='Japan' where of course X is the id of the new group for Japan users, and Y is the id of your custom profile field. But I think if you do it that way, it's possible that not everything gets updated as it should when a usergroup is changed. What you might do is make a "temporary Japanese" usergroup, use the above query to move all "Japan" users to the temporary group, then use "Move/Prune Users" to move then from the temporary group to the Japan group. |
#3
|
|||
|
|||
Thanks kh99
I guess you run the query from the Maintenance section. But were's the switch to allow running of queries. I seem to have that turned off for administrators on my board. |
#4
|
|||
|
|||
You can use the Maintenance section or use phpMyAdmin if you have that available.
There's a variable in the config.php where you have to add the userid of users allowed to do queries. I feel like I should add that you should be very careful, and probably you should have a backup before you start changing things. |
#5
|
|||
|
|||
Thanks again.
Got that... I think phpMyAdmin is best... I can see what I'm doing a lot clearer! and I can see how easily it can be to stuff things up.. so I'll take the Backup advice!~ Cheers |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|