please tell me, where the example...?
The example of... ?
You are not logged in. Please login or register.
PunBB Forums → Posts by fristaille
Pages 1
please tell me, where the example...?
The example of... ?
Great Modification ! Work fine, thanks.
But maybe don't forget to test the cookie too, so the user cannot modify it in order to inject something etc :
if($_GET['lang']) {
if (file_exists('lang/'.$_GET["lang"].'/common.php')) {
setcookie("thedefaultlang", $_GET['lang'], time()+3600);
$TheDefaultLang = $_GET['lang'];
} else {
$TheDefaultLang = $forum_config['o_default_lang'];
}
} else {
if(isset($_COOKIE["thedefaultlang"])
&& file_exists('lang/'.$_COOKIE["thedefaultlang"].'/common.php')) {
$TheDefaultLang = $_COOKIE["thedefaultlang"];
} else {
$TheDefaultLang = $forum_config['o_default_lang'];
}
}
$forum_user['language'] = $TheDefaultLang;
I finally found what i was looking for... thx anyway.
So... can i see this mod please ?
Hmm.
I did write a modification that, when it would normally choose the default language (none if specified), would instead autodetect the language based on their browser preferences.
Would this be useful to you?
Yes, very useful indeed !
Up, nobody have a clue on this ?
Hi, i want to manage the displayed language for each guest user without change defaut language or forcing the user to register, is it possible ?
Thanks a lot.
Pages 1
PunBB Forums → Posts by fristaille
Powered by PunBB, supported by Informer Technologies, Inc.