Hi,
ich habe ein Problem mit der Farbtiefe-Ausgabe in meiner Statistik.
Die Statistik, die ich verwende hat für mich zu wenig Angaben bzgl. Bildschirmauflösung. Deshalb wollte ich das erweitern. Das klappt auch, aber plötzlich wird mir z.B. statt 32 bit Farbtiefe nur 8 bit angezeigt.
D.h. irgendwo habe ich einen Fehler drin, aber ich finde ihn nicht.
Ursprüngliche Datei:
meine Datei:
Ausgabedatei original:
Ausgabedatei bearbeitet:
Findet jemand den Fehler?
Ich wäre Euch sehr dankbar.
Gruß Ronja
ich habe ein Problem mit der Farbtiefe-Ausgabe in meiner Statistik.
Die Statistik, die ich verwende hat für mich zu wenig Angaben bzgl. Bildschirmauflösung. Deshalb wollte ich das erweitern. Das klappt auch, aber plötzlich wird mir z.B. statt 32 bit Farbtiefe nur 8 bit angezeigt.
D.h. irgendwo habe ich einen Fehler drin, aber ich finde ihn nicht.
Ursprüngliche Datei:
PHP:
if(isset($_GET['scr'])) {
$stat = 'logs/stat.isl';
$fid = fopen($stat, 'r+');
while (!flock($fid, 2+4));
$buf = fgetcsv($fid, 1024, ',');
switch($_GET['scr']) {
case '640x480' : $buf[1]++; break;
case '800x600' : $buf[2]++; break;
case '1024x768' : $buf[3]++; break;
case '1152x864' : $buf[4]++; break;
case '1280x1024': $buf[5]++; break;
default: $buf[6]++; break;
}
switch($_GET['colorbit']) {
case '4' : $buf[7]++; break;
case '8' : $buf[8]++; break;
case '16': $buf[9]++; break;
case '24': $buf[10]++; break;
case '32': $buf[11]++; break;
default: $buf[12]++; break;
}
switch($_GET['f']) {
case '1' : $buf[48]++; break;
default: $buf[49]++; break;
}
switch($_GET['j']) {
case '1' : $buf[50]++; break;
default: $buf[51]++; break;
}
$buffer = implode(',', $buf);
rewind($fid);
fwrite($fid, chop($buffer));
flock($fid, 3);
fclose($fid);
}
?>
meine Datei:
PHP:
if(isset($_GET['scr'])) {
$stat = 'logs/stat.isl';
$fid = fopen($stat, 'r+');
while (!flock($fid, 2+4));
$buf = fgetcsv($fid, 1024, ',');
switch($_GET['scr']) {
case '800x600' : $buf[1]++; break;
case '960x600' : $buf[2]++; break;
case '1024x600' : $buf[3]++; break;
case '1024x768' : $buf[4]++; break;
case '1152x864' : $buf[5]++; break;
case '1280x720' : $buf[6]++; break;
case '1280x768' : $buf[7]++; break;
case '1280x800' : $buf[8]++; break;
case '1280x1024': $buf[9]++; break;
case '1360x768' : $buf[10]++; break;
case '1400x900' : $buf[11]++; break;
case '1600x900' : $buf[12]++; break;
case '1600x1200': $buf[13]++; break;
case '1680x1050': $buf[14]++; break;
case '1600x1200': $buf[15]++; break;
case '1680x1250': $buf[16]++; break;
case '1920x1080': $buf[17]++; break;
case '1920x1200': $buf[18]++; break;
default: $buf[19]++; break;
}
switch($_GET['colorbit']) {
case '4' : $buf[20]++; break;
case '8' : $buf[21]++; break;
case '16': $buf[22]++; break;
case '24': $buf[23]++; break;
case '32': $buf[24]++; break;
default: $buf[25]++; break;
}
switch($_GET['f']) {
case '1' : $buf[48]++; break;
default: $buf[49]++; break;
}
switch($_GET['j']) {
case '1' : $buf[50]++; break;
default: $buf[51]++; break;
}
$buffer = implode(',', $buf);
rewind($fid);
fwrite($fid, chop($buffer));
flock($fid, 3);
fclose($fid);
}
?>
Ausgabedatei original:
PHP:
<table border='0' cellspacing='0' cellpadding='0' width='380' align='left' align='center' bgcolor='#336699'>
<tr>
<td>
<div class="block_title"><?php echo $rmsg['title']['res'] ?></div>
<table width='100%' align='center' cellspacing='1' cellpadding='2' border='0'>
<?php
$max_res = 0;
for($n=1; $n<=6; $n++) if($max_res < $dane['stat'][$n]) $max_res = $dane['stat'][$n];
for($n=1; $n<=6; $n++) {
if(!empty($max_res)) $dlugosc = round(200*$dane['stat'][$n]/$max_res);
else $dlugosc = 1;
echo '<tr>
<td class="small" bgcolor="#EEEEEE">'.$rmsg['res'][$n-1].'</td>
<td bgcolor="#EEEEEE" class="small"><img src="img/barh2.gif" border="0" width="'.$dlugosc.'" height="10" align="absmiddle"></td>
<td class="small" bgcolor="#EEEEEE" width="60">'.$dane['stat'][$n].'</td>
</tr>';
}
?>
</table>
</td>
</tr>
</table>
</td>
<td>
<table border='0' cellspacing='0' cellpadding='0' width='380' align='right' align='center' bgcolor='#336699'>
<tr>
<td>
<div class="block_title"><?php echo $rmsg['title']['colors'] ?></div>
<table width='100%' align='center' cellspacing='1' cellpadding='2' border='0'>
<?php
$max_color = 0;
for($n=7; $n<=12; $n++) if($max_color < $dane['stat'][$n]) $max_color = $dane['stat'][$n];
for($n=1; $n<=6; $n++) {
if(!empty($max_color)) $dlugosc = round(200*$dane['stat'][$n+6]/$max_color);
else $dlugosc = 1;
echo '<tr>
<td class="small" bgcolor="#EEEEEE">'.$rmsg['color'][$n-1].'</td>
<td class="small" bgcolor="#EEEEEE"><img src="img/barh3.gif" border="0" width="'.$dlugosc.'" height="10" align="absmiddle"></td>
<td class="small" bgcolor="#EEEEEE">'.$dane['stat'][$n+6].'</td>
</tr>';
}
?>
</table>
Ausgabedatei bearbeitet:
PHP:
<table border='0' cellspacing='0' cellpadding='0' width='380' align='left' align='center' bgcolor='#333333'>
<tr>
<td>
<div class="block_title"><?php echo $rmsg['title']['res'] ?></div>
<table width='100%' align='center' cellspacing='1' cellpadding='2' border='0'>
<?php
$max_res = 0;
for($n=1; $n<=19; $n++) if($max_res < $dane['stat'][$n]) $max_res = $dane['stat'][$n];
for($n=1; $n<=19; $n++) {
if(!empty($max_res)) $dlugosc = round(200*$dane['stat'][$n]/$max_res);
else $dlugosc = 1;
echo '<tr>
<td class="small" bgcolor="#EEEEEE">'.$rmsg['res'][$n-1].'</td>
<td bgcolor="#EEEEEE" class="small"><img src="img/barh2.gif" border="0" width="'.$dlugosc.'" height="10" align="absmiddle"></td>
<td class="small" bgcolor="#EEEEEE" width="60">'.$dane['stat'][$n].'</td>
</tr>';
}
?>
</table>
</td>
</tr>
</table>
</td>
<td>
<table border='0' cellspacing='0' cellpadding='0' width='380' align='right' align='center' bgcolor='#333333'>
<tr>
<td>
<div class="block_title"><?php echo $rmsg['title']['colors'] ?></div>
<table width='100%' align='center' cellspacing='1' cellpadding='2' border='0'>
<?php
$max_color = 0;
for($n=20; $n<=25; $n++) if($max_color < $dane['stat'][$n]) $max_color = $dane['stat'][$n];
for($n=1; $n<=6; $n++) {
if(!empty($max_color)) $dlugosc = round(200*$dane['stat'][$n+6]/$max_color);
else $dlugosc = 1;
echo '<tr>
<td class="small" bgcolor="#EEEEEE">'.$rmsg['color'][$n-1].'</td>
<td class="small" bgcolor="#EEEEEE"><img src="img/barh3.gif" border="0" width="'.$dlugosc.'" height="10" align="absmiddle"></td>
<td class="small" bgcolor="#EEEEEE">'.$dane['stat'][$n+6].'</td>
</tr>';
}
?>
</table>
Findet jemand den Fehler?
Ich wäre Euch sehr dankbar.
Gruß Ronja