aboutsummaryrefslogtreecommitdiff
path: root/view
diff options
context:
space:
mode:
authorMaZderMind2015-03-07 17:58:07 +0100
committerMaZderMind2015-03-14 13:46:47 +0100
commit844a7d53f2d78bafba479c0d931277246ade61de (patch)
tree7a9ab7e3ddcafa878f89deecc03c6de742fa2efa /view
parent8bb9b119a34717782e41124030917bd86d47f754 (diff)
Renames pages -> view
Diffstat (limited to 'view')
-rw-r--r--view/404.php7
-rw-r--r--view/about.php6
-rw-r--r--view/feedback.php41
-rw-r--r--view/overview.php6
-rw-r--r--view/party.php13
-rw-r--r--view/program-json.php4
-rw-r--r--view/relive-player.php16
-rw-r--r--view/relive.php7
-rw-r--r--view/room.php121
9 files changed, 221 insertions, 0 deletions
diff --git a/view/404.php b/view/404.php
new file mode 100644
index 0000000..1811239
--- /dev/null
+++ b/view/404.php
@@ -0,0 +1,7 @@
+<?php
+
+header("HTTP/1.1 404 Not Found");
+echo $tpl->render(array(
+ 'page' => '404',
+ 'title' => '404 Not Found',
+));
diff --git a/view/about.php b/view/about.php
new file mode 100644
index 0000000..cc81064
--- /dev/null
+++ b/view/about.php
@@ -0,0 +1,6 @@
+<?php
+
+echo $tpl->render(array(
+ 'page' => 'about',
+ 'title' => 'About the Streams',
+));
diff --git a/view/feedback.php b/view/feedback.php
new file mode 100644
index 0000000..7417f24
--- /dev/null
+++ b/view/feedback.php
@@ -0,0 +1,41 @@
+<?php
+
+if(
+ !isset($_POST['datetime']) ||
+ !isset($_POST['net']) ||
+ !isset($_POST['os']) ||
+ !isset($_POST['player']) ||
+ !isset($_POST['stream']) ||
+ !isset($_POST['provider']) ||
+ !isset($_POST['issuetext'])
+) {
+ echo $tpl->render(array(
+ 'page' => 'feedback',
+ 'title' => 'Give Feedback',
+ 'room' => null,
+ ));
+}
+else
+{
+ $db = new PDO(get('FEEDBACK.DSN'));
+ $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+
+ $stm = $db->prepare('
+ INSERT INTO feedback (reported, datetime, net, os, player, stream, ipproto_v4, ipproto_v6, provider, issues, issuetext)
+ VALUES (:reported, :datetime, :net, :os, :player, :stream, :ipproto_v4, :ipproto_v6, :provider, :issues, :issuetext)
+ ');
+
+ $stm->execute(array(
+ 'reported' => time(),
+ 'datetime' => strtotime($_POST['datetime']),
+ 'net' => $_POST['net'],
+ 'os' => $_POST['os'],
+ 'player' => $_POST['player'],
+ 'stream' => $_POST['stream'],
+ 'ipproto_v4' => isset($_POST['ipproto']) && is_array($_POST['ipproto']) && in_array('v4', $_POST['ipproto']),
+ 'ipproto_v6' => isset($_POST['ipproto']) && is_array($_POST['ipproto']) && in_array('v6', $_POST['ipproto']),
+ 'provider' => $_POST['provider'],
+ 'issues' => isset($_POST['issues']) && is_array($_POST['issues']) ? implode(',', $_POST['issues']) : '',
+ 'issuetext' => $_POST['issuetext'],
+ ));
+}
diff --git a/view/overview.php b/view/overview.php
new file mode 100644
index 0000000..6305940
--- /dev/null
+++ b/view/overview.php
@@ -0,0 +1,6 @@
+<?php
+
+echo $tpl->render(array(
+ 'page' => 'overview',
+ 'title' => 'Live-Streams',
+));
diff --git a/view/party.php b/view/party.php
new file mode 100644
index 0000000..322cea6
--- /dev/null
+++ b/view/party.php
@@ -0,0 +1,13 @@
+<?php
+
+$room = $_GET['room'];
+echo $tpl->render(array(
+ 'page' => 'party',
+
+ 'title' => $GLOBALS['CONFIG']['ROOMS'][$room],
+
+ 'rooms' => $GLOBALS['CONFIG']['ROOMS'],
+
+ 'room' => $room,
+ 'roomname' => $GLOBALS['CONFIG']['ROOMS'][$room],
+));
diff --git a/view/program-json.php b/view/program-json.php
new file mode 100644
index 0000000..4cce716
--- /dev/null
+++ b/view/program-json.php
@@ -0,0 +1,4 @@
+<?php
+
+header('Content-Type: application/json');
+echo json_encode(program());
diff --git a/view/relive-player.php b/view/relive-player.php
new file mode 100644
index 0000000..1517b92
--- /dev/null
+++ b/view/relive-player.php
@@ -0,0 +1,16 @@
+<?php
+
+$talks_by_id = relive_talks();
+$talk = @$talks_by_id[intval($_GET['id'])];
+
+if(!$talk)
+ return include('page/404.php');
+
+echo $tpl->render(array(
+ 'page' => 'relive-player',
+ 'title' => 'Relive!',
+ 'talk' => $talk,
+
+ 'width' => 1024,
+ 'height' => 576,
+));
diff --git a/view/relive.php b/view/relive.php
new file mode 100644
index 0000000..0608423
--- /dev/null
+++ b/view/relive.php
@@ -0,0 +1,7 @@
+<?php
+
+echo $tpl->render(array(
+ 'page' => 'relive',
+ 'title' => 'Relive!',
+ 'talks' => relive_talks(),
+));
diff --git a/view/room.php b/view/room.php
new file mode 100644
index 0000000..4484a14
--- /dev/null
+++ b/view/room.php
@@ -0,0 +1,121 @@
+<?php
+
+$room = $_GET['room'];
+$language = $_GET['language'];
+$selection = $_GET['selection'];
+
+if(!has("ROOMS.$room"))
+ return include('pages/404.php');
+
+$formats = get("ROOMS.$room.FORMATS");
+$has_translation = get("ROOMS.$room.TRANSLATION");
+
+$protos = array();
+$selections = array();
+$tabs = array();
+$videores = array();
+
+if(room_has_hd($room))
+ $selections[] = $videores[] = 'hd';
+
+if(room_has_sd($room))
+ $selections[] = $videores[] = 'sd';
+
+if(room_has_video($room))
+ $tabs[] = 'video';
+
+
+if(room_has_audio($room))
+ $selections[] = $tabs[] = 'audio';
+
+if(room_has_music($room))
+ $selections[] = $tabs[] = 'music';
+
+if(room_has_slides($room))
+ $selections[] = $tabs[] = 'slides';
+
+
+if(room_has_rtmp($room))
+ $protos[] = 'rtmp';
+
+if(room_has_webm($room))
+ $protos[] = 'webm';
+
+if(room_has_hls($room))
+ $protos[] = 'hls';
+
+
+
+// default page
+if(!$selection)
+ $selection = $selections[0];
+
+if(!in_array($selection, $selections))
+ return include('pages/404.php');
+
+
+
+switch($selection) {
+ case 'audio':
+ $tab = 'audio';
+ $title = 'Audio';
+ break;
+
+ case 'music':
+ $tab = 'music';
+ $title = 'Music';
+ break;
+
+ case 'slides':
+ $tab = 'slides';
+ $title = 'Slides';
+ $width = 1024;
+ $height = 576;
+ break;
+
+ case 'hd':
+ $tab = 'video';
+ $title = 'FullHD Video';
+ $width = 1920;
+ $height = 1080;
+ break;
+
+ case 'sd':
+ $tab = 'video';
+ $title = 'SD Video';
+ $width = 1024;
+ $height = 576;
+ break;
+}
+
+if($language == 'translated')
+{
+ if(!$has_translation)
+ return include('pages/404.php');
+
+ $title = 'Translated '.$title;
+}
+
+echo $tpl->render(array(
+ 'page' => 'room',
+
+ 'title' => get("ROOMS.$room.DISPLAY").' – '.$title,
+ 'room' => $room,
+
+ 'program' => program(),
+
+ 'tab' => $tab,
+ 'tabs' => $tabs,
+
+ 'width' => @$width,
+ 'height' => @$height,
+ 'language' => $language,
+ 'translated' => ($language == 'translated'),
+ 'selection' => $selection,
+ 'hlsformat' => ($selection == 'hd' ? 'auto' : $selection),
+
+ 'has_translation' => $has_translation,
+ 'formats' => $formats,
+ 'protos' => $protos,
+ 'videores' => $videores,
+));