From 6d40e07fbe52cbf5042e48dff76a592d1e41cec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 1 Feb 2013 21:11:04 +0100 Subject: [PATCH] Fix TimeIntervalOptionType --- .../system/option/TimeIntervalOptionType.class.php | 12 +++++++++++- file/lib/util/ChatUtil.class.php | 2 +- option.xml | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/file/lib/system/option/TimeIntervalOptionType.class.php b/file/lib/system/option/TimeIntervalOptionType.class.php index 0d6afb1..c7d0339 100644 --- a/file/lib/system/option/TimeIntervalOptionType.class.php +++ b/file/lib/system/option/TimeIntervalOptionType.class.php @@ -22,10 +22,20 @@ public function getData(\wcf\data\option\Option $option, $newValue) { * @see \wcf\system\option\TextOptionType::getFormElement() */ public function getFormElement(\wcf\data\option\Option $option, $value) { - $tmp = (int) ($value / 60); + $tmp = ''; + if ($value > 86400) { + $tmp = floor($value / 86400).'d'; + $value -= floor($value / 86400) * 86400; + } + if ($value > 3600) { + $tmp .= floor($value / 3600).'h'; + $value -= floor($value / 3600) * 3600; + } + $tmp .= floor($value / 60); if ($value % 60 != 0) { $tmp .= ','.($value % 60).'s'; } + return parent::getFormElement($option, $tmp); } } diff --git a/file/lib/util/ChatUtil.class.php b/file/lib/util/ChatUtil.class.php index 7f3c1d2..7336d97 100644 --- a/file/lib/util/ChatUtil.class.php +++ b/file/lib/util/ChatUtil.class.php @@ -75,7 +75,7 @@ public static function getDiedUsers() { $stmt = WCF::getDB()->prepareStatement($sql); $stmt->execute(array('lastActivity', 'roomID', $time - 30)); $users = array(); - while ($users[] = $stmt->fetchArray()); + while ($user = $stmt->fetchArray()) $users[] = $user; return $users; } diff --git a/option.xml b/option.xml index 8f460ab..2a88897 100644 --- a/option.xml +++ b/option.xml @@ -72,7 +72,7 @@