aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMaZderMind2015-03-02 16:38:50 +0100
committerMaZderMind2015-03-02 16:38:50 +0100
commit40c699e1a307919f65a52632ddf816a735dde8a0 (patch)
treeef0bde4da4ec047f20b8c1c5c4e4fd706a88e696 /lib
parent583092bff8d82cc5eacd9759f751bbc6e89974cf (diff)
Relive
Diffstat (limited to 'lib')
-rw-r--r--lib/helper.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/helper.php b/lib/helper.php
index efdf84c..d21b4c6 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -233,3 +233,23 @@ function startswith($needle, $haystack)
{
return substr($haystack, 0, strlen($needle)) == $needle;
}
+
+function relive_talks()
+{
+ $talks = file_get_contents(get('OVERVIEW.RELIVE_JSON'));
+ $talks = utf8_decode($talks);
+ $talks = 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;
+}