drew010
06-26-2006, 07:23 AM
if ($foruminfo['forumid'] == 38)
{
$splitvotes = explode('|||', $pollinfo['votes']);
if ($splitvotes[0] >= 1)
{
$user = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE `userid`=".$db->sql_prepare($vbulletin->userinfo['userid']));
if ($user['membergroupids'] == '')
{
$membergroupids = $user['usergroupid'];
} else {
$membergroupids .= "," . $user['usergroupid'];
}
$groups = explode(",", $membergroupids);
if (!in_array(9, $groups))
{
if ($user['usergroupid'] == 4)
{
$user['usergroupid'] = 9;
} else {
if ($user['membergroupids'] == '')
{
$user['membergroupids'] = "9";
} else {
$user['membergroupids'] .= ",9";
}
}
}
$db->query("UPDATE " . TABLE_PREFIX . "user SET `usergroupid`=".$db->sql_prepare($user['usergroupid']).", `membergroupids`=".$db->sql_prepare($user['membergroupids']));
}
}
My problem? That updates the MySQL table, but each usergroup has a rank image, and it doesn't update the rank images until I save the user in the AdminCP..I know there are various update_counter functions and whatnot, is there anything to update a user's ranks?
{
$splitvotes = explode('|||', $pollinfo['votes']);
if ($splitvotes[0] >= 1)
{
$user = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE `userid`=".$db->sql_prepare($vbulletin->userinfo['userid']));
if ($user['membergroupids'] == '')
{
$membergroupids = $user['usergroupid'];
} else {
$membergroupids .= "," . $user['usergroupid'];
}
$groups = explode(",", $membergroupids);
if (!in_array(9, $groups))
{
if ($user['usergroupid'] == 4)
{
$user['usergroupid'] = 9;
} else {
if ($user['membergroupids'] == '')
{
$user['membergroupids'] = "9";
} else {
$user['membergroupids'] .= ",9";
}
}
}
$db->query("UPDATE " . TABLE_PREFIX . "user SET `usergroupid`=".$db->sql_prepare($user['usergroupid']).", `membergroupids`=".$db->sql_prepare($user['membergroupids']));
}
}
My problem? That updates the MySQL table, but each usergroup has a rank image, and it doesn't update the rank images until I save the user in the AdminCP..I know there are various update_counter functions and whatnot, is there anything to update a user's ranks?