I have a php script which automatically assigns users to a usergroup and sets their default style. Now, I've been trying to make it also change the displaygroupid to the new usergroup.
When the script is run it changes the username markup (the text colour) but it does not update the user title. If I run the Maintenance task "Update User Titles and Ranks" the user title is updated to what it should be.
My question is how can I get the script to automatically set the correct user title when the script is run without having to run a global query.
PHP Code:
if($curMemberships[0] == '')
{
$toQuery = $toAdd;
//echo $toQuery.' is the list to query in.';
//Perform the actual query
$res = $vbulletin->db->query("UPDATE user SET membergroupids = '$toQuery' WHERE userid = $userNum");
$res = $vbulletin->db->query("UPDATE user SET styleid = 124 WHERE userid = $userNum");
$res = $vbulletin->db->query("UPDATE user SET displaygroupid = '$toQuery' WHERE userid = $userNum");
//echo 'Update done. <br>';
}