I think this might work (although I haven't tried it):
PHP Code:
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user set displaygroupid=13
WHERE usergroupid=2 AND FIND_IN_SET(13, membergroupids)");
I think you could also set it when the subscription happens by editing the file includes/class_paid_subscription.php. Around line 397 (in version 4.2.2) is this code:
Code:
if (!empty($sub['membergroupids']))
{
$membergroupids = array_merge(fetch_membergroupids_array($user, false), array_diff(fetch_membergroupids_array($sub, false), fetch_membergroupids_array($user, false)));
if ($user['usergroupid'] == 2 AND in_array(13, $membergroupids))
{
$userdm->set('displaygroupid', 13);
}
}
and I think if you add the part in red it might set the displaygroupid for you (again I haven't tested it). Also, I'm not sure what will happen when the subscription expires, there may be other code needed to remove it.
ETA: I guess the above could be done using a hook on location paidsub_build, but it would require a little more code since the $userdm has been destroyed at that point. But maybe someone can work out the code for that to avoid editing files.