From a0ae475ea450b6cacdb615698d8bfc62d0c99540 Mon Sep 17 00:00:00 2001 From: Paul Merrill Date: Sun, 2 Jan 2011 08:27:34 -0800 Subject: [PATCH] Added live countdown to expiry on ban page. --- inc/functions.php | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index 8cea487e..b56bf29d 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -55,10 +55,10 @@ return ($num = round($difference/(60*60))) . ' hour' . ($num != 1 ? 's' : ''); } elseif($difference < 60*60*24*7) { return ($num = round($difference/(60*60*24))) . ' day' . ($num != 1 ? 's' : ''); - } elseif($difference < 60*60*24*7*52) { + } elseif($difference < 60*60*24*365) { return ($num = round($difference/(60*60*24*7))) . ' week' . ($num != 1 ? 's' : ''); } else { - return ($num = round($difference/(60*60*24*7*52))) . ' year' . ($num != 1 ? 's' : ''); + return ($num = round($difference/(60*60*24*365))) . ' year' . ($num != 1 ? 's' : ''); } } @@ -99,11 +99,38 @@ formatDate($ban['set']) . ', and ' . ($ban['expires'] ? - 'expires ' . until($ban['expires']) . ' from now, which is on ' . + 'expires ' . until($ban['expires']) . ' from now, which is on ' . formatDate($ban['expires']) . - '' + ' + ' : 'will not expire' ) . - '.

+ '

Your IP address is ' . $_SERVER['REMOTE_ADDR'] . '.

'; @@ -739,4 +766,4 @@ function int_to_word($n) { return chr($n & 255).chr(($n >> 8) & 255); } -?> \ No newline at end of file +?>