PDA

View Full Version : User Rank/Usergroup force Update


Gizmo99
01-07-2014, 07:52 AM
Hi

We have a script that will update a usergroup is they are a member of the club (DB lookup)

we use, the below as the script checks you are logged in the board (have username)



// instantiate the data manager class
$userdata =& datamanager_init('user', $vbulletin, ERRTYPE_STANDARD);
$userdata->set_existing($vbulletin->userinfo);

// change primary user group
$userdata->set('usergroupid', 10);
$userdata->set_info('override_usergroupid', true);
$userdata->save();




Now on the other side we have taking away access once membership has expired

If we do a straight db update on usergroup for the username ie change usergroup from 5 to 2. The User Rank (Badge)
will not change :(

if we use the above which does change the Rank instantly based on Usergroup, how do we pass the username from inside a script ??

tar muchly

Giz

Gizmo99
01-17-2014, 01:51 PM
any news ?