The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Help with Language Change by Code
Hello,
I am developing a plugin that automatically changes the forum language depending on the hostname used to access to it. So if the user tries to access from forum.mysite.com and the language was set to Spanish, it will automatically change the forum language to English. Then if the user tries to access from foro.mysite.com and the language was set to English, it will automatically change the forum language to Spanish. I have made my plugin with this code: PHP Code:
It works, but I would like to be able to change the forum language without doing redirects. So when the hook is excecuted I can change by code the language. The things I need to know are: - Where should I hook the plugin so I can change the language before the language is initialized/updated? - How can I change the forum language by code? Thank you! |
#2
|
|||
|
|||
I think you can use hook location init_startup and set $_REQUEST['langid'] to the language id that you want. It should be the same as putting langid on the url. (look in includes/init.php and search for langid if you want to see what's going on).
|
#3
|
|||
|
|||
It worked!
This is the new code: PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|