aboutsummaryrefslogtreecommitdiff
path: root/model/Relive.php
diff options
context:
space:
mode:
authorMaZderMind2015-03-30 16:20:30 +0200
committerMaZderMind2015-03-30 16:20:30 +0200
commitf7d9d592745d1cb5cb2de76ed6ae99be974f1807 (patch)
tree0f9f77efe9efc70b3ac0404a46b249f809197922 /model/Relive.php
parentea4b6c7699a7fbb7be3d9e5ce86c84a36b63f569 (diff)
Implement MVT Pattern based on simple Config options
Diffstat (limited to 'model/Relive.php')
-rw-r--r--model/Relive.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/model/Relive.php b/model/Relive.php
new file mode 100644
index 0000000..3ffdc1b
--- /dev/null
+++ b/model/Relive.php
@@ -0,0 +1,24 @@
+<?php
+
+class Relive extends ModelBase
+{
+ function relive_talks()
+ {
+ $talks = @file_get_contents(get('OVERVIEW.RELIVE_JSON'));
+ $talks = utf8_decode($talks);
+ $talks = (array)json_decode($talks, true);
+
+ usort($talks, function($a, $b) {
+ $sort = array('live', 'recorded', 'released');
+ return array_search($a['status'], $sort) > array_search($b['status'], $sort);
+ });
+
+ $talks_by_id = array();
+ foreach ($talks as $value)
+ {
+ $talks_by_id[$value['id']] = $value;
+ }
+
+ return $talks_by_id;
+ }
+}