From 4cd3cd3e4760de395538c0f40de8e28b318b242b Mon Sep 17 00:00:00 2001 From: Evgeny Gryaznov Date: Mon, 26 Apr 2010 20:58:55 +0000 Subject: [PATCH] proper links git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@776 c66351dc-e62f-0410-b875-e3a5c0b9693f --- site/inc/demo.i | 4 ++-- site/inc/main.i | 10 +++++----- site/inc/menu.i | 8 ++++---- site/libs/common.php | 7 ++++++- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/site/inc/demo.i b/site/inc/demo.i index afd09d26..cc405fd3 100644 --- a/site/inc/demo.i +++ b/site/inc/demo.i @@ -1,7 +1,7 @@
  • diff --git a/site/inc/main.i b/site/inc/main.i index 6f98f81f..6d1c9bed 100644 --- a/site/inc/main.i +++ b/site/inc/main.i @@ -1,10 +1,10 @@
  • diff --git a/site/inc/menu.i b/site/inc/menu.i index 24551861..458bd2fd 100644 --- a/site/inc/menu.i +++ b/site/inc/menu.i @@ -11,10 +11,10 @@ diff --git a/site/libs/common.php b/site/libs/common.php index 858c8078..2e3e9738 100644 --- a/site/libs/common.php +++ b/site/libs/common.php @@ -5,6 +5,11 @@ $default_locale = "en"; $siteroot = ""; $site_encoding = "utf-8"; +$requestUri = $_SERVER["REQUEST_URI"]; +if(preg_match("/^\/(en|sp|ru|ua|fr|nl)\//", $requestUri)) { + $siteroot = substr($requestUri, 0, 3); +} + if(preg_match("/www\.mibew\.org/", $_SERVER['HTTP_HOST'])) { header("Location: http://mibew.org"); exit; @@ -43,7 +48,7 @@ function verifyparam( $name, $regexp, $default = null ) { } function get_locale() { - global $available_locales, $siteroot; + global $available_locales; $locale = verifyparam("intlocale", "/^[\w-]{2,5}$/", ""); if( !$locale || !in_array($locale,$available_locales) )