wtrk
11-11-2010, 06:04 PM
hi,
im not much of a programmer, but im determined to make this project im working on work, so i need a bit of help.. im trying to get a users current user group and change (update) it using the users datamanager. but im totally confused.. the documentation is so skimpy, but this is what ive been able to figure out based on the examples and text thats available...
so here my questions that i need help with..
1) First, I understand I need to create the datamanager that Im going to use. so I want to use the users datamanager so correct me if I wrong but I do that like this:
$dataman =& datamanager_init('User', $vbulletin);
and then if i understand the docs correctly, i need to then set the existing data like this:
$dataman->set_existing($vbulletin->userinfo);
so now ive got the datamanager for users going and ive got it with the existing data in it right? so now i need to get the current users usergroup and then update it with a new one right? is this how i do that?
$newgroup = 59;
$dataman->setr('usergroupid', $usergroupid);
if i just leave it at that, have i successfully changed a users group?
and now am i correct in assuming that the user datamanager also includes all the profile fields and custom profile fields? so my next question is how do i check the bitfields for the profile field that i want to base the usergroup change on?
thanks!
im not much of a programmer, but im determined to make this project im working on work, so i need a bit of help.. im trying to get a users current user group and change (update) it using the users datamanager. but im totally confused.. the documentation is so skimpy, but this is what ive been able to figure out based on the examples and text thats available...
so here my questions that i need help with..
1) First, I understand I need to create the datamanager that Im going to use. so I want to use the users datamanager so correct me if I wrong but I do that like this:
$dataman =& datamanager_init('User', $vbulletin);
and then if i understand the docs correctly, i need to then set the existing data like this:
$dataman->set_existing($vbulletin->userinfo);
so now ive got the datamanager for users going and ive got it with the existing data in it right? so now i need to get the current users usergroup and then update it with a new one right? is this how i do that?
$newgroup = 59;
$dataman->setr('usergroupid', $usergroupid);
if i just leave it at that, have i successfully changed a users group?
and now am i correct in assuming that the user datamanager also includes all the profile fields and custom profile fields? so my next question is how do i check the bitfields for the profile field that i want to base the usergroup change on?
thanks!