-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcommon.php
57 lines (46 loc) · 822 Bytes
/
common.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
48
49
50
51
52
53
54
55
56
57
<?php
session_start();
header('Cache-control: private'); // IE 6 FIX
if(isSet($_GET['lang']))
{
$lang = $_GET['lang'];
// register the session and set the cookie
$_SESSION['lang'] = $lang;
setcookie("lang", $lang, time() + (3600 * 24 * 30));
}
else if(isSet($_SESSION['lang']))
{
$lang = $_SESSION['lang'];
}
else if(isSet($_COOKIE['lang']))
{
$lang = $_COOKIE['lang'];
}
else
{
$lang = 'en';
}
switch ($lang) {
case 'en':
$lang_file = 'lang.en.php';
break;
case 'de':
$lang_file = 'lang.de.php';
break;
case 'ru':
$lang_file = 'lang.ru.php';
break;
case 'sk':
$lang_file = 'lang.sk.php';
break;
case 'cz':
$lang_file = 'lang.cz.php';
break;
case 'it':
$lang_file = 'lang.it.php';
break;
default:
$lang_file = 'lang.sk.php';
}
include_once 'languages/'.$lang_file;
?>