From 40c699e1a307919f65a52632ddf816a735dde8a0 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Mon, 2 Mar 2015 16:38:50 +0100 Subject: Relive --- lib/helper.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'lib/helper.php') 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; +} -- cgit v1.2.3