Changeset 2314
- Timestamp:
- 12/18/10 21:03:07 (17 months ago)
- Location:
- branches/1.5/functions
- Files:
-
- 4 modified
-
funcs.arrays.php (modified) (1 diff)
-
funcs.files.php (modified) (5 diffs)
-
funcs.strings.php (modified) (1 diff)
-
funcs.times.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.5/functions/funcs.arrays.php
r2270 r2314 218 218 return $ret; 219 219 } 220 221 ?> -
branches/1.5/functions/funcs.files.php
r2115 r2314 36 36 { 37 37 $filenames = array(); 38 $directory = new DirectoryIterator($folder); 39 foreach( $directory as $file ) { 38 foreach( new DirectoryIterator($folder) as $file ) { 40 39 if( !$file->isDot() && ($file->getFilename() != '.svn') ) { 41 $filename = ($type === 'full') ? $folder.($file->getFilename()) : $file->getFilename(); 42 array_push($filenames, $file->getFilename()); 40 $filenames[] = (($type === 'full') ? $folder : '').$file->getFilename(); 43 41 } 44 42 } … … 56 54 { 57 55 $stripped = array(); 58 59 56 foreach( $fileNames as $fileName ) { 60 array_push($stripped, stripFileExtension($fileName));57 $stripped[] = stripFileExtension($fileName); 61 58 } 62 59 return $stripped; … … 85 82 { 86 83 if( is_numeric($filesize) ) { 87 $decr = 1024;88 84 $step = 0; 89 85 $prefix = array('Byte', 'KB', 'MB', 'GB', 'TB', 'PB'); 90 86 91 while( ($filesize / $decr) > 0.9 ) {92 $filesize = $filesize / $decr;87 while( ($filesize / 1024) > 0.9 ) { 88 $filesize = $filesize / 1024; 93 89 $step++; 94 90 } … … 96 92 return round($filesize, 2).' '.$prefix[$step]; 97 93 } 98 return 'Error displaying filesize';94 trigger_error('Error displaying filesize', E_USER_NOTICE); 99 95 } 100 96 … … 118 114 return $h; 119 115 } 120 ?> -
branches/1.5/functions/funcs.strings.php
r2253 r2314 169 169 //From Wordpress and http://www.bernzilla.com/item.php?id=1007 170 170 $output = sanitize_title_with_dashes($output); 171 $output = urldecode($output);172 171 173 172 if ($output) { -
branches/1.5/functions/funcs.times.php
r2101 r2314 39 39 $timestart = microtime(TRUE); 40 40 return TRUE; 41 42 41 } 43 42 … … 143 142 { 144 143 $block = ($block * 60) * 60; // change into seconds 145 $time_now = time(); 146 $start_of_current_block = floor($time_now / $block); 144 $start_of_current_block = floor(time() / $block); 147 145 $start_of_current_block *= $block; 148 146 … … 152 150 153 151 } 154 ?>