diff options
Diffstat (limited to '')
-rw-r--r-- | lib/helper.php | 20 |
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; +} |