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. |
#62
|
|||
|
|||
Add the following to the top of your script:
PHP Code:
|
#63
|
|||
|
|||
Thank you. That worked nicely.
But, now you've got me curious. How did changing the error reporting options fix the problem? Thanks, Ron. |
#64
|
|||
|
|||
Brilliant! Thanks Novastar!
|
#65
|
||||
|
||||
I've made it possible for you all to start creating members automatically here in this new hack:
https://vborg.vbsupport.ru/showthread.php?t=154637 I branched differently with all full sources of .NET and PHP using what I seen on the forums here with my .NET, and putting it all to work within XML_RPC I hope this helps others out as well. |
#66
|
|||
|
|||
We are using novastar's hack as mentioned above and it's working fine. However, adding users is one thing, updating is another .. which brings me to my next question:
Will this work to actually "update" an existing user, all we're trying to do is update an existing user in the forum to a new usergroup: PHP Code:
Any clues? is there a $userdm->update(); instead of save? I noticed a pre_save() option and now it's got me a bit curious Thanks in advance! Okay I did some more reading.. would someone be able to verify the following code: PHP Code:
|
#67
|
||||
|
||||
Quote:
Not off hand I don't think there is anything that can make it update without modifying the code to make it UPDATE, unless you make the set work as an update within a sql statement inside your PHP code.... |
#68
|
|||
|
|||
Hey novastar
How do you pass varibles from another DB? we tryed: PHP Code:
Quote:
|
#69
|
|||
|
|||
novastar ... added user without trouble, thanks!
any ideas on how to add the custom field data? |
#70
|
|||
|
|||
After much testing and examining vBulletin code, I finally finished my PHP class for performing basic operations on user accounts (create user, modify user, delete user, log on, log off). This has enabled me to integrate the forum into my site. Users who log in to my site are logged in to the forum, users who register on my site automatically get an account on the forum, etc.
Once that was done, I just had to modify all the vBulletin templates that contained a login form, logout link, register link, or user account modification link, and make sure those things use MY code for those functions. Now users can log in either from the forum or from my main site, and user account registration and modification are all handled on my main site, outside of the forum. It all works pretty well, without modifying a single line of the vBulletin source code. Here is the code for class.forumops.php, with extensive usage comments: PHP Code:
The wordwrapping above looks funny, but if you quote this message as if to reply, the wordwrapping will be correct when you copy and paste it. I hope this helps some people. -Alex |
#71
|
|||
|
|||
When using your code (amatulic), I get
Quote:
PHP Code:
PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|