-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
47 lines (40 loc) · 986 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?
$DEFAULT_LANG = 'en';
$SITE_LANG = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
switch ($SITE_LANG) {
case 'ru':
$j = file_get_contents($_SERVER['DOCUMENT_ROOT'].'/front/lang/ru_RU.local' );
break;
case 'en':
$j = file_get_contents($_SERVER['DOCUMENT_ROOT'].'/front/lang/en_US.local' );
break;
default:
$j = file_get_contents($_SERVER['DOCUMENT_ROOT'].'/front/lang/en_US.local' );
break;
}
$local = json_decode($j);
function locale($name,$default,$branch = "default"){
global $local;
if ("default" == $branch){
if (isset($local->$name)){
return $local->$name;
} else {
return $default;
}
}else{
if (isset($local->$branch->$name)){
return $local->$branch->$name;
} else {
return $default;
}
}
}
include_once './api/Mobile_Detect.php';
$detect = new Mobile_Detect();
if ($detect->isMobile()){
include 'mobile.php';
}else
if ($detect->isMobile()){
include 'pc.php';
}else include 'pc.php';
?>