From d740e586cf88ba2187107e015c2fb5554e5f9327 Mon Sep 17 00:00:00 2001 From: Andreas Hubel Date: Thu, 30 Dec 2021 04:19:48 +0100 Subject: [PATCH] refactor sorting, prepare filter for empty rooms --- configs/conferences/rc3/config.php | 10 ++++------ template/overview.phtml | 20 +++++++++++++++----- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/configs/conferences/rc3/config.php b/configs/conferences/rc3/config.php index b2167d18..6c680e29 100644 --- a/configs/conferences/rc3/config.php +++ b/configs/conferences/rc3/config.php @@ -18,7 +18,7 @@ $CONFIG['CONFERENCE'] = array( * * Wird dieser Zeitpunkt nicht angegeben, endet die Konferenz nie. (Siehe aber CLOSED weiter unten) */ - 'ENDS_AT' => strtotime("2021-12-31 03:00"), + 'ENDS_AT' => strtotime("2021-12-31 05:30"), /** * Hiermit kann die Funktionalitaet von STARTS_AT/ENDS_AT überschrieben werden. Der Wert 'before' @@ -126,6 +126,8 @@ $CONFIG['OVERVIEW'] = array( 'GROUPS' => array( // TODO sort array in random order, based on current hour or simular 'Channels' => array( + 'infobeamer', + 'cbase', 'cwtv', 'cbase', 'r3s', @@ -134,14 +136,11 @@ $CONFIG['OVERVIEW'] = array( 'fem', 'franconiannet', 'aboutfuture', - 'sendezentrum', + # 'sendezentrum', 'haecksen', 'gehacktesfromhell', 'xhain', ), - 'Info' => array( - 'infobeamer' - ), 'Music' => array( 'c3lounge', 'abchillgleis' @@ -791,7 +790,6 @@ $CONFIG['ROOMS'] = array( 'TWITTER' => false, ), 'infobeamer' => array( - 'WIDE' => true, 'DISPLAY' => 'Infobeamer', 'DISPLAY_SHORT' => 'Infobeamer', 'STREAM' => 'infobeamer', diff --git a/template/overview.phtml b/template/overview.phtml index 79f9ccef..571c4398 100644 --- a/template/overview.phtml +++ b/template/overview.phtml @@ -12,17 +12,26 @@
getSlug() ]; + return isset($upcoming['next']); + }); */ $count = count($rooms); $idx = 0; usort($rooms, function ($r_a, $r_b) { global $upcomingTalksPerRoom; $u_a = $upcomingTalksPerRoom[ $r_a->getSlug() ]; + $a = @$u_a['current']['special'] ? $u_a['next'] : $u_a['current']; $u_b = $upcomingTalksPerRoom[ $r_b->getSlug() ]; - return ( - (@$u_a['current']['special'] ? @$u_a['next']['start'] : @$u_a['current']['start']) - <=> - (@$u_b['current']['special'] ? @$u_b['next']['start'] : @$u_b['current']['start']) - ); + $b = @$u_b['current']['special'] ? $u_b['next'] : $u_b['current']; + + if ( $u_a['next'] === null || $u_b['next'] === null) { + return -($u_a['next'] <=> $u_b['next']); + } + + return @$a['start'] <=> @$b['start']; }); foreach($rooms as $room): @@ -91,6 +100,7 @@ hasSchedule()): $upcoming = @$upcomingTalksPerRoom[ $room->getSlug() ] ?: []; + // echo var_dump($upcoming); $current = @$upcoming['current']; $next = @$upcoming['next']; ?>