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. |
#142
|
|||
|
|||
Using the class ForumOps (which by the way is brilliant)...... I am trying to figure out how to pass a delimited txt file of user information to it. Any help would be appreciated.
To elaborate - We have a corporate text file with the following 'user name','email address' I need to generate new VBulletin accounts for all them. Cheers! Dave |
#143
|
|||
|
|||
Hi,
I am now able to programmatically add user by modifying script above but I have a problem when I tried to insert user from our existing database that has more than 25 character. I?m getting an error ?Username cannot be longer than 25 characters?. Can you guide me on how can I disable the maximum characters allowed for username? I have basic knowledge in php and I look through the following included files but I can't see the function for validation the maximum length. require_once('./global.php'); require_once('./includes/class_dm.php'); require_once('./includes/class_dm_user.php'); Anybody have done this before? Thanks! |
#144
|
|||
|
|||
lanzeym, sounds like you may need to make your existing database field for username larger than 25 characters.
|
#145
|
|||
|
|||
hi bigtime!
The save() methods uses vBulletin "user" table that has varchar(100) length, so there's no need for changing field lenght. There should be a hard coded "maxlength" that I don't know where it is. |
#146
|
|||
|
|||
Oops, I misunderstood. I thought you were inserting users into your existing database...
|
#147
|
|||
|
|||
here's how to remove the validation.
AdminCP > vBulletin Options > User Registration Options > Maximum Username Length |
#148
|
|||
|
|||
Anybody can help with code example for manual users registration and login for vb 4 ?
|
#149
|
|||
|
|||
I'm trying to add a new user with VB 4.0.
I'm using the latest snippet of code but when I do $newuser->save(); it saves the record to the db but return to a Database error page ( of VB ). What can I do? --------------- Added [DATE]1279029801[/DATE] at [TIME]1279029801[/TIME] --------------- Ok maybe I solved. For VB 4 you need to add this: $newuser->pre_save(); before save() or checking errors |
#150
|
|||
|
|||
Hi,
I am trying to do something similar. I wrote a class inside a file in the main directory of my forum. This is the code: Code:
<?php // ######################### REQUIRE BACK-END ############################ require_once('./global.php'); class codeigniter_bridge{ function codeigniter_bridge(){ $this->usernamager =& datamanager_init('User', $vbulletin); } function prova(){ return $foruminfo = fetch_foruminfo(1); } } ?> Fatal error: Call to a member function do_db_fetch() on a non-object in /var/www/cyberludus.com/system/forum/includes/init.php on line 308 Where I do wrong? Thank you |
#151
|
|||
|
|||
The code seems to be working, but when in debug mode a lot of notices show up. I`d rather they shouldn`t:
PHP Code:
Then I got a question, is it possibile to add an user in an inactive state, and only after a third party email validation, enable him/her? I couldn`t find any column in the vb_user table that indicates this active/inactive state, any help? |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|