forked from KhalisFoundation/sttm-shortener
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
64 lines (56 loc) · 1.13 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
<?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 goAng ($n) {
global $sttm;
is_numeric($n)? go("$sttm/ang?ang=$n&source=G") : 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 {
go($sttm);
}
}
switch($path[0]) {
case 'a':
goAng($path[1]);
break;
case 'd': case 'download':
goDownload();
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;
default:
go($sttm.$_SERVER['REQUEST_URI']);
break;
}