PDA

View Full Version : Link existing game name to vbulliten username


tyip
10-18-2011, 03:15 AM
I'm setting up a vbulletin forum for work, and we're trying to determine if we can link our user's existing usernames in our app to vbulletin. Similar to how Blizzard links player names to their forums, we want continuity between the forum usernames and the in game usernames.

A couple of questions came up:


Is there a way to programmatically create a vbulletin user?
Is there a way to not allow manual user registration?
Can we edit the user's vbulletin alias at any given time?
Has anyone done this!?


Our game is Valor: http://www.playmesh.com

kh99
10-18-2011, 08:25 PM
I can try to answer a few of these:


Is there a way to programmatically create a vbulletin user?

Yes, the code is in admincp/user.php, around line 963, it starts like this:

// ###################### Start do update #######################
if ($_POST['do'] == 'update')
{

so copying that would probably be a good place to start.


Is there a way to not allow manual user registration?

I'm not sure if there's an option to turn it off, but I think you could take out the links to the register page (or change them to go elsewhere) by editing templates, and also remove register.php.


Can we edit the user's vbulletin alias at any given time?

Yes, I believe you can change the vb user name whenever you want using the same code from admincp/user.php to create/edit a user (create a dm object, set only the userid and name fields, then save). You'd have to test that though, I'm not sure which fields are needed to be save to call save() successfully. I think if you have the user's info you can call set_existing(), then you'd just need to set a new username. (See includes/class_dm_user.php).