Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-05-2002, 11:03 AM
izz izz is offline
 
Join Date: Dec 2001
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 10-05-2002, 08:14 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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..
Reply With Quote
  #3  
Old 10-06-2002, 06:01 AM
izz izz is offline
 
Join Date: Dec 2001
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 10-06-2002, 07:25 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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..
Reply With Quote
  #5  
Old 10-06-2002, 08:51 AM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That is clever...

How would you make a link that changes their usergroup?

Satan
Reply With Quote
  #6  
Old 10-06-2002, 09:13 AM
izz izz is offline
 
Join Date: Dec 2001
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)?
Reply With Quote
  #7  
Old 10-06-2002, 10:05 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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..
Reply With Quote
  #8  
Old 10-06-2002, 10:28 AM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It works well

Satan
Reply With Quote
  #9  
Old 10-06-2002, 10:41 AM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default



This first one is of an English User

Satan
Attached Images
File Type: jpg change to deutsch.jpg (43.0 KB, 0 views)
Reply With Quote
  #10  
Old 10-06-2002, 10:42 AM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This one is of the Re-direct Screen...

Satan
Attached Images
File Type: jpg lang changed.jpg (14.2 KB, 0 views)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:45 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.04534 seconds
  • Memory Usage 2,287KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete