The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Setting user profile fields with the data manager
Hi,
Alright, I finally have a script working which will insert users into my vBulletin installation when POSTed to. See the following: Code:
<?php ob_start(); define('THIS_SCRIPT', 'add_user.php'); chdir('C:\path\to\httpdocs'); require_once('./global.php'); require_once('./includes/class_dm.php'); require_once('./includes/class_dm_user.php'); $username = $_POST['username']; $email = $_POST['email']; $password = $_POST['password']; $usergroupid = $_POST['usergroupid']; $timezoneoffset = $_POST['timezoneoffset']; $key = $_POST['key']; $valid_key = md5($username . iwca_astound_world_success_88_1973); #if ($key != $valid_key) { #exit("Incorrect Key"); #} $userdm = new vB_DataManager_User($vbulletin, ERRTYPE_ARRAY); $userdm->set('username', $username); $userdm->set('email', $email); $userdm->set('password', $password); $userdm->set('usergroupid',$usergroupid); $userdm->set('ipaddress', $ipaddress); $userdm->set('timezoneoffset', $timezoneoffset); $userdm->set_bitfield('options', 'adminemail', '1'); $userdm->set_bitfield('options', 'showemail', '1'); #If there are errors (eMail not set, eMail banned, Username taken, etc.) you can check for errors using if (count($userdm->errors)) { for($i=0; $i<count($userdm->errors); $i++) { print "ERROR{$i}:{$userdm->errors[$i]}\n"; } } else { # If everything is OK $newuserid = $userdm->save(); echo "Account created!"; } chdir('C:\path\to\httpdocs'); ob_end_flush(); ?> According to this post (https://vborg.vbsupport.ru/showpost....61&postcount=6), the data manager can't set custom fields. He did however provide code, which unfortunately I don't quite understand. Could someone please tell me how I could insert this code into my add_user.php script to set user profile fields after creating their account with the data manager? Thanks a lot in advance! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|