vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   vB3] 2 Forums, 1 User DB... possible? (https://vborg.vbsupport.ru/showthread.php?t=62315)

soopa 03-09-2004 04:16 PM

vB3] 2 Forums, 1 User DB... possible?
 
2 Seperate forums, site.com/forum1 and site.com/forum2 -- same login on each forum. has this be done?

I was never quite able to get this to work with VB2. It is very easy to do with phpBB, but i would rather go with vB3 then PHPBB.

I realize I would still need two BB licenses.

But is this at all easy?

Xenon 03-09-2004 05:24 PM

with vb3 it's not that hard to achieve as long as both forums are on the same DB, just different by the tableprefix.

but there could appear some problems if you are not really really carefull... (usergrouppermissions and such)

Xenon 03-09-2004 05:25 PM

addition: if you just want the same login, that's not that hard, as you can just insert the user into both db's when registring on one forum, but if you want to share the userprofile at all, then it would becoming the difficult way i mentioned :)

Dean C 03-09-2004 05:40 PM

Why not just have three db's. One central user database containing the user, userprofile tables etc and then another two for the rest (e.g. forums, settings, templates etc). Then have all 3 database all on the same username and password. Then do a long-haul search and replace within the file replacing all references to the " . TABLE_PREFIX ."user table for example with nameofuserdb." . TABLE_PREFIX . "user

That'd be quite easy to do :)

soopa 03-09-2004 05:40 PM

right id want to share profile and such,

bother sites are on same server, so ya they could use same DB.

phpbb has a constants.php file that contains a list of all the table names... so you can just hard code the table prefix for specific tables (user table) to be the same...

your saying we could do this with vB3, where does vB3 define all the table names, or are they spread through the code?

soopa 03-09-2004 05:44 PM

ah ok dean, so i guess you answered my last question. search and replace. hmm. sketchy...... but whattya gonna do i guess :)

but your idea is good, better then all sites on 1 db with diff table prefixes.

Dean C 03-09-2004 05:46 PM

Wow phpbb does that - that's a great idea :) The tablenames are hardcoded but I genuinely think this'd be a good idea to do in later versions of vB3. I suggest you suggest this as a feature suggestion. I was going to suggest a way to do this in not so many lines within config.php. However I'm not sure if php's capabilities would allow this.

Basically for all those that may know I was thinking that perhaps you could write some ifs and regexp's to check the instance of where the constant is being used. For example if the follow characters until the next gap of TABLE_PREFIX was user then replace it with something. I don't know if this is possible.

Xenon 03-09-2004 05:48 PM

Dean, that's exactly the way i mentioned above.
with that way you can produce some real problems if you are not carefully when creating new usergroups and such

Dean C 03-09-2004 05:50 PM

Note: to do this you would need two licenses as effectively you'd be running two forums :)

soopa 03-09-2004 05:52 PM

Quote:

Originally Posted by Dean C
Note: to do this you would need two licenses as effectively you'd be running two forums :)

course. the boards are already all online and licensed for VBB. yet another reason id rather not go to phpBB

soopa 03-09-2004 05:53 PM

Quote:

Originally Posted by Xenon
Dean, that's exactly the way i mentioned above.
with that way you can produce some real problems if you are not carefully when creating new usergroups and such

could you not just move the usergroups table into the `user-db` ?

what types of problems you have in mind?

soopa 03-09-2004 05:55 PM

Quote:

Originally Posted by Dean C
Wow phpbb does that - that's a great idea :) The tablenames are hardcoded but I genuinely think this'd be a good idea to do in later versions of vB3. I suggest you suggest this as a feature suggestion. I was going to suggest a way to do this in not so many lines within config.php. However I'm not sure if php's capabilities would allow this.

Basically for all those that may know I was thinking that perhaps you could write some ifs and regexp's to check the instance of where the constant is being used. For example if the follow characters until the next gap of TABLE_PREFIX was user then replace it with something. I don't know if this is possible.


yea its kinda neat. http://www.phpbb.com/kb/article.php?article_id=55

i will suggest it for vb. very handy.


as for adding db prefix to sql queries in vB code... easy nuff to do with text editor. rather find and replace by hand anyway just to make sure im not flubbin nothing.


just looking at the vB3 DB schema it could be quite a challenge figuring out what tables exactly to seperate... hmm.


would this also work for vB2 do you imagine?

Dean C 03-09-2004 06:25 PM

Well I kind of just did a practice of how this would work.

Assuming you had a table prefix (WILL NOT WORK WITHOUT A TABLE PREFIX :)!) you add this within db_mysql.php:

PHP Code:

$query_string str_replace(TABLE_PREFIX 'user''a' TABLE_PREFIX 'user'$query_string); 

Below:

PHP Code:

global $query_count$querytime

Now don't actually do this - This is just to illustrate how you could use it. You'd replace the a with the name of the database and a period and it'll work. The problem comes with the key fields like userid, usergroupid. Just a though for people thinking about doing this though :)

soopa 03-09-2004 07:18 PM

hmm. if both sites have the same user groups tho, this would not be a problem correct?

soopa 03-09-2004 07:20 PM

what lines of db_mysql are you adding these snippets?

Dean C 03-10-2004 02:33 PM

It was just pseudo code not to actually be implemented. It was just to show the possibilities of how it could be done :)


All times are GMT. The time now is 11:47 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.01162 seconds
  • Memory Usage 1,753KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (16)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