aboutsummaryrefslogtreecommitdiff
path: root/model/Relive.php
diff options
context:
space:
mode:
authorFlorian Larysch2016-12-30 13:27:28 +0100
committerFlorian Larysch2016-12-30 13:31:55 +0100
commita958c11a06ba2fd8c717aa4bf5b6be495e72ce8a (patch)
tree8c6f307e1304476117287ab77ba0df8ae1753cb8 /model/Relive.php
parentb454b2d26d9840dcd71ce65dbae21b0887fad536 (diff)
relive: sort recorded talks chronologically
Diffstat (limited to 'model/Relive.php')
-rw-r--r--model/Relive.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/model/Relive.php b/model/Relive.php
index 3da7c90..b6d33da 100644
--- a/model/Relive.php
+++ b/model/Relive.php
@@ -52,8 +52,15 @@ class Relive
return strcmp($a['room'], $b['room']);
}
- // all other talks get sorted by their name
- return strcmp($a['title'], $b['title']);
+ // all other talks get sorted by their start time
+ // sorting the most recent talks to the top
+ $delta = $b['start'] - $a['start'];
+
+ // sort by room in case of a collision
+ if($delta == 0)
+ return strcmp($a['room'], $b['room']);
+ else
+ return $delta;
});
$talks_by_id = array();