implemented a functional template system, and a simple WORKING template, and other smaller things and fixes...

git-svn-id: file:///Users/jimeh/Desktop/dlist/trunk@10 a5845835-ea0f-0410-a762-dd0bfe9bfde8
This commit is contained in:
jim
2006-03-31 22:53:26 +00:00
parent f3a2a9e5b9
commit 05fc88b1d9
11 changed files with 178 additions and 89 deletions

View File

@@ -89,7 +89,6 @@ class dirList {
}
// ==============================================
// ----- [ Internal Functions ] -----------------
// ==============================================
@@ -150,10 +149,9 @@ class dirList {
$types = array('bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
for($n = 0; $bytes >= 1024; $n++) $bytes = $bytes / 1024;
$bytes = number_format($bytes, 2);
if ( !empty($bytes[1]) ) {
$bytes = explode('.', $bytes);
$bytes[1] = rtrim($bytes[1], '0');
$bytes = ( $bytes[1] != '' ) ? $bytes[0].'.'.$bytes[1] : $bytes[0] ;
if ( preg_match("/([0-9]+)\.([0-9]+)/", $bytes, $bytes) ) {
$bytes[2] = rtrim($bytes[2], '0');
$bytes = ( !empty($bytes[2]) ) ? $bytes[1].'.'.$bytes[2] : $bytes[1] ;
}
return $bytes.' '.$types[$n];
}