From 5805de70b42d8674bcfd96cf57192f6c4a641d2c Mon Sep 17 00:00:00 2001 From: Paul Merrill Date: Thu, 4 Nov 2010 04:41:52 -0700 Subject: Reformatted error(), moved commaize() --- inc/display.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'inc/display.php') diff --git a/inc/display.php b/inc/display.php index 92f6eca8..132dcac5 100644 --- a/inc/display.php +++ b/inc/display.php @@ -14,8 +14,21 @@ return round($size, 2).$units[$i]; } + function commaize($n) { + $n = strval($n); + return (intval($n) < 1000) ? $n : commaize(substr($n, 0, -3)) . ',' . substr($n, -3); + } + function error($message) { - die(Element('page.html', Array('index' => ROOT, 'title'=>'Error', 'subtitle'=>'An error has occured.', 'body'=>"

$message

Go back.

"))); + die(Element('page.html', Array( + 'index'=>ROOT, + 'title'=>'Error', + 'subtitle'=>'An error has occured.', + 'body'=>"
" . + "

$message

" . + "

Go back.

" . + "
" + ))); } class Post { @@ -180,4 +193,5 @@ return $built; } }; -?> \ No newline at end of file +?> + -- cgit v1.3