Version: 1.01, by Andreas
Developer Last Online: Jan 2023
Version: 3.0.7
Rating:
Released: 06-07-2005
Last Update: 06-16-2005
Installs: 12
DB Changes
Code Changes Is in Beta Stage
No support by the author.
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
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
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:
2) In 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(); --------------------------------------------------
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?
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
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).