![]() |
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. |
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.. |
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.
|
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.. |
That is clever...
How would you make a link that changes their usergroup?:confused: Satan |
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)? |
ok this is not tested but should work:
1- Edit template phpinclude and add this: PHP Code:
2- edit misc.php, find: PHP Code:
PHP Code:
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.. :) |
It works well:)
Satan |
1 Attachment(s)
:D
This first one is of an English User:D Satan |
1 Attachment(s)
This one is of the Re-direct Screen...:D
Satan |
1 Attachment(s)
This screenshot is of a German User...:)
Satan |
Quote:
I have been doing just that for a while, I have a board with about 4 languages and I use different styles making each lang. style the default for the right section with its own buttons and stuff has english, german, french and arabic at first I did one set of animated buttons that flip from language to another , then I changed to using sperate folders for each style theres still little things that ya have to share but no biggie |
but for this to work fine, the normal users must belong to one of the two groups, no?
If the user belong to a group like mods for example, he should not see the language switching link. |
Quote:
Quote:
|
what about renaming the "registered" group to English (E in your example) from VB control pannel? Will this default all new regisrtants to the English group?
|
sure it will
|
can you please justify step 4? We did not define a variable "change_lan", so what are you referring to? What is the exact code to put?
(sorry if the question sounds dummy, since I'm not a PHP guy) |
Quote:
|
:(
It sems a headache to me, it is not working. I also need to worry about having two completely different style sets since the other language is a right-to-left. It seems that having the two installations which use the same membership table is easier for perfect separation in styles and forums. Did anybody try this out before? |
Quote:
If you didnt like the solution and this is why you dont apply it, it's your call anyway.. But if this is the case I want to remind you that your project will require much more hacking than my solution and there a lot of tackles to handle in your 2 forums/1 database method. Just a few points you should be considering about your project: 1- You banned a user in one board, he is not banned in the other. You have to ban it there too. Same applies if you changed any info (usergroup, username, email, settings etc.) of the user in your Admin CP 2- If user forgets his email and uses lost password recovery form, only his password in one board will change. 3- If user changes his email, only one email in one board will change. 4- If user changes any of the settings after registration, the setting will apply to one board. There are many other issues you need to handle with way a lot of hacking on your project.. ;) In other words be ready to have much more headaches.. :knockedout: |
lol :)
thanks for your prompt response and manner. But I feel that your didn't get my suggested solution well. I meant two databases but one single (user) table. For example we may setup the english forum normally, but in the Arabic version we modify the register.php file so that it submits the registrations to the English database/user table. Whenever a user changes his password, the change will go to one table which is used by both versions. The hack should care that any user related action shall deel with the english database. This is just to clarify my idea. But still I guess your solution is easier but I may need more hints on deeling with styles, and how to let the "unregistered" viewers see the desired language. In all cases I appreciate your manner and logic Mr. Logician :) |
I believe I understood you quite well. Actually this is why I insist on my solution because what you are proposing is way harder than it seems to you. :)
Let's concentrate on my solution for a minute: What's your reservations on my hack and what do you think you cant do it in my hack while you can do in your method if you can apply? Enlist them and let me cure your worries. As for styles or Arabic templates, both solutions are same. You planned to create an arabic style set in your method, and in my solution I propose the same solution. Create a new style for arabic and apply to Arabic forums. Actually you can modify my code so that while the hack changes user's usergroup, it changes his default style too, so when user clicks the "Arabic" link in the header he will start browsing the forum in your Arabic style too. As for "unregistered" user it's upto you how they see your board. All you have to do is to apply a default style set for your forum and configure "guest"s board permisssions according to your wish. You can make guest see which ever forums you want and in whichever template set you like. Any other worries? ;) You might not want to apply my solution but you can not apply your method either. It wouldnt be possible to have 2 different database's and 1 shared user table unless you create a very sophisticated hack which would be very hard to develop. Unless what you think, it's not only registration.php that changes user's details in user table: Say user A in arabic board added someone to his ignore list. How do you plan to handle this request? (FYI. ignore lists are saved in "user" table), same applies someone sends a pm to someone else (pm popup warning is saved in user table), and there are way a lot of other incidents that you should deal with. To handle them, you cant simply make second board use first board's user table. Because it requires way too much hacking. User table is referenced in many places in many vb script. Your best bet would be program a script that will make replication. This is still hard to code and really a few people can handle this project. Besides even this might not be very handy and there are still some other tackles in this method. Check the discussion here: https://vborg.vbsupport.ru/showthrea...ht=replication Considering the simplicity of my solution, believe me you wouldnt want to embark upon your way.. :) |
Yes Mr Logician :) I beleive in your solution now... and want to apply it.
Please let me know if it is possible to ask more questions about this issue? Since I'm comming from ASP and has no experience in PHP I think I will need to ask about each piece of code I may use. If you feel the discussion is not usefull for the public anymore, we may proceed by PMs if you don't mind? |
Sure you can ask questions.. If your questions are private, contact me via email (I prefer email to PM), but if the answers to your questions would be helpful to others, you can ask here. So others than me can answer, while others than you can read. ;)
|
thanks for your generousity,
my first question is helpful to all people who may be interested in our hack. May I ask you to rearrange your hack code to consider the following: 1. Language style changes with the user group. 2. Guests can see a default language style (Arabic in my case), and can see the language switching code By then I will re-apply the code and tell you the problem I faced |
Quote:
Do same by adding a new "replacement set" for your Arabic language and edit your colors/fonts etc. Now create a new style set and point your Arabic template and replacements sets. Name it as "Arabic". Do all above for English language. Note style ids of English and Arabic styles. To test if they work or not, first make all stylesets (by modify) "user selectable" and then login to your User CP, and change styles. See if language changes as it should be. (You can find a lot of information about 2 styles in 2 languages in vbulletin.com, if you cant handle it) If everything is ok upto now, replace my hack code: PHP Code:
PHP Code:
PHP Code:
PHP Code:
Quote:
After you completed the steps above, click Modify/Forums and choose modify ALL forums according to this: Custom style set for this forum : (Any style you want) Override users custom styles: No The style you set will be the default for guest. So for example if you set English style here, all guests will see these boards in English.. As you can see most of the work is default vb behaviour and does not require any hacking. And in fact even if you used 2 different boards, you would do some of this work.. Hope this helps.. |
:hurt: :hurt:
Thank you very much. I don't know why the link we put in misc.php never apears in the page!! I used the following code: PHP Code:
Two styles: Arabic and English In the phpinclude template I put the following: PHP Code:
|
Your forgot to edit usergroupids. Please follow me:
PHP Code:
PHP Code:
All XXX will be replaced with the usergroupid of the English users All YYY will be replaced with the usergroupid of the Arabic users All ZZZ will be replaced with the styleid of the English styleset All WWW will be replaced with the styleid of the Arabic styleset If you dont know how to find usergroup ids this should help.. |
All times are GMT. The time now is 02:45 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|