-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.php
executable file
·135 lines (122 loc) · 2.33 KB
/
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
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
130
131
132
133
134
135
<?php
$path = explode('/', $_GET['path']);
$sttm = 'https://www.sikhitothemax.org';
function go($url)
{
header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
header('HTTP/1.1 301 Moved Permanently');
header('Location: ' . $url);
exit;
}
function goDownload()
{
go('https://khalisfoundation.org/portfolio/sikhitothemax-everywhere/');
}
function goDownloadBetaMac()
{
go('https://s3-us-west-2.amazonaws.com/sttm-releases/mac-x64/SikhiToTheMax+Beta-5.0.0-beta.0.dmg');
}
function goDownloadBetaWin()
{
go('https://s3-us-west-2.amazonaws.com/sttm-releases/win-x64/SikhiToTheMaxSetup-5.0.0-beta.5.exe');
}
function goFeedback()
{
go('https://form.jotform.com/80266126732151');
}
function goAngG($n)
{
global $sttm;
is_numeric($n) ? go("$sttm/ang?ang=$n&source=G") : go($sttm);
}
function goAngD($n)
{
global $sttm;
is_numeric($n) ? go("$sttm/ang?ang=$n&source=D") : go($sttm);
}
function goAngV($n)
{
global $sttm;
is_numeric($n) ? go("$sttm/ang?ang=$n&source=V") : go($sttm);
}
function goAngGS($n)
{
global $sttm;
is_numeric($n) ? go("$sttm/ang?ang=$n&source=S") : go($sttm);
}
function goSearch($q)
{
global $sttm;
go("$sttm/search?q=$q");
}
function goShabad($n, $h)
{
global $sttm;
if (is_numeric($n)) {
if (is_numeric($h)) {
go("$sttm/shabad?id=$n&highlight=$h");
} else {
go("$sttm/shabad?id=$n");
}
} else {
$multiShabads = strpos($n, ',');
$multiHighlight = strpos($h, ',');
if ($multiShabads && $multiHighlight) {
go("$sttm/shabad?id=$n&highlight=$h");
return;
}
go($sttm);
}
}
switch ($path[0]) {
case 'a':
case 'g':
goAngG($path[1]);
break;
case 'd':
goAngD($path[1]);
break;
case 'b':
case 'v':
goAngV($path[1]);
break;
case 'gs':
goAngGS($path[1]);
break;
case 'dl':
case 'download':
goDownload();
break;
case 'beta-mac':
goDownloadBetaMac();
break;
case 'beta-win':
goDownloadBetaWin();
break;
case 'feedback':
goFeedback();
break;
case 'h':
go("$sttm/hukamnama");
break;
case 'q':
goSearch($path[1]);
break;
case 'r':
go("$sttm/random");
break;
case 's':
goShabad($path[1], $path[2]);
break;
case 'sg':
case 'sunder-gutka':
go("$sttm/sundar-gutka");
break;
case 'i':
go("$sttm/index");
break;
default:
go($sttm . $_SERVER['REQUEST_URI']);
break;
}