'Všechno', 'plat' => 'Podle platformy', 'plat_det' => 'Podle platformy (detail)', 'br' => 'Podle prohlížeče', 'br_det' => 'Podle prohlížeče (detail)', 'eng' => 'Podle engine' ); $encods = array( 'all' => 'Obě kódování', 'windows-1250' => 'Windows-1250', 'utf-8' => 'Unicode (UTF-8)' ); echo "

Výsledky testu

\n"; echo "
\n"; if (!$what) $what = 'all'; if (!$encoding) $encoding = 'all'; $title = "$names[$what] ($encods[$encoding])"; echo "

\n"; echo " \n"; echo "

\n"; echo "
\n"; $lines = file('results.dta'); $cnt = count($lines); $arr = array(); for ($i=0;$i<$cnt;$i++) { $d = explode("\t",chop($lines[$i])); $a = null; $a['encod'] = $d[0]; for ($j=0; $j$title\n"; echo "

Celkem testů: $cnt

"; $fcnt = count($fonts); for ($i=0; $i<$fcnt; $i++) { $fnt = $fonts[$i]; $item = $arr[$fnt]; echo ""; echo "\n"; $sum = array(); while ( list($k,$v) = each($item) ) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $cnt = $v['TXT-OK'] + $v['TXT-ERR']; $r1 = ($cnt) ? round($v['TXT-OK']/$cnt*100) : 0; $r2 = 100-$r1; $class = 'txtnull'; if ($r2>3) $class = 'txterr'; elseif ($r2<2) $class = 'txtok'; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $sum[1] += $v['TXT-OK']; $sum[2] += $v['TXT-ERR']; $sum[3] += $v['FNT-OK']; $sum[4] += $v['FNT-SUBST']; $sum[5] += $v['FNT-MIX']; $sum[6] += $v['FNT-FALSE']; } echo "\n"; echo "\n"; for ($ii=1;$ii<=6;$ii++) echo ""; echo "\n"; echo "
$fnt
$kČitelný textPoužité písmo
ANONEoksubst.mixignor.
$r1 %
(".$v['TXT-OK'].")
$r2 %
(".$v['TXT-ERR'].")
".$v['FNT-OK']."".$v['FNT-SUBST']."".$v['FNT-MIX']."".$v['FNT-FALSE']."
Celkem".$sum[$ii]."
\n\n"; } function sumarize(&$arr, $by) { global $fonts, $encoding; $default = array( 'TXT-OK' => 0, 'TXT-ERR' => 0, 'FNT-OK' => 0, 'FNT-SUBST' => 0, 'FNT-MIX' => 0, 'FNT-FALSE' => 0 ); $out = array(); $cnt = count($arr); for ($i=0; $i<$cnt; $i++) { $a = $arr[$i]; if ( $encoding!='all' && $a['encod']!=$encoding ) continue; $k = ($by && $by!='all') ? $a[$by] : 'all'; reset($fonts); while ( list(,$fnt) = each ($fonts) ) { if (!$out[$fnt][$k]) $out[$fnt][$k] = $default; $out[$fnt][$k]['TXT-'.$a[$fnt]['TXT']]++; $out[$fnt][$k]['FNT-'.$a[$fnt]['FNT']]++; } } reset($fonts); while ( list(,$fnt) = each ($fonts) ) { ksort($out[$fnt]); } return $out; } function browserID($agent, &$platform, &$platformdet, &$browser, &$browser_det, &$engine) { // find operating system $platform = '[neznámý OS]'; $platformdet = ''; $browser = '[neznámý browser]'; $version = '???'; if (eregi("win", $agent)) { $platform = "Windows"; if (eregi('windows 95',$agent) || eregi('win95',$agent)) $platformdet = 'Win95'; elseif (eregi('windows 98',$agent) || eregi('win98',$agent)) $platformdet = 'Win98'; elseif (eregi('windows 2000',$agent)) $platformdet = 'Win2k'; elseif (eregi('windows NT 4',$agent)) $platformdet = 'WinNT4'; elseif (eregi('windows NT [5-9]',$agent) || eregi('windows xp',$agent)) $platformdet = 'WinXP'; } elseif (eregi("mac", $agent)) $platform = "MacOS"; elseif (eregi("linux", $agent)) $platform = "Linux"; elseif (eregi("unix", $agent)) $platform = "Unix"; elseif (eregi("OS/2", $agent)) $platform = "OS/2"; if (!$platformdet) $platformdet = $platform; // test for Opera if (eregi("opera",$agent)) { $val = stristr($agent, "opera"); if (eregi("/", $val)) { $val = explode("/",$val); $browser = $val[0]; $val = explode(" ",$val[1]); $version = $val[0]; } else { $val = explode(" ",stristr($val,"opera")); $browser = $val[0]; $version = $val[1]; } } // test for WebTV elseif(eregi("webtv",$agent)) { $val = explode("/",stristr($agent,"webtv")); $browser = $val[0]; $version = $val[1]; } // test for MS Internet Explorer version 1 elseif(eregi("microsoft internet explorer", $agent)) { $browser = "MSIE"; $version = "1.0"; $var = stristr($agent, "/"); if (ereg("308|425|426|474|0b1", $var)) $version = "1.5"; } // test for MS Internet Explorer elseif(eregi("msie",$agent) && !eregi("opera",$agent)) { $val = explode(" ",stristr($agent,"msie")); $browser = $val[0]; $version = $val[1]; } // test for MS Pocket Internet Explorer elseif(eregi("mspie",$agent) || eregi('pocket', $agent)) { $val = explode(" ",stristr($agent,"mspie")); $browser = "MSPIE"; $platform = "WindowsCE"; if (eregi("mspie", $agent)) $version = $val[1]; else { $val = explode("/",$agent); $version = $val[1]; } } // test for Galeon elseif(eregi("galeon",$agent)) { $val = explode(" ",stristr($agent,"galeon")); $val = explode("/",$val[0]); $browser = $val[0]; $version = $val[1]; } // test for Konqueror elseif(eregi("Konqueror",$agent)) { $val = explode(" ",stristr($agent,"Konqueror")); $val = explode("/",$val[0]); $browser = $val[0]; $version = $val[1]; } // test for iCab elseif(eregi("icab",$agent)) { $val = explode(" ",stristr($agent,"icab")); $browser = $val[0]; $version = $val[1]; } // test for Safari elseif(eregi("safari", $agent)){ $browser = "Safari"; $val = explode("/",stristr($agent,"safari")); $val = explode(" ", $val[1]); $version = $val[0]; } // test for Camino elseif(eregi("camino", $agent)){ $browser = "Camino"; $val = explode("/",stristr($agent,"safari")); $val = explode(" ", $val[1]); $version = $val[0]; } // test for Mozilla Alpha/Beta Versions elseif( eregi("mozilla",$agent) && eregi("rv:[0-9].[0-9][a-b]",$agent) && !eregi("netscape",$agent)) { $browser = "Mozilla"; eregi("rv:[0-9].[0-9][a-b]",$agent,$val); $version = str_replace("rv:","",$val[0]); } // test for Mozilla Stable Versions elseif( eregi("mozilla",$agent) && eregi("rv:[0-9]\.[0-9]\.[0-9]",$agent) && !eregi("netscape",$agent)) { $browser = "Mozilla"; eregi("rv:[0-9]\.[0-9]\.[0-9]",$agent,$val); $version = str_replace("rv:","",$val[0]); } // test for Lynx & Amaya elseif(eregi("libwww", $agent)) { if (eregi("amaya", $agent)) { $val = explode("/",stristr($agent,"amaya")); $browser = "Amaya"; $val = explode(" ", $val[1]); $version = $val[0]; } else { $val = explode("/",$agent); $browser = "Lynx"; $version = $val[1]; } } // remaining two tests are for Netscape elseif(eregi("netscape",$agent)) { $val = explode(" ",stristr($agent,"netscape")); $val = explode("/",$val[0]); $browser = $val[0]; $version = $val[1]; } elseif(eregi("mozilla",$agent) && !eregi("rv:[0-9]\.[0-9]\.[0-9]",$agent)) { $val = explode(" ",stristr($agent,"mozilla")); $val = explode("/",$val[0]); $browser = "Netscape"; $version = $val[1]; } $engine = 'Other'; if(eregi("Gecko",$agent)) $engine = 'Gecko'; elseif($browser=='Netscape') $engine = 'NN'; elseif(eregi("khtml",$agent) || $browser=='Konqueror') $engine = 'KHTML'; elseif($browser=='MSIE' && $platform=='Windows') $engine = 'MSIE'; elseif($browser=='MSIE' && $platform=='MacOS') $engine = 'Tazman (MacIE)'; elseif($browser=='Opera') $engine = 'Opera'; // clean up extraneous garbage that may be in the name // $browser = ereg_replace("[^a-z,A-Z\?]", "", $browser); // clean up extraneous garbage that may be in the version $version = ereg_replace("[^0-9,.\?]", "", $version); $browser_det = $browser . " " . $version; } ?>