aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaZderMind2015-11-08 15:15:53 +0100
committerMaZderMind2015-11-08 15:15:53 +0100
commita0b2129479ba10561811847c0651df8b55c8a6ba (patch)
tree2177365d737a24453783107697d19e712330f66d
parentefe1f83a7cc419df700dfe36ef11da20607d8eae (diff)
Support an All-Conference-Closed Screen and mutliple Schedules & Relive-URLs
-rw-r--r--assets/css/_closed.less1
-rw-r--r--assets/js/lustiges-script.js2
-rw-r--r--configs/conferences/31c3/config.php6
-rwxr-xr-xconfigs/conferences/31c3/download.sh7
-rwxr-xr-xconfigs/download.sh14
-rw-r--r--index.php22
-rw-r--r--model/Conferences.php2
-rw-r--r--model/GenericConference.php67
-rw-r--r--template/allclosed.phtml14
-rw-r--r--template/assemblies/header.phtml2
-rw-r--r--template/assemblies/upcoming.phtml21
-rw-r--r--template/closed.phtml22
-rw-r--r--template/embed.phtml2
-rw-r--r--template/page.phtml28
-rw-r--r--view/allclosed.php12
15 files changed, 175 insertions, 47 deletions
diff --git a/assets/css/_closed.less b/assets/css/_closed.less
index 8aeeb78..ff55b75 100644
--- a/assets/css/_closed.less
+++ b/assets/css/_closed.less
@@ -1,4 +1,5 @@
body.closed,
+body.allclosed,
body.not-started {
p {
margin-top: 50px;
diff --git a/assets/js/lustiges-script.js b/assets/js/lustiges-script.js
index 15f0358..38dc3ae 100644
--- a/assets/js/lustiges-script.js
+++ b/assets/js/lustiges-script.js
@@ -558,7 +558,7 @@ $(function() {
// closed-countdown
$(function() {
var
- $el = $('.closed .countdown'),
+ $el = $('.countdown'),
dt = moment($el.data('dt'));
$el.attr('title', 'on '+dt.format('dddd, MMM Do YYYY'))
diff --git a/configs/conferences/31c3/config.php b/configs/conferences/31c3/config.php
index a0f6383..1ad5709 100644
--- a/configs/conferences/31c3/config.php
+++ b/configs/conferences/31c3/config.php
@@ -106,7 +106,7 @@ $GLOBALS['CONFIG']['CONFERENCE'] = array(
*
* Wird diese Zeile auskommentiert, wird der Link nicht angezeigt
*/
- 'RELIVE_JSON' => 'configs/vod.json',
+ 'RELIVE_JSON' => 'configs/conferences/31c3/vod.json',
);
/**
@@ -486,12 +486,12 @@ $GLOBALS['CONFIG']['SCHEDULE'] = array(
/**
* URL zum Fahrplan-XML
*
- * Diese URL muss immer verfügbar sein, sonst können kann die Programm-Ansicht
+ * Diese URL muss immer verfügbar sein, sonst könnte die Programm-Ansicht
* aufhören zu funktionieren. Üblicherweise wird diese daher Datei über
* das Script configs/download.sh heruntergeladen, welches von einem
* Cronjob regelmäßig getriggert wird.
*/
- 'URL' => 'configs/schedule.xml',
+ 'URL' => 'configs/conferences/31c3/schedule.xml',
/**
* Nur die angegebenen Räume aus dem Fahrplan beachten
diff --git a/configs/conferences/31c3/download.sh b/configs/conferences/31c3/download.sh
new file mode 100755
index 0000000..81d5ad7
--- /dev/null
+++ b/configs/conferences/31c3/download.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# fahrplan
+wget --no-check-certificate -q "http://events.ccc.de/congress/2014/Fahrplan/schedule.xml" -O /tmp/schedule.xml && mv /tmp/schedule.xml schedule.xml
+
+# vod json
+wget -q "http://cdn.c3voc.de/releases/relive/index.json" -O /tmp/vod.json && mv /tmp/vod.json vod.json
diff --git a/configs/download.sh b/configs/download.sh
index 8808ff0..c2a2b3e 100755
--- a/configs/download.sh
+++ b/configs/download.sh
@@ -1,10 +1,14 @@
#!/bin/sh
-# fahrplan
-wget --no-check-certificate -q "http://events.ccc.de/congress/2014/Fahrplan/schedule.xml" -O /tmp/schedule.xml && mv /tmp/schedule.xml schedule.xml
-
-# vod json
-wget -q "http://cdn.c3voc.de/releases/relive/index.json" -O /tmp/vod.json && mv /tmp/vod.json vod.json
+# conferences
+wd=`pwd`
+for d in conferences/*; do
+ if [ -x $d/download.sh ]; then
+ cd $d
+ ./download.sh
+ cd $wd
+ fi
+done
# eventkalender upcoming
wget -q --no-check-certificate "https://c3voc.de/eventkalender/events.json?filter=upcoming&streaming=yes" -O /tmp/upcoming.json && mv /tmp/upcoming.json upcoming.json
diff --git a/index.php b/index.php
index f12d914..cdd58a7 100644
--- a/index.php
+++ b/index.php
@@ -12,6 +12,7 @@ require_once('lib/less.php/Less.php');
require_once('model/ModelBase.php');
require_once('model/Conferences.php');
require_once('model/Conference.php');
+require_once('model/GenericConference.php');
require_once('model/Feedback.php');
require_once('model/Schedule.php');
require_once('model/Overview.php');
@@ -26,17 +27,35 @@ require_once('model/Upcoming.php');
$route = @$_GET['route'];
$route = rtrim($route, '/');
+// GLOBAL CSS (for conferences overview)
+if($route == 'gen/main.css')
+{
+ handle_lesscss_request('assets/css/main.less', '../assets/css/');
+ exit;
+}
+
@list($mandator, $route) = explode('/', $route, 2);
if(!$mandator)
{
// root requested
+ $tpl = new PhpTemplate('template/page.phtml');
+ $tpl->set(array(
+ 'baseurl' => forceslash(baseurl()),
+ 'route' => $route,
+ 'canonicalurl' => forceslash(baseurl()).forceslash($route),
+ 'assemblies' => './template/assemblies/',
+ 'assets' => 'assets/',
+
+ 'conference' => new GenericConference(),
+ ));
+
if(Conferences::getActiveConferencesCount() == 0)
{
// no clients
// error
- var_dump('no clients');
+ require('view/allclosed.php');
exit;
}
else if(Conferences::getActiveConferencesCount() == 1)
@@ -79,6 +98,7 @@ $tpl->set(array(
'route' => $route,
'canonicalurl' => forceslash(baseurl()).forceslash($route),
'assemblies' => './template/assemblies/',
+ 'assets' => '../assets/',
'conference' => $conference,
'feedback' => new Feedback(),
diff --git a/model/Conferences.php b/model/Conferences.php
index 05d3c52..9f87388 100644
--- a/model/Conferences.php
+++ b/model/Conferences.php
@@ -54,6 +54,6 @@ class Conferences extends ModelBase
public static function load($mandator) {
$GLOBALS['MANDATOR'] = $mandator;
- include(forceslash(Conferences::MANDATOR_DIR).forceslash($mandator).'config.php');
+ require(forceslash(Conferences::MANDATOR_DIR).forceslash($mandator).'config.php');
}
}
diff --git a/model/GenericConference.php b/model/GenericConference.php
new file mode 100644
index 0000000..949766f
--- /dev/null
+++ b/model/GenericConference.php
@@ -0,0 +1,67 @@
+<?php
+
+class GenericConference extends Conference
+{
+ public function getTitle() {
+ return 'C3Voc Streaming';
+ }
+
+ public function hasBegun() {
+ return true;
+ }
+
+ public function hasEnded() {
+ return true;
+ }
+
+ public function hasAuthor() {
+ return true;
+ }
+ public function getAuthor() {
+ return 'C3Voc';
+ }
+
+ public function hasDescription() {
+ return true;
+ }
+ public function getDescription() {
+ return 'Video Live-Streaming of the CCC';
+ }
+
+ public function hasKeywords() {
+ return true;
+ }
+ public function getKeywords() {
+ return 'Video, Media, Streaming, VOC, C3Voc, CCC';
+ }
+
+
+
+ public function hasReleases() {
+ return true;
+ }
+ public function getReleasesUrl() {
+ return '//media.ccc.de/';
+ }
+
+ public function hasRelive() {
+ return false;
+ }
+ public function getReliveUrl() {
+ return null;
+ }
+
+ public function hasBannerHtml() {
+ return false;
+ }
+ public function getBannerHtml() {
+ return null;
+ }
+
+ public function hasFooterHtml() {
+ return false;
+ }
+ public function getFooterHtml() {
+ return null;
+ }
+}
diff --git a/template/allclosed.phtml b/template/allclosed.phtml
new file mode 100644
index 0000000..31947a7
--- /dev/null
+++ b/template/allclosed.phtml
@@ -0,0 +1,14 @@
+<div class="container about">
+ <? if($next): ?>
+ <h2>See you soon at <?=h($next['name'])?></h2>
+ <span class="countdown" data-dt="<?=h($next['start_date'])?>"></span>
+ <? endif ?>
+
+ <p>
+ You can watch most of our Recordings at <a href="<?=h($conference->getReleasesUrl())?>"><?=h($conference->getReleasesUrl())?></a>.
+ </p>
+
+ <br><br><br>
+
+ <? include("$assemblies/upcoming.phtml") ?>
+</div>
diff --git a/template/assemblies/header.phtml b/template/assemblies/header.phtml
index f57054c..a213dd3 100644
--- a/template/assemblies/header.phtml
+++ b/template/assemblies/header.phtml
@@ -15,7 +15,7 @@
</a>
<? endif ?>
- <? if(!$conference->hasEnded() && $feedback->isEnabled()): ?>
+ <? if(!$conference->hasEnded() && isset($feedback) && $feedback->isEnabled()): ?>
<a class="form-control btn btn-default" href="<?=h($feedback->getUrl())?>">
<span class="fa fa-bullhorn"></span>
</a>
diff --git a/template/assemblies/upcoming.phtml b/template/assemblies/upcoming.phtml
new file mode 100644
index 0000000..7d9ffac
--- /dev/null
+++ b/template/assemblies/upcoming.phtml
@@ -0,0 +1,21 @@
+<? foreach($events as $event): ?>
+ <div class="col-xs-10 col-xs-offset-1 col-md-6 col-md-offset-3">
+
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <? if($event['description']): ?>
+ <a href="<?=h($event['description'])?>">
+ <?=h($event['name'])?>
+ </a>
+ <? else: ?>
+ <?=h($event['name'])?>
+ <? endif ?>
+ </div>
+ <div class="panel-body">
+ <?=h($event['location'])?><br />
+ <?=h($event['start_date'])?> – <?=h($event['end_date'])?>
+ </div>
+ </div>
+
+ </div>
+<? endforeach ?>
diff --git a/template/closed.phtml b/template/closed.phtml
index 6ca7416..0b56e74 100644
--- a/template/closed.phtml
+++ b/template/closed.phtml
@@ -29,25 +29,5 @@
<br><br><br>
- <? foreach($events as $event): ?>
- <div class="col-xs-10 col-xs-offset-1 col-md-6 col-md-offset-3">
-
- <div class="panel panel-default">
- <div class="panel-heading">
- <? if($event['description']): ?>
- <a href="<?=h($event['description'])?>">
- <?=h($event['name'])?>
- </a>
- <? else: ?>
- <?=h($event['name'])?>
- <? endif ?>
- </div>
- <div class="panel-body">
- <?=h($event['location'])?><br />
- <?=h($event['start_date'])?> – <?=h($event['end_date'])?>
- </div>
- </div>
-
- </div>
- <? endforeach ?>
+ <? include("$assemblies/upcoming.phtml") ?>
</div>
diff --git a/template/embed.phtml b/template/embed.phtml
index dd8629a..f99ece1 100644
--- a/template/embed.phtml
+++ b/template/embed.phtml
@@ -1 +1 @@
-<? require('assemblies/player/'.$stream->getPlayerType().'.phtml') ?>
+<? require("$assemblies/player/".$stream->getPlayerType().'.phtml') ?>
diff --git a/template/page.phtml b/template/page.phtml
index 37f192a..ac639a2 100644
--- a/template/page.phtml
+++ b/template/page.phtml
@@ -29,20 +29,20 @@
<base href="<?=h($baseurl)?>" />
<link href="<?=h($canonicalurl)?>" rel="canonical" />
- <link href="../assets/img/apple-touch-icon.png" rel="apple-touch-icon" />
- <link href="../assets/img/favicon.png" rel="icon" type="image/png" />
+ <link href="<?=h($assets)?>img/apple-touch-icon.png" rel="apple-touch-icon" />
+ <link href="<?=h($assets)?>img/favicon.png" rel="icon" type="image/png" />
- <link type="text/css" rel="stylesheet" href="../assets/mejs/mediaelementplayer.min.css" />
+ <link type="text/css" rel="stylesheet" href="<?=h($assets)?>mejs/mediaelementplayer.min.css" />
<link type="text/css" rel="stylesheet" href="gen/main.css" />
- <script type="text/javascript" src="../assets/js/lib/jquery.min.js"></script>
- <script type="text/javascript" src="../assets/js/lib/jquery.scrollTo.min.js"></script>
- <script type="text/javascript" src="../assets/js/lib/bootstrap.min.js"></script>
- <script type="text/javascript" src="../assets/js/lib/bootstrap-datepicker.min.js"></script>
- <script type="text/javascript" src="../assets/js/lib/moment.min.js"></script>
+ <script type="text/javascript" src="<?=h($assets)?>js/lib/jquery.min.js"></script>
+ <script type="text/javascript" src="<?=h($assets)?>js/lib/jquery.scrollTo.min.js"></script>
+ <script type="text/javascript" src="<?=h($assets)?>js/lib/bootstrap.min.js"></script>
+ <script type="text/javascript" src="<?=h($assets)?>js/lib/bootstrap-datepicker.min.js"></script>
+ <script type="text/javascript" src="<?=h($assets)?>js/lib/moment.min.js"></script>
- <script type="text/javascript" src="../assets/mejs/mediaelement-and-player.min.js"></script>
- <script type="text/javascript" src="../assets/js/lustiges-script.js"></script>
+ <script type="text/javascript" src="<?=h($assets)?>mejs/mediaelement-and-player.min.js"></script>
+ <script type="text/javascript" src="<?=h($assets)?>js/lustiges-script.js"></script>
</head>
<body class="<?=h(is_numeric($page[0]) ? 'e'.$page : $page)?>">
<? if(!@$naked): ?>
@@ -55,8 +55,10 @@
<? include("$assemblies/footer.phtml") ?>
<? endif ?>
- <span class="js-settings"
- data-scheduleoffset="<?=h($schedule->getSimulationOffset())?>"
- ></span>
+ <? if(isset($schedule)): ?>
+ <span class="js-settings"
+ data-scheduleoffset="<?=h($schedule->getSimulationOffset())?>"
+ ></span>
+ <? endif ?>
</body>
</html>
diff --git a/view/allclosed.php b/view/allclosed.php
new file mode 100644
index 0000000..869cbc1
--- /dev/null
+++ b/view/allclosed.php
@@ -0,0 +1,12 @@
+<?php
+
+$upcoming = new Upcoming();
+$events = $upcoming->getNextEvents();
+
+echo $tpl->render(array(
+ 'page' => 'allclosed',
+ 'title' => 'See you soon … somewhere else!',
+
+ 'next' => @$events[0],
+ 'events' => $events,
+));