/[health_html]/inc/Smarty.local.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /inc/Smarty.local.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by ravilov, Fri Aug 3 09:12:42 2001 UTC revision 1.2 by ravilov, Mon Sep 3 15:52:15 2001 UTC
# Line 125  function smarty_mod_filesize($file,$dir, Line 125  function smarty_mod_filesize($file,$dir,
125          $ext=strtoupper(array_pop($ext));          $ext=strtoupper(array_pop($ext));
126    
127          if ($size=filesize($path)) {          if ($size=filesize($path)) {
128                  switch ($unit) {                  switch (strtoupper($unit)) {
129                          case 'Mb':                          case 'MB':
130                          case 'mb':                                  return sprintf("%s, %2.1f MB",$ext,$size/(1024*1024));
131                                  return sprintf("%s, %2.1f Mb",$ext,$size/(1024*1024));                          case 'KB':
132                          case 'Kb':                                  return sprintf("%s, %2.1f kB",$ext,$size/1024);
                         case 'kb':  
                                 return sprintf("%s, %2.1f Mb",$ext,$size/1024);  
133                          case 'auto':                          case 'auto':
134                                  $size=$size/1024; # Kb                                  $size=$size/1024; # Kb
135                                  if ($size > 1024) {                                  if ($size > 1024) {
136                                          return sprintf("%s, %2.1f Mb",$ext,$size/1024);                                          return sprintf("%s, %2.1f MB",$ext,$size/1024);
137                                  } else {                                  } else {
138                                          return sprintf("%s, %2.1f Kb",$ext,$size);                                          return sprintf("%s, %2.1f kB",$ext,$size);
139                                  }                                  }
140                                                                                    
141                  }                  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.26