The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#6
|
|||
|
|||
![]()
OK, I tried this code and it worked for me (it inserted a user and there was no db error):
Code:
<?php // vBulletin define('REGISTERED_USERGROUP', 2); // typical default for registered users define('PERMANENT_COOKIE', false); // false=session cookies (recommended) define('THIS_SCRIPT', __FILE__); define('VB_AREA', 'External'); $dir = getcwd(); chdir('forum4.2.0/'); require_once('./includes/init.php'); // includes class_core.php require_once('./includes/class_dm.php'); // for class_dm_user.php require_once('./includes/class_dm_user.php'); // for user functions require_once('./includes/functions.php'); // vbsetcookie etc. require_once('./includes/functions_login.php'); // process login/logout chdir($dir); class Forum2 { private $dmuser; public function __construct() { global $vbulletin; $this->dmuser =& datamanager_init('User', $vbulletin, ERRTYPE_ARRAY); } public function register($data = array(), $login = FALSE) { global $vbulletin; foreach ($data as $key => $value) { if (!is_array($value)) { $this->dmuser->set($key, $value); } } if (isset($data['options']) && is_array($data['options'])) { foreach ($data['options'] as $key => $value) { $this->dmuser->set_bitfield('options', $key, $value); } } $this->dmuser->pre_save(); //print_r($this->dm); if (count($this->dmuser->errors) > 0) { return implode('<li>', $this->dmuser->errors); } return $this->dmuser->save(); } } $f2 = new Forum2(); $f2->register(array( 'username' => 'testing5', 'email' => 'test@test5.com', 'password' => 'password5' )); other than removing your controller class and changing the directory, the only thing I changed was the part in red, which said "dm" instead of "dmuser". ETA: I was thinking you might throw this is a php file and try it, to see if the problem is somewhere else. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|