END; $ar_txtfiles=array(); $verz=opendir("./dat/"); while ($file = readdir ($verz)) { if(($file!=".") and ($file!="..")) { array_push($ar_txtfiles,$file); } } arsort($ar_txtfiles); foreach($ar_txtfiles as $key) { $datname=eregi_replace(".txt","",$key); $stat_urlteil=urlencode("datei=$key"); echo ""; } echo << END; } if (isset($datei)) // alles bis ende { $anzeigemonat=eregi_replace("-"," ",$datei); $anzeigemonat=eregi_replace(".txt"," ",$anzeigemonat); $anzeigemonat=eregi_replace("^[0-9]{2,2}","",$anzeigemonat); echo << Statistik - $anzeigemonat END; $width=400; echo <<
STATISTIK - Auswahl
Monatliche Daten
 
$datnameauswerten
Statistik - $anzeigemonat
Zur Monatsauswahl

Seite wird noch geladen ... bitte warten
END; $stat_seiten_url=urlencode("datei=$datei&action=seiten"); $stat_hosts_url=urlencode("datei=$datei&action=hosts"); $stat_referer_url=urlencode("datei=$datei&action=referer"); $stat_wochentag_url=urlencode("datei=$datei&action=wochentag"); $stat_stunden_url=urlencode("datei=$datei&action=stunden"); $stat_land_url=urlencode("datei=$datei&action=land"); $stat_suche_url=urlencode("datei=$datei&action=suchbegriffe"); $stat_tage_url=urlencode("datei=$datei&action=tage"); $stat_direkte_url=urlencode("datei=$datei&action=direkte"); $stat_browser_url=urlencode("datei=$datei&action=browser"); echo <<
  Tage Seiten Direkte Aufrufe Referer Suchanfragen Wochentage Stunden Hosts Länder Browser  

END; $datei="./dat/".$datei; $fp = fopen ("$datei", "r") or die("Can't open $datei"); // $zeit = filemtime($datei); // $ar_wochentag=array(); $ar_datum=array(); $ar_zeit=array(); $ar_stunde=array(); $ar_ip=array(); $ar_hosts=array(); $ar_land=array(); $ar_seiten=array(); $ar_referer=array(); $ar_direkt=array(); $ar_suchbegriffe_a=array(); $ar_einzelneworte=array(); $ar_browser=array(); $total=0; if (isset($action) AND $action=="suchbegriffe") { include ("suche.php"); exit; } while($zeile = fgets($fp,1500)) { if (!eregi("-",$zeile)) continue; //echo "$zeile
"; $daten=explode(" - ",$zeile); //echo "$daten[0]
"; $tag=explode(", ",$daten[0]); // in Tagname und datum splitten //echo "$tag[0]-$tag[1]
"; array_push($ar_wochentag,$tag[0]); array_push($ar_datum,"$tag[1]=>$tag[0]"); $tageszeit=explode(":",$daten[1]); array_push($ar_stunde,$tageszeit[0]); //array_push($ar_zeit,$daten[1]); //$datum=$daten[0]; //$zeit=$daten[1]; $ip=$daten[2]; //remote hosts $host=$daten[3]; $host=strtolower($host); if (eregi("([_a-z0-9-]*\.[a-z]{2,4}$)",$host,$regs)) { $hostname=$regs[0]; array_push($ar_hosts,$hostname); } elseif ($host=="localhost") { array_push($ar_hosts,"localhost"); } else { array_push($ar_hosts,"IP only"); } // seiten $seite=$daten[6]; if (isset($action) AND $action=="seiten") { array_push($ar_seiten,$seite); } //land //$host=$daten[3]; if (eregi("(\.[a-z]{2,4}$)",$host,$regs)) { $land=$regs[0]; $land=eregi_replace("\.","",$land); if (isset($action) and $action=="land") { array_push($ar_land,$land); } } else { $land="Land unbekannt"; if (isset($action) and $action=="land") { array_push($ar_land,"not known"); } } // referer $referer=$daten[5]; if (isset($action) AND ($action=="referer" or $action=="direkte") ) { if(($referer=="") or ($referer==" ")) { array_push($ar_referer,"no referer"); if ($action=="direkte") { array_push($ar_direkt,"$seite=>$land"); } } else { $referer=eregi_replace("(http://$yourhost/$|http://www.$yourhost/$)","./index",$referer); $referer=eregi_replace("(http://$yourhost/|http://www.$yourhost/)","./",$referer); array_push($ar_referer,$referer); } if (eregi("\?",$referer,$regsu)) { array_push($ar_suchbegriffe_a,$referer); } } // if (isset($action) AND ($action=="browser") ) { include("browsercodes.php"); foreach ($browsercode as $item => $teil2) { if (eregi("$item",$daten[4],$reg)) { //echo "$item found
"; $teil3=explode("|",$teil2); $tname=$teil3[0]; //echo "name: $tname
"; If(!empty($teil3[1])) $tversion=$reg[$teil3[1]]; else $tversion=""; //echo "version: $tversion
"; $browser=$tname.$tversion; break; } else $browser="unkown"; } array_push($ar_browser,$browser); } // $total++; } fclose($fp); //Hits pro Tag if ( (isset($action) AND $action=="tage") or (!isset($action)) ) { include("tage.php"); } //hits pro seite if (isset($action) AND $action=="seiten") { include("seiten.php"); } //referer und suchbegriffe vorarbeit if (isset($action) AND $action=="referer") // ($action=="referer" or $action=="suchbegriffe")) { $suchbegriffe=array(); $refsuche=array(); $pur_referer=array(); $refcount=0; //while(list($key, $val) = each($zaehlereferer)) foreach($ar_referer as $key) { $schritte++; // referer auf suchmaschinen untersuchen if (eregi("\?",$key,$reg)) { $purref=explode("?",$key); $purref2=eregi_replace("([_a-z0-9-]*\.[a-z]{2,4})(\/.*$)","\\1",$purref[0]); $purref2=trim($purref2); array_push($pur_referer,$purref2); $refcount++; } else { $key=eregi_replace("([_a-z0-9-]*\.[a-z]{2,4})(\/.*$)","\\1",$key); $key=trim($key); array_push($pur_referer,$key); $refcount++; } } } // ende if action // Hits pro Referer if (isset($action) AND $action=="referer") { include ("./referer.php"); } // Hits pro Wochentag if (isset($action) AND $action=="wochentag") { include("wochentag.php"); } // hits pro stunde if (isset($action) AND $action=="stunden") { include("stunden.php"); } // hosts if (isset($action) AND $action=="hosts") { include("./hosts.php"); } //$ccodes =array(); $ccodes = array( "de" => "Germany", "net" => "Network", "org" => "Non-Profit Organization", "com" => "US Commercial", "Land unbekannt" => "Land unbekannt", "ad" => "Andorra", "ae" => "United Arab Emirates", "af" => "Afghanistan", "ag" => "Antigua and Barbuda", "ai" => "Anguilla", "al" => "Albania", "am" => "Armenia", "an" => "Netherlands Antilles", "ao" => "Angola", "aq" => "Antarctica", "ar" => "Argentina", "as" => "American Samoa", "at" => "Austria", "au" => "Australia", "aw" => "Aruba", "az" => "Azerbaijan", "ba" => "Bosnia Herzegovina", "bb" => "Barbados", "bd" => "Bangladesh", "be" => "Belgium", "bf" => "Burkina Faso", "bg" => "Bulgaria", "bh" => "Bahrain", "bi" => "Burundi", "bj" => "Benin", "bm" => "Bermuda", "bn" => "Brunei Darussalam", "bo" => "Bolivia", "br" => "Brazil", "bs" => "Bahamas", "bt" => "Bhutan", "bv" => "Bouvet Island", "bw" => "Botswana", "by" => "Belarus", "bz" => "Belize", "ca" => "Canada", "cc" => "Cocos (Keeling) Islands", "cf" => "Central African Republic", "cg" => "Congo", "ch" => "Switzerland", "ci" => "Cote DIvoire", "ck" => "Cook Islands", "cl" => "Chile", "cm" => "Cameroon", "cn" => "China", "co" => "Colombia", "cr" => "Costa Rica", "cs" => "Czechoslovakia", "cu" => "Cuba", "cv" => "Cape Verde", "cx" => "Christmas Island", "cy" => "Cyprus", "cz" => "Czech Republic", "dj" => "Djibouti", "dk" => "Denmark", "dm" => "Dominica", "do" => "Dominican Republic", "dz" => "Algeria", "ec" => "Ecuador", "ee" => "Estonia", "eg" => "Egypt", "eh" => "Western Sahara", "er" => "Eritrea", "es" => "Spain", "et" => "Ethiopia", "fi" => "Finland", "fj" => "Fiji", "fk" => "Falkland Islands (Malvinas)", "fm" => "Micronesia", "fo" => "Faroe Islands", "fr" => "France", "fx" => "France (Metropolitan)", "ga" => "Gabon", "gb" => "Great Britain (UK)", "gd" => "Grenada", "ge" => "Georgia", "gf" => "French Guiana", "gh" => "Ghana", "gi" => "Gibraltar", "gl" => "Greenland", "gm" => "Gambia", "gn" => "Guinea", "gp" => "Guadeloupe", "gq" => "Equatorial Guinea", "gr" => "Greece", "gs" => "S. Georgia and S. Sandwich Islands", "gt" => "Guatemala", "gu" => "Guam", "gw" => "Guinea-Bissau", "gy" => "Guyana", "hk" => "Hong Kong", "hm" => "Heard and McDonald Islands", "hn" => "Honduras", "hr" => "Croatia (Hrvatska)", "ht" => "Haiti", "hu" => "Hungary", "id" => "Indonesia", "ie" => "Ireland", "il" => "Israel", "in" => "India", "io" => "British Indian Ocean Territory", "iq" => "Iraq", "ir" => "Iran", "is" => "Iceland", "it" => "Italy", "jm" => "Jamaica", "jo" => "Jordan", "jp" => "Japan", "ke" => "Kenya", "kg" => "Kyrgyzstan", "kh" => "Cambodia", "ki" => "Kiribati", "km" => "Comoros", "kn" => "Saint Kitts and Nevis", "kp" => "North Korea", "kr" => "South Korea", "kw" => "Kuwait", "ky" => "Cayman Islands", "kz" => "Kazakhstan", "la" => "Laos", "lb" => "Lebanon", "lc" => "Saint Lucia", "li" => "Liechtenstein", "lk" => "Sri Lanka", "lr" => "Liberia", "ls" => "Lesotho", "lt" => "Lithuania", "lu" => "Luxembourg", "lv" => "Latvia", "ly" => "Libya", "ma" => "Morocco", "mc" => "Monaco", "md" => "Moldova", "mg" => "Madagascar", "mh" => "Marshall Islands", "mk" => "Macedonia", "ml" => "Mali", "mm" => "Myanmar", "mn" => "Mongolia", "mo" => "Macau", "mp" => "Northern Mariana Islands", "mq" => "Martinique", "mr" => "Mauritania", "ms" => "Montserrat", "mt" => "Malta", "mu" => "Mauritius", "mv" => "Maldives", "mw" => "Malawi", "mx" => "Mexico", "my" => "Malaysia", "mz" => "Mozambique", "na" => "Namibia", "nc" => "New Caledonia", "ne" => "Niger", "nf" => "Norfolk Island", "ng" => "Nigeria", "ni" => "Nicaragua", "nl" => "Netherlands", "no" => "Norway", "np" => "Nepal", "nr" => "Nauru", "nt" => "Neutral Zone", "nu" => "Niue", "nz" => "New Zealand (Aotearoa)", "om" => "Oman", "pa" => "Panama", "pe" => "Peru", "pf" => "French Polynesia", "pg" => "Papua New Guinea", "ph" => "Philippines", "pk" => "Pakistan", "pl" => "Poland", "pm" => "St. Pierre and Miquelon", "pn" => "Pitcairn", "pr" => "Puerto Rico", "pt" => "Portugal", "pw" => "Palau", "py" => "Paraguay", "qa" => "Qatar", "re" => "Reunion", "ro" => "Romania", "ru" => "Russian Federation", "rw" => "Rwanda", "sa" => "Saudi Arabia", "sb" => "Solomon Islands", "sc" => "Seychelles", "sd" => "Sudan", "se" => "Sweden", "sg" => "Singapore", "sh" => "St. Helena", "si" => "Slovenia", "sj" => "Svalbard and Jan Mayen Islands", "sk" => "Slovak Republic", "sl" => "Sierra Leone", "sm" => "San Marino", "sn" => "Senegal", "so" => "Somalia", "sr" => "Suriname", "st" => "Sao Tome and Principe", "su" => "USSR (Former)", "sv" => "El Salvador", "sy" => "Syria", "sz" => "Swaziland", "tc" => "Turks and Caicos Islands", "td" => "Chad", "tf" => "French Southern Territories", "tg" => "Togo", "th" => "Thailand", "tj" => "Tajikistan", "tk" => "Tokelau", "tm" => "Turkmenistan", "tn" => "Tunisia", "to" => "Tonga", "tp" => "East Timor", "tr" => "Turkey", "tt" => "Trinidad and Tobago", "tv" => "Tuvalu", "tw" => "Taiwan", "tz" => "Tanzania", "ua" => "Ukraine", "ug" => "Uganda", "uk" => "United Kingdom", "um" => "US Minor Outlying Islands", "us" => "United States", "uy" => "Uruguay", "uz" => "Uzbekistan", "va" => "Vatican City State (Holy See)", "vc" => "Saint Vincent and the Grenadines", "ve" => "Venezuela", "vg" => "Virgin Islands (British)", "vi" => "Virgin Islands (US)", "vn" => "Vietnam", "vu" => "Vanuatu", "wf" => "Wallis and Futuna Islands", "ws" => "Samoa", "ye" => "Yemen", "yt" => "Mayotte", "yu" => "Yugoslavia", "za" => "South Africa", "zm" => "Zambia", "zr" => "Zaire", "zw" => "Zimbabwe", "edu" => "US Educational", "gov" => "US Government", "int" => "International", "mil" => "US Military", "arpa" => "Old-Style Arpanet", "nato" => "NATO Field" ); //hits pro land if (isset($action) AND $action=="land") { include("land.php"); } ////////////////////////////////////////////////////// // direkte Aufrufe if (isset($action) AND $action=="direkte") { include("direkte.php"); } // Browser if (isset($action) AND $action=="browser") { include("browser.php"); } ///////////////////////////////////////////////////// } // ende if isset $datei ?>

Copyright by B.A.