vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Multi DB Register Mod/Plugin (https://vborg.vbsupport.ru/showthread.php?t=194053)

ptmuldoon 10-19-2008 10:27 PM

Multi DB Register Mod/Plugin
 
I'm wondering if anyone has already made some type of multi registration mod/plugin for VB. What I'm thinking here is:

1. The user registers normally in VB.
2. After activating their registration, the user is then inserted into additional multiple DB tables.

I'm thinking that the plugin would maybe let the site admin be able to input a set of 4 or 5 fields for each database they want to have the user added to, such as the additional DB name and DB table. And then which fields to add the user to for that table.

This way, you can add as many new databases as you need, and the users would be registered into each one when activating their account. Working on checks for dual usernames would be later a project down the road.

I know I could probably create a hook to insert the user into each database. Maybe just store all the additional code in one file, and then call/include that file during the activation. But each time I added another game (set of tables), I would have to modify the hook code.

I currently have a simple gaming site that has separate tables for each game, along with the users records, scores, etc. So I can't really give up the existing set of tables.

This would currently just be a registration/insertion into multiple database. I would expect that the user would then have to modify the various code of their other non-vb info to enable a single login. But I think that could be done by just getting the vb_user info and passing the variables to the other non-vb info.

Amenadiel 10-20-2008 03:25 AM

I'd rather see the way of doing this with triggers, directly in the database. In other words, make a trigger so an insertion on vb_user spawns an intertion on game1_user, which can have it's own trigger to spawn an insertion on game2_user

for each game you add, you would chain link to the last table with a trigger. It's like a domino effect.

ptmuldoon 10-20-2008 02:57 PM

Interesting.

I've been learning php on and off in my spare time. Triggers are whole new ball game for me, but look interesting indeed.

Would the initial trigger for VB to placed in a hook? I'm unsure if your allowed to actually modify any of the VB code or not.

I think you would also have to some kind of check during the login phase as well to add the user to each new games or additional table that comes along.

ie. You start with your VB database and 2 other DB's for 2 games you have going. The user first registered, and triggered each database to add them to DB's 2 and 3.

Now, you added a 3rd game (4th database). So on the login, it would roll through checking each database and insert the user into the 4th database. Another check for duplicate names or ID's would be useful too.

I'm still a rookie coder, but I may play around with the user of triggers this upcoming weekend when I get some extra time.

darkforce114 10-22-2008 12:42 AM

I'm also trying to do this. (Don't want the thread hi-jack, but maybe we can work on it together)

What I'm looking for is to copy

username from vb_username, copy it to login on kml_user
password from vb_username, copy it to pass on kml_user
email from vb_username, copy it to mail on kml_user

During registration.

Dismounted 10-22-2008 06:27 AM

Have you had a look at MySQL views?

darkforce114 10-22-2008 06:17 PM

Quote:

Originally Posted by Dismounted (Post 1650230)
Have you had a look at MySQL views?

Can you explain a little more?, I've been in phpmyadmin looking at the tables.

Adrian Schneider 10-22-2008 06:57 PM

I explain it a little here,
https://vborg.vbsupport.ru/showpost....22&postcount=3

thompson 09-25-2009 11:35 AM

old thread, but did you found a solution ?


All times are GMT. The time now is 11:36 AM.

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.01109 seconds
  • Memory Usage 1,726KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete