Changeset 4 for global.php
- Timestamp:
- Nov 27, 2008, 7:53:21 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
global.php
r3 r4 1 1 <?php 2 3 $TimeStart = time(); 2 4 3 5 // SQL injection hack protection … … 62 64 if($Count>1) 63 65 { 64 if($Page>0) 66 if($Page>0) 65 67 { 66 68 $Result.= '<a href="'.$URL.'0"><<</a> '; … … 106 108 } 107 109 108 function Show Header($Title)110 function ShowPage($Title, $Content) 109 111 { 110 global $Config, $TimeStart , $Output;112 global $Config, $TimeStart; 111 113 112 $TimeStart = time(); 113 114 $Output = '<?xml version="1.0" encoding="'.$Config['Web']['Charset'].'"?>'. 115 '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'. 116 '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'. 117 '<head><link rel="stylesheet" href="'.$Config['Web']['RootFolder'].'/style.css" type="text/css" media="all" />'. 118 '<script type="text/javascript" src="'.$Config['Web']['RootFolder'].'/global.js"></script>'. 119 '<title>'.$Config['Web']['Title'].' - '.$Path.'</title> 120 </head><body> 121 <div id="Title">'.$Title.'</div>'; 122 } 123 124 function ShowFooter() 125 { 126 global $TimeStart, $Output; 127 114 $Output = '<?xml version="1.0" encoding="'.$Config['Web']['Charset'].'"?>'."\n". 115 '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'."\n". 116 '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'."\n". 117 '<head><link rel="stylesheet" href="'.$Config['Web']['RootFolder'].'style.css" type="text/css" media="all" />'."\n". 118 '<script type="text/javascript" src="'.$Config['Web']['RootFolder'].'global.js"></script>'."\n". 119 '<title>'.$Config['Web']['Title'].' - '.$Title.'</title>'."\n". 120 '</head><body bgcolor="#39A01C">'."\n"; 121 //'<div id="Title">'.$Title.'</div>'; 128 122 $Time = floor((GetMicrotime() - $TimeStart) * 100) / 100; 129 $Output .= '<div id="Footer">130 <i>| Správa webu: Jiří Hajda | e-mail: robie@centrum.cz | Vygenerováno za '.$Time.' s | Verze: 1.1 | Úprava skriptu: '.date('j.n.Y',filemtime($_SERVER['SCRIPT_FILENAME'])).' |</i>123 $Output .= $Content.'<div id="Footer"> 124 <i>| Správa webu: Jiří Hajda | e-mail: robie@centrum.cz | Vygenerováno za '.$Time.' s | Použitá paměť: '.HumanSize(memory_get_peak_usage(FALSE)).' |</i> 131 125 </div>'; 132 126 //ShowArray($GLOBALS); … … 135 129 } 136 130 131 $UnitNames = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB'); 132 133 function HumanSize($Value) 134 { 135 global $UnitNames; 136 137 $UnitIndex = 0; 138 while($Value > 1024) 139 { 140 $Value = round($Value / 1024, 3); 141 $UnitIndex++; 142 } 143 return($Value.' '.$UnitNames[$UnitIndex]); 144 } 145 137 146 ?>
Note:
See TracChangeset
for help on using the changeset viewer.