vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=34)
-   -   Set language by Forum (https://vborg.vbsupport.ru/showthread.php?t=82652)

Andreas 06-07-2005 10:00 PM

Set language by Forum
 
Set Language by Forum
This hack allows you to specify the language that should be used for each forum.
If a language is set, it will override the users selection and board default language
ATTN: This adds 1 query when a forum with language override is being viewed.

Details
Queries to run: 1
Files to Edit: 2
Difficulty: Difficult

I am releasing this as beta because i am not sure if it does not produce any side-effects.
Please let me know if it does work.

History
1.00 Initial Release
1.01 Updated installation instructions to (hopefully) make them easier to understand

kafi 06-08-2005 07:43 AM

This is something I was looking for. Since I am not coder, i will wait with install for profs review .-)
Any screenshots?

Phalynx 06-08-2005 10:36 AM

Great Idea, thanks for sharing.

Andreas 06-08-2005 12:22 PM

Hmm, there is not much to see - except a new option in Forum Manager.
Anyway, screenshot attached :)

GetGamer.com 06-09-2005 02:05 PM

Can someone post a URL to a site using this mod? I looked at Kirby's site but I couldn't find a forum where it was being used.

GetGamer.com 06-17-2005 08:42 PM

Kirby, thanks for the demo. I've installed at my site, and the language setting is saved when I edit the forum, but it's not working when you browse to the forum.

Maybe I'm misunderstanding something from Step #2 of your instructions:
PHP Code:

2In global.php
   FIND
   
--------------------------------------------------
   
// #############################################################################
   // Get date / time info
   
fetch_options_overrides($bbuserinfo);
   
fetch_time_data();

   
// global $bbuserinfo setup -- this has to happen after fetch_options_overrides
   
if ($bbuserinfo['lastvisit'])
   {
    
$bbuserinfo['lastvisitdate'] = vbdate($vboptions['dateformat'] . ' ' $vboptions['timeformat'], $bbuserinfo['lastvisit']);
   }
   else
   {
    
$bbuserinfo['lastvisitdate'] = -1;
   }

   
// get some useful info
   
$templateversion = &$vboptions['templateversion'];

   
// #############################################################################
   // initialize $vbphrase and set language constants
   
$vbphrase init_language();
   --------------------------------------------------

   
MOVE this block ABOVE
   
--------------------------------------------------
   
// #############################################################################
   // ######################## START TEMPLATES & STYLES ###########################
   // #############################################################################
   
--------------------------------------------------

   
Then ABOVE the moved block ADD
   
--------------------------------------------------
   
// Fetch Language Override if specified
if ($foruminfo['languageid'] AND $foruminfo['languageid'] != $bbuserinfo['languageid'] AND $foruminfo['languageid'] != $vboptions['languageid'])
   {
    
$language $DB_site->query_first("SELECT languageid" fetch_language_fields_sql(0) . " FROM " TABLE_PREFIX "language WHERE languageid = " intval($foruminfo['languageid']));
    
$bbuserinfo array_merge($bbuserinfo$language);
   }
   -------------------------------------------------- 

I don't really understand the point of moving the comment block up (though I did so anyways). Is there something that needs to happen to reinitialize global.php?

If it helps, this is the forum in question, and the language file I've specified is Spanish (obviously).

Andreas 06-17-2005 08:48 PM

OK, in other words:

Locate the the first Code-Block that is being shown in the instructions, cut it out.
Now locate the second code block and paste the code you just cut out above that.

Then above the code you just pasted add code block 3.

I know that this Hack is complicated, that's why I put it in Beta ;)

GetGamer.com 06-17-2005 09:02 PM

Thanks Kirby, that did the trick. The wording on step two is a little awkward, and you're explanation makes a lot more sense.

Andreas 06-17-2005 09:10 PM

;)
My english isn't that perfect, sorry.
Gonna update the instructions now it make it more clear.

Khashyar 08-27-2005 04:41 AM

Hi Kirby,

A wonderful hack, thank you for sharing it...

I would also want a way that, for example, a German speaker who is in the German language forum section on my website, can click on the navigational bar choices on top, and be sent to the "memberlist," or other pages in their own language as well (in the langauge of that particular forum).

Do you know of a way to do this?

Thanks again for sharing your useful hack.

Khashyar

Khashyar 08-31-2005 08:30 AM

Hi Everyone,

I do like having this hack in my forums.

However, I am finding that the charset settings that are inluded in the language packs (the Russian pack, for example) is not being applied to the forum.

My default forum language is English, but although after the hack, the Russian language pack IS being applied, the Russian letters are not displaying correctly.

I checked, and the charset setting is correct (windows-1251).

Is anyone else having the same issue?

Khashyar

berberber 09-15-2005 11:37 AM

Hello, would that be released or 3.5 in the future ?

Bernhard

Andreas 09-15-2005 12:05 PM

I don't plan to port this for 3.5, as it can't be done without File Edits.

berberber 09-15-2005 12:12 PM

I didnt any plugins for now, but if i understand well, whats not possible is to add the acp part, but with a file to edit , with correspondance between languageid and forumid, it should be makable or am i wrong ? (perhaps i would try myself in this case)
Bernhard

Andreas 09-15-2005 12:17 PM

The ACP Part isn't a Problem, that can be done with Plugins easily.
But loading the specified language is ... at least I think so.
Gonna take a look at it now.

Khashyar 10-24-2005 03:51 AM

Hi Andreas,

Thank you again for creating this hack.

At the moment, even with this hack, it seems that a person can only register in the default language (even if the forum that they click "register" on is in a non-default language.

Any idea as to how to allow guests in a foreign language forum section to register in the same language as that forum?

Thanks for your ideas,

Khashyar

I tried to install another hack which allows

Andreas 10-24-2005 03:55 AM

The registration page is not assigned to any forum - it covers the whole board, thererfore it will always use the default language.
Maybe it would be possible to add languageid=$foruminfo[languageid] to the registration link, but not sure.

Khashyar 10-24-2005 04:33 AM

Thanks for responding, Andreas...

Actually, yes, for each language or even style template, it's psosible to add a &styleid=xx, and that will take you to the first page of a foreign page registration. But then, when you clikc the next button, the register.php file takes you to the default language page for the next page.

I wonder if there is a way to add a "styleid" or "languageid" to registration links in the register.php file? When a person goes to the registration page, does VB retain the info for the styleid or languageid variables so they can be called up?

Khashyar

Khashyar 10-24-2005 05:06 AM

Hi Andreas,

I actually tried to install a "Guest registration in detected language" hack by JoergZ, but it did not work because I believe that the changes to the global.php file from your hack is over-riding the guest language select option in the other hack, so that the guest registration language always will be the default language.

JoergZ's guest language registration hack modifies the sessions.php file.

Both of your hacks are great, and if you have any ideas as to how they can co-exist, then I would appreciate it very much.

Khashyar

Khashyar 10-24-2005 08:06 PM

Hi Andreas,

I fugured out how to make JoergZ's "guest registration hack" work for my forum.

Now, I have included both of your hacks in my forum. Thank you for contributing your hack.

Khashyar

Ben? 01-27-2006 03:42 AM

Hi Andreas,
you said that this hack should work with vB 3.5.x too.
I'm sorry .. but it does not. :(

I have made some changes in the files, so I have to use $vbulletin->userinfo instead of $bbuserinfo and $db->query_read() instead of $DB_Site->query() .. okay.
Should not be the problem ..

I upload the files and run the SQL query. Now I have the opportunity to change the language in the admin control panel .. hmm .. I thought I have it.
If I want to save the option I get this error message
Code:

Schwerer Fehler: Field languageid is not defined in $validfields in class vB_DataManager_Forum in /includes/class_dm.php (Zeile 485)
"Schwerer Fehler" ... is German and means "Fatal error" .. for all who do not speak/understand German language.
I know you (Andreas) do ;)

That within the verify()-method of class vB_DataManager_Form. I tried to set to this (without knowing what I do I admit ^^) ..
PHP Code:

$vbulletin->GPC['forum']['languageid'] = $language['languageid']; 

beneath this code block
PHP Code:

    $langs = array('Standardsprache');
    
$languages $db->query_read("SELECT languageid, title FROM " TABLE_PREFIX "language ORDER BY languageid ASC");
    while (
$language $db->fetch_array($languages))
    {
     
$langs[$language['languageid']] = $language['title'];   
    } 

Same error message.
I would be very pleased if you can help me with this.
Maybe a hint is enough, but currently I do not know what I have to do.

Thank you very much,
regards Ben.

Andreas 01-27-2006 01:39 PM

I said it is pretty similar, I didn't say that iw would be exactly the same ;)
If I got time i'll take a look into this.

Ben? 01-27-2006 04:53 PM

Quote:

Originally Posted by Andreas
I said it is pretty similar, I didn't say that iw would be exactly the same ;)

Yeah that's right. :P

Quote:

Originally Posted by Andreas
If I got time i'll take a look into this.

Thank you. I think a hint where to look may be enough .. maybe .. ^^

Ben? 11-02-2006 10:10 AM

*push* .. maybe someone else?

jhoyssa 03-09-2007 05:55 AM

I guess this hasn't gone any further? I'm running version 3.6.1 and this hack isn't working :(

Something like this would be very useful to me also. If someone has come across to any ways to do something like this, please let us know :)

Also, I have encountered a strange behaviour, which I don't fully understand, it sort of relates to this. I have a forum with four languages, and four main areas, where the discussion is made in the language in question (so there's English discussion, where the language of the interface should be English, Swedish discussion, where the language of the interface should be Swedish etc...).

If I use URL with the GET-parameter for the language selection from an external source, it works just fine, the correct forum opens up and the language is right (such as http://mydomain/forumdisplay.php?f=16&langid=2 to point to the English discussion and making the language selection to English). But if I set this URL to the category's Forum Link value, I get an error about redirecting (FireFox says: The page isn't redirecting properly, Firefox has detected that the server is redirecting the request for this address in a way that will never complete), and actually the links from the external source also stop working, why is this?

Anyhow, the default selection for forum's language would be much better choice anyway.

berberber 10-08-2007 10:09 AM

It would be so nice if there where a product corresponding to this.

ROTPAR 11-26-2007 12:30 PM

I am searching for anything similar to this mod because I want to have multiple language packs for my spanish, english, french board categories.

helpmehost 06-03-2008 05:05 PM

I prefer to hide a forum is is not related to the language some body chooses
so when some body chooses English he does not need to have the pain to look
at all chinese forums
I beleive that makes more sense

tazzarkin 06-18-2008 11:54 PM

can you update this for use with 3.7 ?

vktechnology 09-15-2008 05:52 PM

I want it too for 3.7

Say3 10-12-2008 10:18 PM

wanted for 3.7.3 Plz or anything like that :)

Hamel el Mesl 01-15-2009 03:37 PM

Waiting the 3.8 version...


All times are GMT. The time now is 02:56 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.01213 seconds
  • Memory Usage 1,825KB
  • 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
  • (1)bbcode_code_printable
  • (3)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (32)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