-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
86 lines (66 loc) · 1.82 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
<?php
require_once ('engine/content.php');
require_once ('engine/menu.php');
require_once ('engine/devdect.php');
// Change me when css/js is changed
define ('CLIENT_VERSION', 26);
$route = explode('/', $_GET['route']);
if (empty(trim($route[0])))
{
$route[0] = 'news';
}
if ($route[0] == 'e')
{
$redirectAddress = '';
switch ($route[1])
{
case 'android':
$redirectAddress = 'https://provoda.ch/404';
break;
case 'ios':
$redirectAddress = 'https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=1080566427';
break;
case 'telegram':
$redirectAddress = 'https://t.me/provodach';
break;
case 'tunein':
$redirectAddress = 'http://tunein.com/radio/Provodach-s255847/';
break;
case 'app' :
$device = get_device();
if (!$device)
$redirectAddress = 'http://tunein.com/radio/Provodach-s255847/';
elseif ($device == 'ios')
$redirectAddress = 'https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=1080566427';
else
$redirectAddress = 'https://provoda.ch/404';
break;
default:
$redirectAddress = 'https://provoda.ch';
break;
}
header ('HTTP/1.1 302 Redirect');
header ('Location: '.$redirectAddress);
die();
}
$content_template = get_template ($route[0]);
$page_title = get_title($route[0]);
if (!empty($menu[$route[0]]))
$menu[$route[0]]['active'] = true;
if (isset($_GET['ajax']))
{
include_once ('engine/content/'.$content_template);
include_once ('engine/title_set.tpl');
die();
}
else
{
$content['background_mode'] = $site_mode;
$content['title'] = $page_title.' – Радио «Проводач»';
$content['current_page'] = $route[0];
$content['menu'] = $menu; // see engine/menu.php
include_once ('engine/header.tpl');
include_once ('engine/content/'.$content_template);
include_once ('engine/footer.tpl');
die();
}