$yyyy 年 $dd 月

\n"; echo "
\n"; ?> \n"; $cate = array ( "" => "最新".$page_def."件ずつ", "referer"=> "リンク元", "agent" => "ブラウザ別", "host" => "ホスト別", "date" => "日別", "youbi" => "曜日別", "hour" => "時間別" ); ?>

\n$w_key\n"; echo "$w_val\n"; echo "$percent%\n"; echo "\n"; echo "\n"; endwhile; } function ar_sort(){ global $count,$i,$gif,$mode; arsort($count); reset($count); while(list($w_key, $w_val) = each($count)): $percent = sprintf("%2.1f",(($w_val/$i) * 100)); $graph = (int)$percent * 4; echo "\n"; if($mode == "referer" && ereg("^http://", $w_key)): echo " $w_key\n"; else: echo "$w_key\n"; endif; echo "$w_val\n"; echo "$percent%\n"; echo "\n"; echo "\n"; endwhile; } $log = $logdir . $log; if (!file_exists($log)) die("データがありません"); $buf = @file($log); while(list($key, $val)=each($buf)): htmlspecialchars($val); list($now,$date,$host,$agent,$ref) = explode("\t", $val); switch($mode): case 'host': if($ppp): $host =eregi_replace("(.*)\.(.*\.(ad\.jp$|ne\.jp$|or\.jp$))", "*.\\2", $host); $host =eregi_replace("(.*)\.(.*\.(ac\.jp$|go\.jp$|co\.jp$))", "\\1.\\2", $host); endif; $count[$host]++; break; case 'agent': $count[$agent]++; break; case 'referer': $count[$ref]++; break; case 'date': list($k_date,$k_youbi,$suf) = explode(" ", $date); $k_date .= $youbi; $count[$k_date]++; break; case 'hour': list($p_da,$p_you,$p_time) = explode(" ", $date); list($hour,$sec) = explode(":", $p_time); $count[$hour]++; break; case 'youbi': list($t_date,$youbi,$suf) = explode(" ", $date); $count[$youbi]++; break; endswitch; $i++; endwhile; echo "Total $i Hits

"; ?> \n\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; endwhile; break; case 'hour': key_sort(); break; case 'date': key_sort(); break; default: ar_sort(); endswitch; echo "
件数 割合 グラフ
$y_val$count[$y_val]$percent%


\n"; else: ?> 日付 ホスト ブラウザ リンク元 = $end ;$c--): htmlspecialchars($lastlog[$c]); list($now,$date,$host,$agent,$ref) = explode("\t", $lastlog[$c]); if($ppp): $host =ereg_replace("(.*)\.(.*\.(ad\.jp$|ne\.jp$|or\.jp$))", "*.\\2", $host); endif; $date = substr($date, strpos($date, "/")+1); $agent = ereg_replace("Mozilla/4.0 \(compatible;", "", $agent); echo "\n"; echo "$date \n"; echo "$host \n"; echo "$agent \n"; if(eregi("^http://", $ref)): echo "$ref\n"; else: echo "$ref\n"; endif; echo "\n"; $cc++; endfor; echo "

\n\n\n"; $logday = substr(strrchr($log, "/"), 1); $prev = $page - $page_def; if($page && $prev > 0): ?> $page_def): ?>


"; endif; // end mode ?>
- LogZ v1.0 -