summaryrefslogtreecommitdiff
path: root/inc/display.php
diff options
context:
space:
mode:
authorPaul Merrill <napalminc@gmail.com>2010-11-04 04:41:52 -0700
committerPaul Merrill <napalminc@gmail.com>2010-11-04 04:41:52 -0700
commit5805de70b42d8674bcfd96cf57192f6c4a641d2c (patch)
treedb6e1c0ba9ba717200fe2600edf3e80d53a64882 /inc/display.php
parent455f0c2602350f229e6f58d624790c3d7448a68b (diff)
Reformatted error(), moved commaize()
Diffstat (limited to 'inc/display.php')
-rw-r--r--inc/display.php18
1 files changed, 16 insertions, 2 deletions
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'=>"<center><h2>$message</h2></center><p style=\"text-align:center;\"><a href=\"" . ROOT . FILE_INDEX . "\">Go back</a>.</p>")));
+ die(Element('page.html', Array(
+ 'index'=>ROOT,
+ 'title'=>'Error',
+ 'subtitle'=>'An error has occured.',
+ 'body'=>"<center>" .
+ "<h2>$message</h2>" .
+ "<p><a href=\"" . ROOT . FILE_INDEX . "\">Go back</a>.</p>" .
+ "</center>"
+ )));
}
class Post {
@@ -180,4 +193,5 @@
return $built;
}
};
-?> \ No newline at end of file
+?>
+