Changeset 535
- Timestamp:
- 03/02/2008 03:16:21 AM (6 months ago)
- Location:
- trunk/admin
- Files:
-
- 2 modified
-
xcache.css (modified) (1 diff)
-
xcache.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/xcache.css
r530 r535 29 29 .blocksgraph { border: 1px solid gray; border-bottom: 0px; } 30 30 31 .hitsgraph { height: 20px; border: solid gray; border-width: 1px 0 1px 0;margin: auto; }31 .hitsgraph { height: 20px; margin: auto; } 32 32 .hitsgraph div { float: left; width: 2px; height: 100%; } 33 .bitsgraph div div { float: none; width: 100%; } 33 .hitsgraph div div { float: none; width: 100%; } 34 .hitsgraph div div.barf { border: 0px solid gray; border-width: 1px 0 0 0; } 35 .hitsgraph div div.barv { border: 0px solid gray; border-width: 0 0 1px 0; } 36 .hitsgraph div div.barf.active { border-color: yellow; } 37 .hitsgraph div div.barv.active { border-color: yellow; } 34 38 35 39 .switcher, h1 { text-align: center; display: block; } -
trunk/admin/xcache.php
r526 r535 152 152 } 153 153 154 function bar_percent($percent )154 function bar_percent($percent, $active) 155 155 { 156 156 $r = 220 + (int) ($percent * 25); 157 157 $g = $b = 220 - (int) ($percent * 220); 158 158 $percent = (int) ($percent * 100); 159 $a = $active ? ' active' : ''; 159 160 return '<div>' 160 . '<div style="height: ' . (100 - $percent) . '%"></div>'161 . '<div style="background: rgb(' . "$r,$g,$b" . '); height: ' . $percent . '%"></div>'161 . '<div class="barf' . $a . '" style="height: ' . (100 - $percent) . '%"></div>' 162 . '<div class="barv' . $a . '" style="background: rgb(' . "$r,$g,$b" . '); height: ' . $percent . '%"></div>' 162 163 . '</div>'; 163 164 } … … 174 175 return ''; 175 176 } 177 $t = (time() / (60 * 60)) % 24; 176 178 $html = array(); 177 foreach ($hits as $ v) {178 $html[] = bar_percent($v / $max );179 foreach ($hits as $i => $v) { 180 $html[] = bar_percent($v / $max, $i == $t); 179 181 } 180 182 return implode('', $html);

