forked from TUM-Dev/RBGreaterAgain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
175 lines (157 loc) · 6.18 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<?php
include_once 'language.php';
include_once 'api/get_rbg_streams.php';
function td($el) {
return "<td>$el</td>";
}
function tr($el) {
return "<tr>$el</tr>";
}
function constructLink($type, $link) {
$link = base64_encode($link);
if ($type == "comb") {
return '<a href="./watch.php?s=' . $link . '"><span class="material-icons md-dashboard"></span></a>';
} else if ($type == "pres") {
return '<a href="./watch.php?s=' . $link . '"><span class="material-icons md-present_to_all"></span></a>';
} else if ($type == "cam") {
return '<a href="./watch.php?s=' . $link . '"><span class="material-icons md-videocam"></span></a>';
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RBGreater</title>
<script src="node_modules/jquery/dist/jquery.min.js"></script>
<script src="js/content_handler.js"></script>
<!-- Library stylesheets -->
<link rel="stylesheet" href="node_modules/typeface-roboto/index.css">
<link rel="stylesheet" href="node_modules/@material-icons/font/css/all.css">
<!-- Custom stylesheets -->
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="css/index.css">
</head>
<body>
<div id="main">
<h1 id="page-title"><i>RBGreater</i></h1>
<div>
<h2 class="header"><?php echo $DICT["current_livestreams"]; ?></h2>
<div id="livestreams">
<?php
if (sizeof($STREAMS["livestreams"]) == 0) {
?>
<div class='no-entry'>
<p><i>No upcoming livestreams!</i></p>
</div>
<?php
} else { ?>
<table class='event-table'>
<tr>
<th>Title</th>
<th>Combined</th>
<th>Presentation</th>
<th>Camera</th>
</tr>
<?php
foreach ($STREAMS["livestreams"] as $item) {
echo tr(
td($item["info"]["name"])
. td(constructLink("comb", $item["links"]["comb"]))
. td(constructLink("pres", $item["links"]["pres"]))
. td(constructLink("cam", $item["links"]["cam"]))
);
}
?>
</table>
<?php }
?>
</div>
</div>
<div>
<h2 class="header"><?php echo $DICT["vod"]; ?></h2>
<div id="vod">
<?php
if (sizeof($STREAMS["vod"]) == 0) {
?>
<div class='no-entry'>
<p><i>No video on demand entries!</i></p>
</div>
<?php
} else { ?>
<div class='event-list'>
<?php
$index = 0;
foreach ($STREAMS["vod"] as $item) {
?>
<div class='spoiler'>
<div class="spoiler-header" onclick="openVod(<?php echo $index; ?>)">
<p class='spoiler-title'><?php echo $item["info"]["name"]; ?></p>
<a class='spoiler-button'>
<span class='material-icons md-expand_more rotate-reset' id="spoiler-button-<?php echo $index; ?>"></span>
</a>
</div>
<div class='spoiler-content' id='spoiler-content-<?php echo $index; ?>'>
<table class="event-table">
<tr>
<th>Date</th>
<th>Combined</th>
<th>Presentation</th>
<th>Camera</th>
</tr>
<?php
foreach ($item["videos"] as $video) {
echo tr(
td($video["info"]["name"])
. td(isset($video["links"]["comb"]) ? constructLink("comb", $video["links"]["comb"]) : "")
. td(isset($video["links"]["pres"]) ? constructLink("comb", $video["links"]["pres"]) : "")
. td(isset($video["links"]["cam"]) ? constructLink("cam", $video["links"]["cam"]) : "")
);
}
?>
</table>
</div>
</div>
<?php
$index++;
}
}
?>
</div>
</div>
<div>
<h2 class="header"><?php echo $DICT["vod_archive"]; ?></h2>
<div id="vod_archive">
<?php
if (sizeof($STREAMS["vod"]) == 0) {
?>
<div class='no-entry'>
<p><i>No video on demand entries!</i></p>
</div>
<?php
} else { ?>
<div class='event-list'>
<?php
$index = 0;
foreach ($STREAMS["vod_archive"] as $item) {
?>
<div class='spoiler'>
<a target="_blank" href="<?php echo $item["info"]["link"]; ?>">
<div class="spoiler-header">
<p class='spoiler-title'><?php echo $item["info"]["name"]; ?></p>
<span class='material-icons md-open_in_new rotate-reset spoiler-button'></span>
</div>
</a>
</div>
<?php
$index++;
}
}
?>
</div>
</div>
</div>
</div>
</body>
</html>