vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Inserting a new user into multiple tables. (https://vborg.vbsupport.ru/showthread.php?t=72159)

Radon3k 11-25-2004 02:10 AM

Inserting a new user into multiple tables.
 
Currently on my site you have to register for the site and then again for the forums. What I would like is to be able to have one registration form that registers you for both the forums and the site. When you fill out the form and submit it, 2 queries are sent; 1 query to the actual website table that handles the user functions there and 1 query to the forum table to register the new user. However looking at the vBulletin code there were several queries made to the database for registering a new user. How does one go about accomplishing something like what I'm trying to do? When the user registers he/she should go into to standard usergroup. To make things a little more complex, I want to includ email activation through my site, not the forums. So when a user registers on the site, they are also registered on the forums and receive an email to activate their account. When the account is activated it updates both tables. Any ideas? Thanks. :)

Zachery 11-25-2004 02:56 AM

Quote:

Originally Posted by Radon3k
Currently on my site you have to register for the site and then again for the forums. What I would like is to be able to have one registration form that registers you for both the forums and the site. When you fill out the form and submit it, 2 queries are sent; 1 query to the actual website table that handles the user functions there and 1 query to the forum table to register the new user. However looking at the vBulletin code there were several queries made to the database for registering a new user. How does one go about accomplishing something like what I'm trying to do? When the user registers he/she should go into to standard usergroup. To make things a little more complex, I want to includ email activation through my site, not the forums. So when a user registers on the site, they are also registered on the forums and receive an email to activate their account. When the account is activated it updates both tables. Any ideas? Thanks. :)

I would do it though the vB end personaly :)

You are going to want to look at register.php for abit of help

Radon3k 11-25-2004 03:07 AM

I don't want to do the registering through the vBulletin end. I want vBulletin to have almost nothing to do with my main site which is why I'm doing it this way. The way it is setup now on my site is you have to register both on the site and the forums and I'm fine with that but I'm sure users would like to ease of one registration process. Also, I have looked through register.php and there were several sections that could potentially be involved with the registration process hence why I'm asking here.

Radon3k 11-27-2004 08:02 AM

Quote:

Originally Posted by Radon3k
I don't want to do the registering through the vBulletin end. I want vBulletin to have almost nothing to do with my main site which is why I'm doing it this way. The way it is setup now on my site is you have to register both on the site and the forums and I'm fine with that but I'm sure users would like to ease of one registration process. Also, I have looked through register.php and there were several sections that could potentially be involved with the registration process hence why I'm asking here.

Anybody have any suggestions?

Zachery 11-27-2004 06:40 PM

Quote:

Originally Posted by Radon3k
Anybody have any suggestions?

You are going to need to populate at least three rows in 3 tables everytime someone registers, like i said look at the register.php file for help.

Radon3k 11-29-2004 07:45 PM

Quote:

Originally Posted by Zachery
You are going to need to populate at least three rows in 3 tables everytime someone registers, like i said look at the register.php file for help.

I have looked in register.php and I don't see where it's inserting the user. It's checking so many conditions on where to put the user and I don't need that. I just want the user, when registered through my site, to go into the users awaiting validation usergroup. Everything else is normal and can be left as is. The password is also another issue I'm having as I don't understand the way vBulletin has encrypted the password (yes, I've looked in the correct functions file). I'm looking for a simple way to insert a user into the vBulletin database as well as mine (they are in separate databases and I can work around that).

Radon3k 11-30-2004 06:49 PM

I've looked through this file and maybe it's just that I don't understand it but I don't see where exactly this stuff is. I've looked through it and I see where the various actions are being done. I'm not looking for someone to write the code for me but instead point out the necessary code from the vBulletin files I need in order to make this work. I can write the code to integrate what I need as long as I have the right code from vBulletin.

Brad 11-30-2004 07:02 PM

Quote:

Originally Posted by Radon3k
I've looked through this file and maybe it's just that I don't understand it but I don't see where exactly this stuff is. I've looked through it and I see where the various actions are being done. I'm not looking for someone to write the code for me but instead point out the necessary code from the vBulletin files I need in order to make this work. I can write the code to integrate what I need as long as I have the right code from vBulletin.

Check this area of register.php out.

PHP Code:

// ############################### start add member ###############################
if ($_POST['do'] == 'addmember')



Radon3k 11-30-2004 08:01 PM

Quote:

Originally Posted by Brad.loo
Check this area of register.php out.

PHP Code:

// ############################### start add member ###############################
if ($_POST['do'] == 'addmember')



Thanks Brad. Do I need to include any file so that this works properly (aside from the file that holds the functions for the salt passwords)? I'm beginning to think it would be easier just to do the entire registration thing through vBulletin but I'll keep at it.

rake 11-30-2004 08:07 PM

yeah. doing it through vbulletin would be much easier. check for the query that inserts the info in the user table (look for something like $userid = $DB_site->insert_id(); ) and then switch databases and insert the stuff you need into your site database. don't forget to switch back to the vbulletin database after that.


All times are GMT. The time now is 11:26 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01134 seconds
  • Memory Usage 1,750KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete