forked from leftypol/leftypol
Improved large file size error message.
This commit is contained in:
parent
2eddc7a4ee
commit
455f0c2602
4 changed files with 25 additions and 6 deletions
|
@ -1,4 +1,18 @@
|
|||
<?php
|
||||
function sprintf3($str, $vars, $delim = '%') {
|
||||
$replaces = array();
|
||||
foreach($vars as $k => $v) {
|
||||
$replaces[$delim . $k . $delim] = $v;
|
||||
}
|
||||
return str_replace(array_keys($replaces),
|
||||
array_values($replaces), $str);
|
||||
}
|
||||
|
||||
function commaize($n) {
|
||||
$n = strval($n);
|
||||
return (intval($n) < 1000) ? $n : commaize(substr($n, 0, -3)) . ',' . substr($n, -3);
|
||||
}
|
||||
|
||||
function sql_open() {
|
||||
global $sql;
|
||||
$sql = @mysql_connect(MY_SERVER, MY_USER, MY_PASSWORD) or error('Database error.');
|
||||
|
@ -502,4 +516,4 @@
|
|||
function int_to_word($n) {
|
||||
return chr($n & 255).chr(($n >> 8) & 255);
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue