diff options
author | MaZderMind | 2016-01-17 12:28:19 +0100 |
---|---|---|
committer | MaZderMind | 2016-01-17 12:28:19 +0100 |
commit | af759dfd51d0c60ad8e0c8a934ead64e726f2cb2 (patch) | |
tree | 7723bedcd86c2627c5a6e28411800dc941facabc /model/Conferences.php | |
parent | 62e82758536cef137640c708aabf504102e07f79 (diff) |
fix all-closed display
Diffstat (limited to 'model/Conferences.php')
-rw-r--r-- | model/Conferences.php | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/model/Conferences.php b/model/Conferences.php index ab7fe0e..5562e1f 100644 --- a/model/Conferences.php +++ b/model/Conferences.php @@ -43,8 +43,18 @@ class Conferences extends ModelBase return $sorted; } + public static function getFinishedConferencesSorted() { + $sorted = Conferences::getConferencesSorted(); + + $finished = array_values(array_filter($sorted, function($c) { + return @$c['CONFIG']['CONFERENCE']['ENDS_AT'] < time(); + })); + + return $finished; + } + public static function getLastConference() { - return Conferences::getConferencesSorted()[0]; + return Conferences::getFinishedConferencesSorted()[0]; } public static function exists($mandator) { @@ -64,8 +74,8 @@ class Conferences extends ModelBase 'title' => $conf->getTitle(), 'description' => $conf->getDescription(), - 'relive' => forceslash($mandator).$conf->getReliveUrl(), - 'releases' => $conf->getReleasesUrl(), + 'relive' => $conf->hasRelive() ? forceslash($mandator).$conf->getReliveUrl() : null, + 'releases' => $conf->hasReleases() ? $conf->getReleasesUrl() : null, 'CONFIG' => $GLOBALS['CONFIG'], ]; |