This repository has been archived by the owner on Apr 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 310
/
common.php
129 lines (99 loc) · 2.17 KB
/
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?php
//ini_set('display_startup_errors',1);
//ini_set('display_errors',1);
ini_set('session.cookie_httponly', 1);
ini_set('session.cookie_secure', 1);
//error_reporting(-1);
session_start();
header('Cache-control: private'); // IE 6 FIX
header("X-XSS-Protection: 1; mode=block");
header("X-Content-Type-Options: nosniff");
define("WITHDRAWALS_ENABLED", true); //Disable withdrawals during maintenance
include('jsonRPCClient.php');
include('classes/Client.php');
include('classes/User.php');
// function by zelles to modify the number to bitcoin format ex. 0.00120000
function satoshitize($satoshitize) {
return sprintf("%.8f", $satoshitize);
}
// function by zelles to trim trailing zeroes and decimal if need
function satoshitrim($satoshitrim) {
return rtrim(rtrim($satoshitrim, "0"), ".");
}
require('settings.php');
if(isSet($_GET['lang']))
{
$lang = $_GET['lang'];
// register the session and set the cookie
$_SESSION['lang'] = $lang;
setcookie('lang', $lang, time() + (3600 * 24 * 30), NULL, NULL, TRUE, TRUE);
}
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 'grc':
$lang_file = 'lang.grc.php';
break;
case 'zho':
$lang_file = 'lang.zho.php';
break;
case 'ita':
$lang_file = 'lang.ita.php';
break;
case 'por':
$lang_file = 'lang.por.php';
break;
case 'hin':
$lang_file = 'lang.hin.php';
break;
case 'spa':
$lang_file = 'lang.spa.php';
break;
case 'tgl':
$lang_file = 'lang.tgl.php';
break;
case 'rus':
$lang_file = 'lang.rus.php';
break;
case 'nld':
$lang_file = 'lang.nld.php';
break;
case 'fra':
$lang_file = 'lang.fra.php';
break;
case 'deu':
$lang_file = 'lang.deu.php';
break;
case 'tur':
$lang_file = 'lang.tur.php';
break;
case 'vie':
$lang_file = 'lang.vie.php';
break;
case 'jpn':
$lang_file = 'lang.jpn.php';
break;
case 'kor':
$lang_file = 'lang.kor.php';
break;
case 'ara':
$lang_file = 'lang.ara.php';
break;
default:
$lang_file = 'lang.en.php';
}
include_once 'languages/'.$lang_file;
?>