Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons

Reply
 
Thread Tools
Set forum-language automatic to browser-language for first-visitors Details »»
Set forum-language automatic to browser-language for first-visitors
Version: 2.00, by JoergZ JoergZ is offline
Developer Last Online: Dec 2012 Show Printable Version Email this Page

Version: 3.5.0 Rating:
Released: 09-30-2005 Last Update: 10-06-2005 Installs: 39
Uses Plugins
 
No support by the author.

Originally I have not planned to bring my Hack "Language Selection for Guests" to vB 3.5, because in 3.5 the language can be selected with the drop-down menu at the bottom.

But I was asked to make the automatic language-detection in 3.5 available. In case others are maybe interested in that too, I bring it here as new hack for vB 3.5


Short-description

This Hack detects the browser-language automatic and shows the board in the language of the user, if the user has never been at your board before or has no cookie for your board.

The automatic-detection of the browser-language was realised by WildChild


Requirements
  • vB 3.5 Gold (Tested up to 3.5.1)
  • Of course more than one installed and selectable language, otherwise this modification makes no sens
Installation-time

about 1 minutes


PLEASE CLICK THE INSTALL BUTTON IF INSTALLED!


Updates

01.10.2005 Thanks to the help of KirbyDE, now a standard-hook is used, so no code-modification is necessary

------------------------------------------------------------------------

If you want to test the hack after installing, do it like this:

- Log out of your forum. Dont klick any of the displayed links after logging out !
- Close your browser-window
- Open a new browser-window
- Set your language preferences in the browser
- Go to your forum homepage

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 10-03-2005, 04:19 PM
berberber berberber is offline
 
Join Date: Aug 2004
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes, but Search engines, have no language set, and some Browsers not as well, so it would make sense for me, that in first place, it would depend on users choice, but then, on forum admins choice.

For example on my forums, i Have a french area, I would like to be seen like french as default. KirbyDE already said its not possible via plugins, I tried, but did not get it.
Bernhard
Reply With Quote
  #13  
Old 10-03-2005, 08:02 PM
GrendelKhan{TSU's Avatar
GrendelKhan{TSU GrendelKhan{TSU is offline
 
Join Date: Jun 2005
Location: Boston | Seoul, S. Korea
Posts: 1,311
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by JoergZ
No, of course the user can change it.

This automatic detected language is only used, as long the user don't select another one or he has a cookie from an earlier vist. So it is really for users, that come the first time to your site, or has logged out, so the cookies were deleted.

When the users select another language, the selected language is taken and is not switched back to the automatic detected, because then there is an entry in the cookie.

Currently I am trying to use the standard-hooks, so no code-changes are needed at all. Maybe this evening there is an update for my hack.


J?rg


EDIT: I have updated the hack, so no more code-modification is necessary. Thanks very much to KirbyDE for his help.
cool!!

<< installed. thanks!! ^^
Reply With Quote
  #14  
Old 10-05-2005, 05:01 AM
betablue betablue is offline
 
Join Date: Jul 2004
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you, great idea. I just installed this, however it seems to have a glitch:
My Borwser language is set to EN-US & En (in Firefox) and to En-Ca in IE.

When i go to the forum without a cookie set (logged out), then the forum language auto-sets to Spanish - Mexico. The forums' Default Language is EN-US and it has following language packs installed: Chinese, Chinese-TW, German (Du & Sie), English-US (Default), Spanish - MX and Polish - PL

Any ideas?
Reply With Quote
  #15  
Old 10-05-2005, 05:43 AM
berberber berberber is offline
 
Join Date: Aug 2004
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello, are you sure you set it correctly up, just edit the plugin, in the plugin manager, to make sure you set the right languageids.
Reply With Quote
  #16  
Old 10-06-2005, 08:44 PM
JoergZ JoergZ is offline
 
Join Date: Jun 2002
Location: Germany
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@betablue: Did you checked the code in the plugin, that all language-assignments are correct as berberber wrote ?

For detecting EN-US, you need e.g. an entry like this:


PHP Code:
case 'en-us'
        
$_REQUEST['langid'] = X
        break; 
X must be replacced by the language-id in your forum.

The same you must do for all other languages that you want to have detected and assigned to an installed language.

I will test it with en-us setting in Explorer at the weekend, when I am back at home.


J?rg
Reply With Quote
  #17  
Old 10-13-2005, 03:22 PM
GrendelKhan{TSU's Avatar
GrendelKhan{TSU GrendelKhan{TSU is offline
 
Join Date: Jun 2005
Location: Boston | Seoul, S. Korea
Posts: 1,311
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

AHHHHH....

I upgrade vb, then tried reinstall this.....
now I get huge error and my board is down

Quote:
Fatal error: Cannot redeclare rk_getenvvar() (previously declared in /home/MYSITE/public_html/forums/includes/init.php(273) : eval()'d code:54) in /home/MYSITE/public_html/forums/includes/init.php(273) : eval()'d code on line 185
any ideas? HALPP!!!
Reply With Quote
  #18  
Old 10-13-2005, 03:34 PM
JoergZ JoergZ is offline
 
Join Date: Jun 2002
Location: Germany
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by GrendelKhan{TSU
I upgrade vb, then tried reinstall this.....
From which vB-version to which vB-version did you upgraded your board ?

Why have you re-installed the hack after you upgraded your board ? When you had the first version of the hack installed, did you removed it before ?

Quote:
Originally Posted by GrendelKhan{TSU
...and my board is down
Did you not tested it on a test-installaton ?

Quote:
Originally Posted by GrendelKhan{TSU
any ideas?
At the moment not, sorry, because I just re-installed the hack in a test-board, and it works.

Did you changed by mistake something in the plugin-code except in the area where you define your language-id's ?


J?rg
Reply With Quote
  #19  
Old 10-13-2005, 03:34 PM
GrendelKhan{TSU's Avatar
GrendelKhan{TSU GrendelKhan{TSU is offline
 
Join Date: Jun 2005
Location: Boston | Seoul, S. Korea
Posts: 1,311
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

oh no!! can't even log into my admin cp!!!

how do i fix this??!?!!?!? +_+
Reply With Quote
  #20  
Old 10-13-2005, 03:39 PM
JoergZ JoergZ is offline
 
Join Date: Jun 2002
Location: Germany
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh man.. what have you done ?

Deactivate the plugin via phpMyAdmin.

Select the table "plugin" and select the record with the title "Set automatic forumlanguage to browserlanguage" for edit.

Then set the value for the field "active" to 0 (see screenshot)


Then the plugin is deactivated.


Jörg
Reply With Quote
  #21  
Old 10-13-2005, 03:40 PM
GrendelKhan{TSU's Avatar
GrendelKhan{TSU GrendelKhan{TSU is offline
 
Join Date: Jun 2005
Location: Boston | Seoul, S. Korea
Posts: 1,311
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm on 3.5.0 Gold .

well... I thought I had installed it before....but didn't seem to be working.... and so I wasn't sure as its late and I'm pretty tired and stupid.

so after looking through the plug-in manager, I didn't see it, so thought it was safe to just install again. didn't back up first. +_+

I ddin't change ANYTHING just downloaded the file and installed via PLUGIN upload/download.


man..I was so about to go to sleep...but now my board is COMPLETELY down so I'm freakin out. o_0

any other help would be very very appricated.
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 04:51 AM.


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.11701 seconds
  • Memory Usage 2,312KB
  • Queries Executed 25 (?)
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
  • (5)bbcode_quote
  • (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
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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