ajout de libreexpo.org et de la gestion de la traduction

This commit is contained in:
François Poulain 2016-11-11 22:10:53 +01:00 committed by root
parent 703705670c
commit c856071e06
2 changed files with 6 additions and 3 deletions

View File

@ -3,7 +3,7 @@
register_lang ('fr',
array (
'name' => 'Français',
'loc' => '/',
'loc' => '//expolibre.org/',
'pages' => [
/* Conserver l'ordre !! */
'a-propos-april-et-expolibre.php',
@ -28,7 +28,7 @@ register_lang ('fr',
register_lang ('en',
array (
'name' => 'English',
'loc' => '/en/',
'loc' => '//libreexpo.org/en/',
/* Conserver l'ordre !! */
'pages' => [
'about-april-and-libreexpo.php',

View File

@ -51,7 +51,10 @@ function url_translate ($url, $to) {
/*
* Redirect to prefered language, if needed, when referer is none or ourself
*/
if (!isset ($_SERVER['HTTP_REFERER']) or strrpos ($_SERVER['HTTP_REFERER'], $_SERVER['SERVER_NAME']) === false) {
$server_names= array('expolibre.org', 'www.expolibre.org', 'libreexpo.org', 'www.libreexpo.org');
if (!isset ($_SERVER['HTTP_REFERER']) or (
strrpos ($_SERVER['HTTP_REFERER'], 'expolibre.org') === false and
strrpos ($_SERVER['HTTP_REFERER'], 'libreexpo.org') === false)) {
if ($current_dir == "htdocs")
$current_dir= $registered_languages['fr']['loc'];
$prefered_dir= $registered_languages[prefered_language ()]['loc'];