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


All times are GMT. The time now is 04:47 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.01003 seconds
  • Memory Usage 1,748KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete