vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   merging members of two VBs (https://vborg.vbsupport.ru/showthread.php?t=44309)

izz 10-05-2002 11:03 AM

merging members of two VBs
 
I have a bi-lingual website for which I have baught two licences of VB.
My problem is that I want users who register in one of the two forums, to be automatically in submitte to both.
In other words, I want the two VB installations to use a single membership table.
What are the files need to be modified. I have the latest VB version.

Logician 10-05-2002 08:14 PM

I would say it may be easier to use 1 vb for your site instead of trying to merge 2 vb databases.

I recall I give this solution before but basically it's how it works:
Create 2 usergroups for each language. Set forum permissions so that each usergroup will access to the forums that is in its language. Then put a small link in the header named "Change Language" or smt. and create a one line hack which will change the usergroup of the user when clicked. So their languages and the boards they access changes either..

Just a thought..

izz 10-06-2002 06:01 AM

But I need not to change user permissions in each language version. I want all members to have the same privilages in both versions. But both versions will have different forums names and so.

Logician 10-06-2002 07:25 AM

This was what I meant. Say you have 2 boards
a) Help (In English)
b) Hilfe (In German)

Configure the access permissions so that HELP group is visible to only usergroup 20 and Hilfe is visible to usergroup 21. Then create your link in the header and make it display the text "ENGLISH BOARD" if the visitor's usergroup is 21 and "DEUTCHE" if visitor's usergroup is 20.

If a visitor from usergroup 20 visits your board he will only see the board HELP and he didnt even know you have another board named "Hilfe", (let alone its contents). He will also see a text in the neader "DEUTCHE" and if he can understand German, he can click it and to his ignorety the hack will change his usergroup to 21 on the background. Now he will see your board differently. Board HELP dissappears for him while a new forum HILFE appears. You can even apply different styles/colors/buttons etc. to different languages. So you would have 1 board but from the visitor's point of view they can think you have 2 seperate boards..

Chris M 10-06-2002 08:51 AM

That is clever...

How would you make a link that changes their usergroup?:confused:

Satan

izz 10-06-2002 09:13 AM

Sound interesting
Can you please give me the PHP code that changes the usergroup according to the language?
Will the usergroup assigned to the user override his original usergroup (if he is a moderator for example)?

Logician 10-06-2002 10:05 AM

ok this is not tested but should work:

1- Edit template phpinclude and add this:

PHP Code:

if ($bbuserinfo['usergroupid']==E) {$change_lan=' <a href="misc.php?s='.$session[sessionhash].'&action=changelanguage&language=en">English</a>  ';}
elseif (
$bbuserinfo['usergroupid']==D) {$change_lan=' <a href="misc.php?s='.$session[sessionhash].'&action=changelanguage&language=de">Deutch</a>  ';} 

(Replace E and D with the usergroupids)

2- edit misc.php, find:

PHP Code:

// ############################### start who posted ############################### 

Before that add:

PHP Code:

if ($action=="changelanguage") {
include(
"./global.php");
if (
$bbuserinfo['usergroupid']==AND $language='en')
{
$DB_site->query("UPDATE user SET usergroupid=E WHERE userid=$bbuserinfo[userid]");
}
if (
$bbuserinfo['usergroupid']==AND $language='de')
{
$DB_site->query("UPDATE user SET usergroupid=D WHERE userid=$bbuserinfo[userid]");
}
 
$goto="index.php?s=$session[sessionhash]";
eval(
"standardredirect(\"".gettemplate("language_changed")."\",\"$goto\");");


(Replace E and D with the usergroupids)

3- Create a template named:language_changed
its content: "Language Changed.. You are taken to the forum home"


4- Edit header template and put $change_lan to anywhere you like..

That's it..

And yes this option will only apply to usergroups E and D, not mods, admins etc. If you set your permissions correctly, they will see the entire board..

Make sure the general permissions of usergroups E and D are exactly same except forum access permissions. (Say if E is granted PM rights, either should D)

There maybe a parse errors etc, since I didnt test it, but nothing we can't fix. Just holler if it does not work.. :)

Chris M 10-06-2002 10:28 AM

It works well:)

Satan

Chris M 10-06-2002 10:41 AM

1 Attachment(s)
:D

This first one is of an English User:D

Satan

Chris M 10-06-2002 10:42 AM

1 Attachment(s)
This one is of the Re-direct Screen...:D

Satan


All times are GMT. The time now is 12:34 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.01071 seconds
  • Memory Usage 1,744KB
  • 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
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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