View Full Version : Getting Member list + adding user.
newsun
01-24-2012, 07:14 PM
Ok, so I've got the task of adding new members to our vB forum from an account we already have in our system. I figured the API would be where to start, but it's confusing my brain for some reason on how to use it at all.
Does anyone have any good examples of a complete php script that can do the above two things:
get member list
add member
I'm also willing to use another method as I have not gotten any API code working yet.
newsun
01-26-2012, 06:34 PM
No one has any input on this?
Lynne
01-26-2012, 09:46 PM
Have you tried looking in our articles forums? I'm pretty sure there are a couple of articles on adding users there.
newsun
01-26-2012, 10:02 PM
I saw one on this for v3 that didn't include any of the basic code to get connected to the API in the first place and it was also not for v4 so I dunno what would transfer over once i actually could get API output.
Basically if someone could show me how what to post to api.php via get to start using the API methods, I'm sure I could manage the rest. There are methods listed for listing the users and for registering them. I'm mostly confused on the getting started part.
Lynne
01-26-2012, 10:40 PM
The API for creating a user in vb3 is probably not much different than creating a new user in vb4.
If I were going to do what you described, I think I would look at admincp/user.php for the code that gets executed when a user is added from the admincp. It's this section, starting around line 980:
// ###################### Start do update #######################
if ($_POST['do'] == 'update')
It's basically
$userdata =& datamanager_init('User', $vbulletin, ERRTYPE_ARRAY);
$userdata->adminoverride = true;
$userdata->set('something', $somevalue);
// etc, etc
$newuserid = $userdata->save();
As far as I know there is no documentation of everything you can set() (although there may be an article somewhere), but I believe they mostly match the columns in the user table (and you can figure things out by comparing the admincp form fields to what gets set in user.php).
newsun
02-17-2012, 08:01 AM
I just went ahead and access the database directly for this and it worked fine.
Selected all the records, then parsed through them to find the settings I needed and now I can add users directly to the dbs easily.
Thanks for help.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.