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

Reply
 
Thread Tools Display Modes
  #21  
Old 10-07-2002, 12:28 PM
izz izz is offline
 
Join Date: Dec 2001
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

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

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

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

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

Quote:
Originally posted by izz
May I ask you to rearrange your hack code to consider the following:
1. Language style changes with the user group.
First create a new "template set" for your Arabic language and edit all templates accordingly so that texts are in Arabic.

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:
$DB_site->query("UPDATE user SET usergroupid=E WHERE userid=$bbuserinfo[userid]"); 
AS:

PHP Code:
$DB_site->query("UPDATE user SET usergroupid=E, styleid=Englishstyleid WHERE userid=$bbuserinfo[userid]"); 
and

PHP Code:
$DB_site->query("UPDATE user SET usergroupid=E WHERE userid=$bbuserinfo[userid]"); 
AS:

PHP Code:
$DB_site->query("UPDATE user SET usergroupid=D, styleid=Arabicstyleid WHERE userid=$bbuserinfo[userid]"); 
Now when users clicks the link, their styleid will automatically change too (so does the language/colors/fonts everything about your forum)

Quote:
Originally posted by izz

2. Guests can see a default language style (Arabic in my case), and can see the language switching code
This will be again done in your Admin CP, you dont need any hacks.

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

: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:
if ($action=="changelanguage") { 
include(
"./global.php"); 
if (
$bbuserinfo['usergroupid']=='Arabic' AND $language='en'

$DB_site->query("UPDATE user SET usergroupid=English, styleid=English WHERE userid=$bbuserinfo[userid]");

if (
$bbuserinfo['usergroupid']=='English' AND $language='ar'

$DB_site->query("UPDATE user SET usergroupid=Arabic, styleid=Arabic WHERE userid=$bbuserinfo[userid]");

$goto="index.php?s=$session[sessionhash]"
eval(
"standardredirect(\"".gettemplate("language_changed")."\",\"$goto\");"); 

I have two usergrops: Arabic, and English
Two styles: Arabic and English

In the phpinclude template I put the following:
PHP Code:
if ($bbuserinfo['usergroupid']=='English') {$change_lan=' <a href="misc.php?s='.$session[sessionhash].'&action=changelanguage&language=en">English</a>  ';}
elseif (
$bbuserinfo['usergroupid']=='Arabic') {$change_lan=' <a href="misc.php?s='.$session[sessionhash].'&action=changelanguage&language=ar">Arabic</a>  ';} 
May be I have a problem in quoting the strings somewhere???
Reply With Quote
  #28  
Old 10-12-2002, 04:57 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Your forgot to edit usergroupids. Please follow me:

PHP Code:
if ($action=="changelanguage") { 
include(
"./global.php"); 
if (
$bbuserinfo['usergroupid']=='YYY' AND $language='en'

$DB_site->query("UPDATE user SET usergroupid=XXX, styleid=ZZZ WHERE userid=$bbuserinfo[userid]");

if (
$bbuserinfo['usergroupid']=='XXX' AND $language='ar'

$DB_site->query("UPDATE user SET usergroupid=YYY, styleid=WWW WHERE userid=$bbuserinfo[userid]");

$goto="index.php?s=$session[sessionhash]"
eval(
"standardredirect(\"".gettemplate("language_changed")."\",\"$goto\");"); 

and

PHP Code:
if ($bbuserinfo['usergroupid']=='XXX') {$change_lan=' <a href="misc.php?s='.$session[sessionhash].'&action=changelanguage&language=en">English</a>  ';}
elseif (
$bbuserinfo['usergroupid']=='YYY') {$change_lan=' <a href="misc.php?s='.$session[sessionhash].'&action=changelanguage&language=ar">Arabic</a>  ';} 
In the codes above:
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..
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 05:33 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.04187 seconds
  • Memory Usage 2,291KB
  • 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
  • (8)bbcode_php
  • (2)bbcode_quote
  • (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
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete