From fd374f8b627bde637112cd90aee92e5c84301bbf Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Mon, 6 Apr 2015 15:03:38 +0200 Subject: Show all upcoming Events in closed View --- model/Upcoming.php | 5 ++--- template/closed.phtml | 32 +++++++++++++++++++++----------- view/closed.php | 4 +++- 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/model/Upcoming.php b/model/Upcoming.php index 6f54814..1724d0f 100644 --- a/model/Upcoming.php +++ b/model/Upcoming.php @@ -2,14 +2,13 @@ class Upcoming { - public function getNextEvent() + public function getNextEvents() { try { $events = file_get_contents('https://c3voc.de/eventkalender/events.json?filter=upcoming'); $events = json_decode($events, true); - $names = array_keys($events['voc_events']); - return $events['voc_events'][$names[0]]; + return array_values($events['voc_events']); } catch(ErrorException $e) { diff --git a/template/closed.phtml b/template/closed.phtml index 6b41f29..6cb86c4 100644 --- a/template/closed.phtml +++ b/template/closed.phtml @@ -1,25 +1,35 @@

getTitle())?> is over!

- -

See you soon at

+ +

See you soon at

- Lecture recording and streaming at getTitle())?> was organized and performed by the Chaos Computer Club Video Operation Center. The next Event we'll attend will be + Lecture recording and streaming at getTitle())?> was organized and performed by the Chaos Computer Club Video Operation Center. The next Events we'll attend will be




-
+ +
-
-
-
-
- +
+
+ + + + + + + +
+
+
+ +
-
-
+
+
diff --git a/view/closed.php b/view/closed.php index e1b126c..3346aad 100644 --- a/view/closed.php +++ b/view/closed.php @@ -1,10 +1,12 @@ getNextEvents(); echo $tpl->render(array( 'page' => 'closed', 'title' => 'See you soon … somewhere else!', - 'upcoming' => $upcoming->getNextEvent(), + 'next' => @$events[0], + 'events' => $events, )); -- cgit v1.2.3