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. |
#82
|
|||
|
|||
Ok can anyone including the developers out there suggest a method for solving
PHP Fatal error: Call to a member function query_first_slave() on a non-object in /path/to/my/forum/includes/functions.php on line 1194 from doing a bit of research it seems this error comes up mostly when a file X.php included file Y.PHP and Y.PHP would include the code for adding a user and in turn would include the globals.php, class_dm.php and class_dm_user.php so it seems nested including is a problem for objects further down the line has anyone got any idea's of how we can solve this issue as i'd like to make use of the datamanager for inserting users rather than the silly method of SQL inserting which isnt the best method going |
#83
|
|||
|
|||
Quote:
PHP Code:
|
#84
|
|||
|
|||
i do include global.php
Quote:
|
#85
|
|||
|
|||
Nobody have any idea's on this? i might post this to the vbulletin programming forum and see if anyone see's it better there
|
#86
|
|||
|
|||
I was pleased to find amatulic's class.forumops.php as that was exactly what I needed, excellent work!
However, I found the user login part of it acting a bit weird. PHP Code:
If you look at the function, it does not use the $vbuser['password'] value at any point! This means, if you use this login function in some page, it logs in successfully any user no matter what she supplied as her password! You might need forcing successful login when you have custom user database you check against yourself and want to ignore vbulletin user database and still be logged in to vbulletin, but in my eyes, the class implied it actually checked against the vb user database (the comments have an example where it supplied the password). I replaced the login method as follows, now it returns true when the login is successfully, false otherwise. I'm not totally sure if the md5 passwords are totally correct here, but seem to work in my quick test. PHP Code:
Feel free to comment if I had misunderstood something, but I felt it would be important bring this issue up, if someone else uses this class as a login method assuming the same thing as I did. Oh, and this skips the userdata conversion part, as I felt it was a bit pointless in this context. |
#87
|
|||
|
|||
I have found the datamanager_user class (class_dm_user.php) in the includes folder of the vbulletin directory on my server.
Now could anybody please suggest me what files do I need to include in my script before I could instantiate the datamanager object and run the add process successfully? 1. What files do I need to include in my script to create a database connection? 2. Any function files that I need to include to run the process successfully? 3. Any other class file that is related with this class_dm_user.php file and required to be included as well? Thanks. |
#88
|
|||
|
|||
Is there any tables may be affected when adding a new user except for the 'user' table? If so, what are they?
|
#89
|
|||
|
|||
I am using your functions in my project and it worked very well! But now I want to add also an customavatar picture for new users. How can I do this with your ForumOps Code?
|
#90
|
|||
|
|||
Can anyone tell me where there might be a complete updated list of what can be set for a new user in vB 3.6.9 Seems the list provided in the initial post (see below) is a little dated.
Quote:
|
#91
|
|||
|
|||
I don't think there have be many changes, maybe just ask about a specific field either in this thread of one of the other vBulletin.org forums.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|