Changeset 78 for trunk/www/Base/Global.php
- Timestamp:
- Sep 11, 2009, 8:18:38 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/Base/Global.php
r74 r78 6 6 $UnitNames = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB'); 7 7 8 function HumanSize($Value)9 {10 global $UnitNames;11 12 $UnitIndex = 0;13 while($Value > 1024)14 {15 $Value = round($Value / 1024, 3);16 $UnitIndex++;17 }18 return($Value.' '.$UnitNames[$UnitIndex]);19 }20 21 function HumanDate($Time)22 {23 $Date = explode(' ', $Time);24 $Parts = explode('-', $Date[0]);25 if($Date != '0000-00-00') return(($Parts[2]*1).'.'.($Parts[1]*1).'.'.$Parts[0]);26 else return(' ');27 }28 29 8 function TimeToHumanTime($Value) 30 9 { 31 10 return(floor($Value / 3600 / 24).' dnů, '.date('H:i:s', $Value - 3600)); 32 }33 34 function GetRemoteAddress()35 {36 if(array_key_exists('HTTP_X_FORWARDED_FOR',$_SERVER)) $IP = $_SERVER['HTTP_X_FORWARDED_FOR'] ;37 else if(array_key_exists('REMOTE_ADDR', $_SERVER)) $IP = $_SERVER['REMOTE_ADDR'];38 else $IP = '0.0.0.0';39 return($IP);40 11 } 41 12
Note:
See TracChangeset
for help on using the changeset viewer.