diff options
Diffstat (limited to 'includes/functions.inc')
-rw-r--r-- | includes/functions.inc | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/includes/functions.inc b/includes/functions.inc index 5effe5b..7a6ad5d 100644 --- a/includes/functions.inc +++ b/includes/functions.inc @@ -388,25 +388,19 @@ if (!function_exists("timeAgo")) { $time = strtotime($time); } - $periods = ["sec.", "mn.", "hr.", "d.", "wk.", "mo.", "y.", "ages"]; - $periods_fr = ["sec.", "mn.", "hr.", "j.", "sem.", "m.", "a.", "des années"]; + $periods = ["sec", "min", "hr", "d", "wk", "mo", "y", "ages"]; + $periods_fr = $periods; $lengths = array("60", "60", "24", "7", "4.35", "12", "100"); $now = time(); $difference = $now - $time; if ($difference <= 10 && $difference >= 0) { - if ($french) { - return $tense_fr = "à l'instant"; - } else { - return $tense = "now"; - } + return $tense = "now"; } elseif ($difference > 0) { $tense = "ago"; - $tense_fr = "il y a"; } else { $tense = "later"; - $tense_fr = "dans"; } for ($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) { @@ -415,13 +409,8 @@ if (!function_exists("timeAgo")) { $difference = round($difference); - if ($french) { - $period = $periods_fr[$j]; - return "{$tense_fr} {$difference} {$period}"; - } else { - $period = $periods[$j]; - return "{$difference} {$period} {$tense}"; - } + $period = $periods[$j]; + return "{$difference} {$period} {$tense}"; } } |