Log in

View Full Version : user datamanager and custom db fields


steveheinsch
03-23-2010, 08:08 PM
Let's say you have added some extra fields to the vb user table. If you are using the user datamanager, will it also update the extra fields using the regular methods?

Something like:

//new user vars to set
$new_level = 34;
$professional_title = 'Law Assistant';

$userdm =& datamanager_init('User', $vbulletin);

//load original user data
//(basically SELECT * FROM user WHERE userid = $user_id)
//this is also selecting a custom field called "professional_title"
$user_data = $this->get_vb_user($user_id);

//load existing user_data into datamanager
$userdm->set_existing($user_data);

//set new usergroup
$userdm->set('usergroupid', $new_level);

//should this work using the custom field?
$userdm->set('professional_title', $professional_title);

//check data
$userdm->pre_save();

//if ok, save for reals
// ...blah blah


Thanks.