Changeset 535 for trunk/admin/xcache.php
- Timestamp:
- 03/02/2008 03:16:21 AM (9 months ago)
- Files:
-
- 1 modified
-
trunk/admin/xcache.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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);

