aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.htaccess22
-rw-r--r--404.php2
-rw-r--r--config.php6
-rw-r--r--index.php14
-rw-r--r--lib/PhpTemplate.php34
-rw-r--r--lib/helper.php28
-rw-r--r--player.php2
-rw-r--r--room.php18
-rw-r--r--template/page.phtml59
-rw-r--r--template/rooms.phtml8
10 files changed, 193 insertions, 0 deletions
diff --git a/.htaccess b/.htaccess
new file mode 100644
index 0000000..7b25039
--- /dev/null
+++ b/.htaccess
@@ -0,0 +1,22 @@
+RewriteEngine On
+
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteCond %{REQUEST_FILENAME} !-l
+
+
+# / -> index.php - room/streams list
+
+# /room/ -> room.php - list of qualities/formats
+RewriteRule ^(saal1|saal2|saalg|saalz)/?$ room.php?room=$1 [L]
+
+# /room/format/ -> player.php - native av-player for room
+RewriteRule ^(saal1|saal2|saalg|saalz)/(hd|hq|lq|audio|slides)/?$ player.php?room=$1&format=$2&language=native [L]
+
+# /room/format/translated -> player.php - translated av-player for room
+RewriteRule ^(saal1|saal2|saalg|saalz)/(hd|hq|lq|audio|slides)/translated/?$ player.php?room=$1&format=$2&language=translated [L]
+
+# /party/ -> player.php - simple audio-player for party
+RewriteRule ^(launge|sendezentrum)/?$ player.php?room=$1&format=audio&language=native [L]
+
+ErrorDocument 404 404.php
diff --git a/404.php b/404.php
new file mode 100644
index 0000000..9bc4efb
--- /dev/null
+++ b/404.php
@@ -0,0 +1,2 @@
+404
+<? print_r($_GET) ?>
diff --git a/config.php b/config.php
new file mode 100644
index 0000000..224ed57
--- /dev/null
+++ b/config.php
@@ -0,0 +1,6 @@
+<?php
+
+// guessed automatically
+// $GLOBALS['CONFIG']['baseurl'] = 'http://foo.com/bar/';
+
+?>
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..46585a8
--- /dev/null
+++ b/index.php
@@ -0,0 +1,14 @@
+<?php
+
+require_once('lib/PhpTemplate.php');
+require_once('lib/helper.php');
+require_once('config.php');
+
+$tpl = new PhpTemplate('template/page.phtml');
+echo $tpl->render(array(
+ 'page' => 'rooms',
+ 'baseurl' => baseurl(),
+ 'title' => 'Rooms',
+
+ 'rooms' => array('saal1','saal2','saalg','saalz','launge','sendezentrum'),
+));
diff --git a/lib/PhpTemplate.php b/lib/PhpTemplate.php
new file mode 100644
index 0000000..8dd6f72
--- /dev/null
+++ b/lib/PhpTemplate.php
@@ -0,0 +1,34 @@
+<?php
+
+// Version 1.2
+
+if(!function_exists('h'))
+{
+ function h($s)
+ {
+ return htmlspecialchars($s);
+ }
+}
+
+class PhpTemplate
+{
+ public function __construct($file)
+ {
+ $this -> file = $file;
+ }
+
+ public function render($___data = array())
+ {
+ extract((array)$___data);
+ unset($___data);
+
+ ob_start();
+ include($this->file);
+ return ob_get_clean();
+ }
+
+ public function __tostring()
+ {
+ return $this->render();
+ }
+}
diff --git a/lib/helper.php b/lib/helper.php
new file mode 100644
index 0000000..3e5e8a6
--- /dev/null
+++ b/lib/helper.php
@@ -0,0 +1,28 @@
+<?php
+
+function link_index()
+{
+ return '';
+}
+
+function link_room($room)
+{
+ return rawurlencode($room).'/';
+}
+
+function link_player($room, $format, $translated = false)
+{
+ return rawurlencode($room).'/'.rawurlencode($format).($translated ? '/translated' : '');
+}
+
+function baseurl()
+{
+ if(isset($GLOBALS['CONFIG']['baseurl']))
+ return $GLOBALS['CONFIG']['baseurl'];
+
+ $base = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']) ? 'https://' : 'http://';
+ $base .= $_SERVER['HTTP_HOST'];
+ $base .= dirname($_SERVER['SCRIPT_NAME']).'/';
+
+ return $base;
+}
diff --git a/player.php b/player.php
new file mode 100644
index 0000000..2c78eab
--- /dev/null
+++ b/player.php
@@ -0,0 +1,2 @@
+player
+<? print_r($_GET) ?>
diff --git a/room.php b/room.php
new file mode 100644
index 0000000..8f4db1f
--- /dev/null
+++ b/room.php
@@ -0,0 +1,18 @@
+<?php
+
+require_once('lib/PhpTemplate.php');
+require_once('lib/helper.php');
+require_once('config.php');
+
+$room = $_GET['room'];
+
+$tpl = new PhpTemplate('template/page.phtml');
+echo $tpl->render(array(
+ 'page' => 'rooms',
+ 'baseurl' => baseurl(),
+ 'title' => 'Stream-Formats',
+ 'subtitle' => ucfirst($room),
+
+ 'room' => $room,
+ 'formats' => array('hd','hq','lq','audio','slides'),
+));
diff --git a/template/page.phtml b/template/page.phtml
new file mode 100644
index 0000000..282b195
--- /dev/null
+++ b/template/page.phtml
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+
+<!--
+
+ 1010101010101010101010101010101
+ 0 0 ◺ ◺
+ 1 0 0 0\ 10 01
+ 0 · 1 101010101010101010101\ 10 0 ◺
+ 1 · · 0 10 10 10 10
+ 0 · · 1010101010101010101010101010 1 10 10 10 10
+ 1 · · 10\10 10 101 1010
+ 0 · · 1010101010101010101010101010 1010101010101010
+ 1 · · 0 10101010231010101010
+ 0 · 1 101010101010101010101010101010101 10 10
+ 1 0 0 1/ 101010 101 1 0
+ 0 0 10 01
+ 1010101010101010101010101010101 101010 10
+ 10101010101 10 1
+ 101 01
+ 101010101010 10
+ This website 1010101010 10
+ shall be bound to __ _____ ___ 101
+ serve cat content \ \ / / _ \ / __| 10101010101
+ \ V / (_) | (__ 101 101
+ c3\_/ \___/ \___|.de 10 101
+ 10 10 10 101
+ 10 10 10 10 10
+ 101 10 10 10101
+ 10 10 10
+ 10 10
+ 1010 10 10
+ 10101 10 10
+ 10
+ 10
+ 10
+ 10
+ streaming.media.ccc.de
+-->
+
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title><?=h($title)?> - 31C3 Streaming</title>
+
+ <base href="<?=h($baseurl)?>" />
+ <link type="text/css" rel="stylesheet" href="assets/css/lustiges-stylesheet.css" />
+
+ <script type="text/javascript" src="assets/js/jquery-1.8.3.min.js"></script>
+ <script type="text/javascript" src="assets/js/lustiger-player.js"></script>
+ </head>
+ <body>
+ <h1><?=h($title)?> - 31C3 Streaming</h1>
+ <? if(@$subtitle): ?>
+ <h2><?=h($subtitle)?></h2>
+ <? endif ?>
+
+ <? include("$page.phtml") ?>
+ </body>
+</html>
diff --git a/template/rooms.phtml b/template/rooms.phtml
new file mode 100644
index 0000000..e4e7227
--- /dev/null
+++ b/template/rooms.phtml
@@ -0,0 +1,8 @@
+<ul>
+ <? foreach($formats as $format): ?>
+ <li class="<?=h($format)?>">
+ <a href="<?=h(link_player($room, $format))?>"><?=h(ucfirst($format))?></a>
+ (<a href="<?=h(link_player($room, $format, true))?>">translated</a>)
+ </li>
+ <? endforeach ?>
+</ul>