diff options
| author | Savetheinternet <savetheinternet@n0v4.com> | 2010-11-05 01:35:53 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@n0v4.com> | 2010-11-05 01:35:53 +1100 |
| commit | 599530e935ac85978ced7198b52212308a6b0f88 (patch) | |
| tree | 5e78f53b7ffd8a504913d0bb39d6c813b505de7c /inc/display.php | |
| parent | 664dce496a9259cc60ec39c31e47023f3c3eb788 (diff) | |
| parent | 6cdaed486e6c373b52f639d3e92d7365242f6a89 (diff) | |
Merge branch 'master' of github.com:savetheinternet/Tinyboard
Conflicts:
inc/config.php
inc/functions.php
post.php
Diffstat (limited to 'inc/display.php')
| -rw-r--r-- | inc/display.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/inc/display.php b/inc/display.php index b988e3bc..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'=>"<h1>$message</h1><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 +?> + |
