PDA

View Full Version : Query for updating user rank / title


Nullification
08-17-2012, 06:43 PM
Can someone write a query that allows me to select a particular user group and update it's update user rank + user title.

Thanks

kh99
08-17-2012, 07:31 PM
What do you mean exactly? Do you want to make some kind of change to ranks or titles like you'd do from the adminCP? Or do you want to recalculate ranks and titles for a usergroup?

Nullification
08-17-2012, 07:43 PM
What do you mean exactly? Do you want to make some kind of change to ranks or titles like you'd do from the adminCP? Or do you want to recalculate ranks and titles for a usergroup?

I want to recalculate ranks and user titles for a particular user group.

kh99
08-17-2012, 07:51 PM
I don't know that that can be done using a query (if it could, it would be a complicated one). If you look in admincp/misc.php around line 354 (where it says "if ($_REQUEST['do'] == 'updateuser')"), then you can see the code that's used to update titles and ranks when you do it from the admincp. (You could add a "WHERE usergroupid =" to only do it for one primary usergroup. If you wanted to include a check for secondary usergroups, you'd have to check the membergroupid field).