Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Beta Releases

Reply
 
Thread Tools
Set language by Forum Details »»
Set language by Forum
Version: 1.01, by Andreas Andreas is offline
Developer Last Online: Jan 2023 Show Printable Version Email this Page

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.

Comments
  #2  
Old 06-08-2005, 07:43 AM
kafi kafi is offline
 
Join Date: Apr 2004
Posts: 379
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is something I was looking for. Since I am not coder, i will wait with install for profs review .-)
Any screenshots?
Reply With Quote
  #3  
Old 06-08-2005, 10:36 AM
Phalynx Phalynx is offline
 
Join Date: Feb 2004
Location: Erlangen, Germany
Posts: 2,747
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great Idea, thanks for sharing.
Reply With Quote
  #4  
Old 06-08-2005, 12:22 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, there is not much to see - except a new option in Forum Manager.
Anyway, screenshot attached
Reply With Quote
  #5  
Old 06-09-2005, 02:05 PM
GetGamer.com GetGamer.com is offline
 
Join Date: Jul 2004
Posts: 120
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 06-17-2005, 08:42 PM
GetGamer.com GetGamer.com is offline
 
Join Date: Jul 2004
Posts: 120
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #7  
Old 06-17-2005, 08:48 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #8  
Old 06-17-2005, 09:02 PM
GetGamer.com GetGamer.com is offline
 
Join Date: Jul 2004
Posts: 120
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Kirby, that did the trick. The wording on step two is a little awkward, and you're explanation makes a lot more sense.
Reply With Quote
  #9  
Old 06-17-2005, 09:10 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default


My english isn't that perfect, sorry.
Gonna update the instructions now it make it more clear.
Reply With Quote
  #10  
Old 08-27-2005, 04:41 AM
Khashyar Khashyar is offline
 
Join Date: Jan 2003
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply

Thread Tools

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 03:22 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05191 seconds
  • Memory Usage 2,301KB
  • Queries Executed 23 (?)
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)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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