The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Add new Users (automatically)
As this is a common request for integration purposes, I thought I should write up another HowTo If you want to add a new user to the vBulletin database, you can use Class vB_Datamanager_User. This Calss does make sure that everything is OK, it will also take care of the default registration options. Example PHP Code:
PHP Code:
If everything is OK PHP Code:
You can also set many other info too:
Besides that, you can also set the options Bitfield (Receive Admin PMs, etc.) PHP Code:
Value must be 0 or 1 (false or true), depending if you want to set the option or not. If the Options are not set, the Default Registration Options/Board Default Options will be used. Important Notice It is assumed that you are using this code from 'within' vBulletin, eg with the vBulletin backend loaded. If this is not the case, you must include smth. like the following code in global context: PHP Code:
This How-To is (C) 2005 by KirbyDE and you are not allowed to redistribute it in any way without my explicit consent. |
#112
|
|||
|
|||
Quote:
Code:
$newuser->set('password', $userinfo->password_clear); $newuser->set('usergroupid', $usergroup); $newuser->set('password', $userinfo->password_clear); $newuserid = $newuser->save(); |
#113
|
||||
|
||||
This "Call to a member function" problem occurs when you try to use the Data Manager from within another program.
I have a stand alone php script that works great to set the usergroups using the Data Manager, however when I try to integrate it into my CMS, I get these errors. I don't know if there is a workaround or not - short of removing the vB includes from the CMS application - but I suspect there is. It's simply beyond my understanding. I hat to go with the CURL and remote approach, but I might be forced into it if no one has any other ideas... -t |
#114
|
|||
|
|||
The problem was that the scope of the global variable is not available to all vbulletin code when called from a more complex script (standalone php file seems to work fine). Our newest addition to the JFusion programmers team has found a solution on how to make it work even from inside another program:
Code:
global $vbulletin;
require_once(CWD . './includes/init.php');
//work around to make global vbulletin stick
$registry = $vbulletin;
unset($vbulletin);
$vbDb = $registry->db;
//declare as global vbulletin's registry and db objects
global $vbulletin,$db;
$vbulletin = $registry;
//vbulletin db object which is needed for vbulletin's project tools addon
$db = $vbDb;
Thanks, Marius |
#115
|
|||
|
|||
Quote:
Code:
//load the vbulletin framework
define('VB_AREA', 'External');
define('SKIP_SESSIONCREATE', 1);
define('SKIP_USERINFO', 1);
define('CWD', 'path/to/vbulletin/forum'));
require_once(CWD . './includes/init.php');
//work around to make global vbulletin stick
$registry = $vbulletin;
unset($vbulletin);
$vbDb = $registry->db;
//declare as global vbulletin's registry and db objects
global $vbulletin,$db;
$vbulletin = $registry;
//vbulletin db object which is needed for vbulletin's project tools addon
$db = $vbDb;
Alan |
#116
|
|||
|
|||
No thank you Alan. Great piece of troubleshooting on the issue and you have raised the level of functionality for the vbulletin JFusion plugin by a lot! Its a pleasure to have you involved with JFusion.
Thanks, Marius |
#117
|
|||
|
|||
Has this tutorial changed muched for 3.7 since it was original written for 3.5?
|
#118
|
|||
|
|||
It seems for me that after including vBulletin's classes that the connection link to the DB is still open, and I can't access my previous DB link.
The problem is that my forum tables are in different datebase. How I can disconnect from VB link? Thanks. |
#119
|
|||
|
|||
Quote:
I have a userfield included in my registration process for Full Name. You can find it in the User Manager under the User Profile Fields section called ?Full Name?. Its writing ?field5? in the mysql database file. Can you tell me how to include this in the new users? creation? Thanks in advance for any suggestions or comments. -- L. James -- L. D. James ljames@apollo3.com www.apollo3.com/~ljames |
#120
|
|||
|
|||
I'm running 3.7 and had no problem installing the script.
|
#121
|
|||
|
|||
I'm using the integration plugin between Interspire's Email Markerter and i'm now, out of the blue experiencing these problems.
This seems to be working flawlessly except lately i've noticed that it's missed out a few members and not added them to my mailing list. Any ideas why this would happen? Here's my plugin code; Code:
$username = $userinfo['username']; $email= $userinfo['email']; $userid= $userinfo['userid']; $xml = "<xmlrequest> <username>admin</username> <usertoken>XX8410b36f01de9fe7df722ab2864677afddfaXX</usertoken> <requesttype>subscribers</requesttype> <requestmethod>AddSubscriberToList</requestmethod> <details> <emailaddress>$email</emailaddress> <mailinglist>1</mailinglist> <format>html</format> <confirmed>yes</confirmed> <customfields> <item> <fieldid>12</fieldid> <value>$username</value> </item> <item> <fieldid>13</fieldid> <value>$userid</value> </item> </customfields> </details> </xmlrequest> "; $ch = curl_init('http://www.maximum-jackson.com/interspire/xml.php'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $xml); $result = @curl_exec($ch); if($result === false) { echo "Error performing request"; } else { $xml_doc = simplexml_load_string($result); //echo 'Status is ', $xml_doc->status, '<br/>'; if ($xml_doc->status == 'SUCCESS') { //echo 'Data is ', $xml_doc->data, '<br/>'; } else { //echo 'Error is ', $xml_doc->errormessage, '<br/>'; } } |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|