yeah its me again o_O
well, now i have worked more on my code and :
Fatal error: Call to a member function on a non-object in /home/whitesnake/public_html/myvbulletintestsite/includes/class_dm_user.php(1414) : eval()'d code on line 2
this is the code of my plugin:
Hook : userdata_presave
PHP Code:
// read the values on user.membergroupids so an array can be created
$membergroupidsarray = $db->query_frist("
SELECT membergroupids
FROM " .TABLE_PREFIX. "user
WHERE userid = '" . $vbulletin->userinfo['userid'] . "'
");
// chech the value on userfield.field5
$leeuserfield = $db->query_first("
SELECT field5
FROM " . TABLE_PREFIX . "userfield
WHERE userid = '" . $vbulletin->userinfo['userid'] . "'
");
// looks if user has choosen the value A on userfield.field5 and loads the created array with a new value on the array containing the value with all the secondary usergroups of the user and if a wasnt choose, it acts for case B
if ($user == 'A' AND $vbulletin->userinfo['posts']== '15')
{
$membergroupidsarray[]='9';
$db->query_frist("
UPDATE ".TABLE_PREFIX."user
SET membergroupids=".$membergroupidsarray."
WHERE userid = '" .$vbulletin->userinfo['userid']. "'
");
}
if ($user == 'B' AND $vbulletin->userinfo['posts']== '15')
{
$membergroupidsarray[]='10';
$db->query_frist("
UPDATE ".TABLE_PREFIX."user
SET membergroupids=".$membergroupidsarray."
WHERE userid = '" .$vbulletin->userinfo['userid']. "'
");
}
help is very apreciated