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. |
#72
|
|||
|
|||
Quote:
PHP Code:
-Alex |
#73
|
|||
|
|||
Yup, seems that that does work. Can't seem to figure out how to do.
I tried putting PHP Code:
I'll have to debug this on my end it seems. I think I may have figured it out. thanks =) I'll post back when I have a definite answer. |
#74
|
|||
|
|||
Recoded my reg form and it works fine now. Can't seem to work out the login form, so I looked at your login script.
PHP Code:
|
#75
|
|||
|
|||
Weee! EXACTLY what im looking for @amatulic ! Works Perfect! Thx!
|
#76
|
|||
|
|||
amatulic,
Your code works great from a PHP page that has no other includes, but as soon as I plugged it into my own CMS, I got the dreaded: PHP Fatal error: Call to a member function query_first_slave() on a non-object in /var/www/html/papatangopapa.com/forums/includes/functions.php on line 1194 My CMS has its own session management stuff and also uses a custom __autoload function, I wonder if that breaks things in some weird way. --------------- Added [DATE]1195925781[/DATE] at [TIME]1195925781[/TIME] --------------- I think it's due to vBulletin's insane reliance on global variables. When you have: A.php including init.php and functions.php directly, there is no problem. When you have: a function in B.php including including C.PHP, which includes init.php and functions.php, you get: PHP Fatal error: Call to a member function query_first_slave() on a non-object in /var/www/html/papatangopapa.com/forums/includes/functions.php on line 1194 --------------- Added [DATE]1195926210[/DATE] at [TIME]1195926210[/TIME] --------------- That's also how and why you might end up using cURL in order to keep your application and the namespace polluting vBulletin back-end completely separate. |
#77
|
|||
|
|||
Hi!
I'm using 3.6.8 version, I'm trying to add user to vb using my own registration system. The constructor of the class I have take 2 parameters in input function vB_DataManager_User(&$registry, $errtype = ERRTYPE_STANDARD) How I have to use it? May I include directly this class in my code... it look like not... How can I do? I proposed another way to solve this problem here: https://vborg.vbsupport.ru/showthrea...27#post1389327 Thanks |
#78
|
|||
|
|||
Would this approach still work in 3.6.8?
Quote:
|
#79
|
|||
|
|||
I am looking to implement a similar system managing vBulletin users from an asp site. I'm very comfortable with asp, but not at all with php -- any pointers as to how to (and how not to) approach this would be much appreciated.
|
#80
|
|||
|
|||
Quote:
then i need to activate this user when his account on my site activated --------------- Added [DATE]1197356952[/DATE] at [TIME]1197356952[/TIME] --------------- it works properly i'm using 3.6.8 |
#81
|
|||
|
|||
I've been trying to get your code working, but I keep getting the error
Code:
Fatal error: Registry object is not an object in /includes/class_dm.php on line 177 Code:
require_once ($_SERVER['DOCUMENT_ROOT'] . "/include/class.forumops.php"); $forum = new ForumOps(); Thanks --------------- Added [DATE]1197991803[/DATE] at [TIME]1197991803[/TIME] --------------- Quote:
Code:
require_once ($_SERVER['DOCUMENT_ROOT'] . "/include/class.forumops.php"); $forum = new ForumOps( $vbulletin ); Code:
function __construct( &$vbulletin ) // constructor { $this->vbulletin =& $vbulletin; $this->userdm =& datamanager_init('user', $vbulletin, ERRTYPE_ARRAY); } |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|