diff --git a/views/pages/willychat/messages.php b/views/pages/willychat/messages.php index 6d1fed1..428a5ba 100644 --- a/views/pages/willychat/messages.php +++ b/views/pages/willychat/messages.php @@ -1,3 +1,23 @@ + 'year', + 2592000 => 'month', + 604800 => 'week', + 86400 => 'day', + 3600 => 'hour', + 60 => 'minute', + 1 => 'second' + ); + foreach ($tokens as $unit => $text) { + if ($time < $unit) continue; + $numberOfUnits = floor($time / $unit); + return $numberOfUnits.' '.$text.(($numberOfUnits>1)?'s':''); + } +} +?> @@ -27,7 +47,7 @@
- +