diff options
Diffstat (limited to 'model')
-rw-r--r-- | model/Feedback.php | 6 | ||||
-rw-r--r-- | model/Room.php | 10 | ||||
-rw-r--r-- | model/Schedule.php | 8 | ||||
-rw-r--r-- | model/Stream.php | 7 |
4 files changed, 27 insertions, 4 deletions
diff --git a/model/Feedback.php b/model/Feedback.php index 16791eb..d2846ad 100644 --- a/model/Feedback.php +++ b/model/Feedback.php @@ -35,6 +35,8 @@ class Feedback VALUES (:reported, :datetime, :net, :os, :player, :stream, :ipproto_v4, :ipproto_v6, :provider, :issues, :issuetext) '); + $issuetext = preg_replace('/\r?\n/', ' ', $info['issuetext']); + $stm->execute(array( 'reported' => time(), 'datetime' => strtotime($info['datetime']), @@ -46,13 +48,12 @@ class Feedback 'ipproto_v6' => isset($info['ipproto']) && is_array($info['ipproto']) && in_array('v6', $info['ipproto']), 'provider' => $info['provider'], 'issues' => isset($info['issues']) && is_array($info['issues']) ? implode(',', $info['issues']) : '', - 'issuetext' => $info['issuetext'], + 'issuetext' => $issuetext, )); } public function isLoggedIn() { - return true; return isset($_SERVER['PHP_AUTH_USER']) && $_SERVER['PHP_AUTH_USER'] == $this->getConference()->get('FEEDBACK.USERNAME') && @@ -76,6 +77,7 @@ class Feedback SELECT * FROM feedback WHERE reported BETWEEN :from AND :to + ORDER BY reported DESC '); $stm->setFetchMode(PDO::FETCH_ASSOC); diff --git a/model/Room.php b/model/Room.php index 21a05a9..cfc14c1 100644 --- a/model/Room.php +++ b/model/Room.php @@ -67,6 +67,16 @@ class Room return $this->getConference()->get('ROOMS.'.$this->getSlug().'.DISPLAY', $this->getSlug()); } + public function getDisplayShort() { + $display_short = $this->getConference()->get('ROOMS.'.$this->getSlug().'.DISPLAY_SHORT', $this->getSlug()); + if (empty($display_short)) { + return $this->getDisplay(); + } + else { + return $display_short; + } + } + public function hasStereo() { diff --git a/model/Schedule.php b/model/Schedule.php index 4b5d25e..5ffbeda 100644 --- a/model/Schedule.php +++ b/model/Schedule.php @@ -39,6 +39,13 @@ class Schedule return isset( $mapping[$scheduleRoom] ); } + public function isOptout($event) { + if (isset($event->recording)) { + return $event->recording->optout == 'true'; + } + return false; + } + public function getMappedRoom($scheduleRoom) { $mapping = $this->getScheduleToRoomSlugMapping(); return $this->getConference()->getRoomIfExists( @$mapping[$scheduleRoom] ); @@ -199,6 +206,7 @@ class Schedule 'end' => $end, 'duration' => $duration, 'room_known' => $this->isRoomMapped($name), + 'optout' => $this->isOptout($event), ); $lastend = $end; diff --git a/model/Stream.php b/model/Stream.php index ef9e8d7..d577df6 100644 --- a/model/Stream.php +++ b/model/Stream.php @@ -42,9 +42,9 @@ class Stream switch($this->getSelection()) { case 'sd': - case 'slides': return array(1024, 576); + case 'slides': case 'hd': return array(1920, 1080); @@ -101,7 +101,7 @@ class Stream break; case 'dash': - $display .= 'Adaptive'; + # no special attribution, this is the "normal" stream break; default: @@ -264,4 +264,7 @@ class Stream 'opus' => 'Opus', ); } + public function getPoster() { + return joinpath(['/', 'thumbs', rawurlencode($this->getRoom()->getStream()).'-poster.png']); + } } |