=0; $ii--) { $curfilter = $filter[$ii]; $namefilter = explode("~", $curfilter); if ($namefilter[1]) { $curfilter = $namefilter[0]; $namefilter = $namefilter[1]; } else $namefilter = $curfilter; if (stripslashes($item) == $namefilter) $hifilter=$namefilter; } } $z=""; $z2=""; $arr=""; $total=0; $filtered=0; if (rtrim ($a[0])=="") {$fr=1; } else { $fr=0; } for ($i=$fr; $i"); // FIX // if ($a[$i]=="") $i++; // if ($a[$i][0]!="/") $i++; if (is_numeric ($a[$i])) $i++; // if ($a[$i]!="/") $a[$i]=preg_replace ("/\/$/", "", $a[$i]); // $zz = $a[$i]; $zz = str_replace ("www.", "", $a[$i]); if ((stristr ($a[$i],"www.")) and (array_search ($zz, $a))) { $a[$i]=$zz; } else {$zz=$a[$i];} $arr[$zz]=$arr[$zz]+$a[$i+1]; // $i++; } @arsort ($arr); // print_r ($arr); // exit (); // print_r ($filter); if ($arr!="") foreach ($arr as $key => $value) { $total = $total+$value; $del = false; $fil = ""; if ($filter[0]!="") { for ($ii=count($filter)-1; $ii>=0; $ii--) { $curfilter = $filter[$ii]; $namefilter = explode("~", $curfilter); // print_r($namefilter); // echo "

"; if ($namefilter[1]) { $curfilter = $namefilter[0]; $namefilter = $namefilter[1]; // echo $curfilter."

"; } else $namefilter = $curfilter; if ($curfilter{0}=="/") //regexp { if (@preg_match(rtrim($curfilter), rtrim($key))) { $del = true; $fil = $namefilter; } } else //stristr if (@stristr(rtrim($key), rtrim($curfilter))) { // if ($del==false) { $filtered=$filtered+$value; } $del = true; $fil = $namefilter; } } } if ($what!="onlyfiltered") { if (!$del) $z[$key]=$value; else $z2[$fil]=$value+$z2[$fil]; //NO FILTER - HOSTS if (($filter[0]=="") and (stristr ($key, "http"))) { $tmp=parse_url (rtrim ($key)."/"); $z2[$tmp[host]]=$value+$z2[$tmp[host]]; } } else { // echo $hifilter."-".$fil."
"; if (!$item || ($del && $hifilter==$fil)) { $z[$key]=$value; // echo $a[$i]; } $z2[$fil]=$value+$z2[$fil]; } } // if ($what=="onlyfiltered") {$z3=$z2; $z2=$z; $z=$z3; } @arsort ($z, SORT_NUMERIC ); @arsort ($z2, SORT_NUMERIC ); } function fout ($z, $l=true, $max=1000000, $isip=false) { global $total, $cfile, $hosturl, $totalip, $isreport, $report, $host; // if ($cfile!="request.txt") $host=""; else $host=$hosturl; $tt=1; $out=""; if (is_array ($z)) foreach ($z as $key => $value) { if ($value==="") break; $out.=""; $tt++; if ($tt>$max) break; } $out.="
Value Hits %
".$tt.""; $key=strip_tags ($key); $k=$key; if ($l) { if (stristr ($key, "http://")) { $out.="".$key.""; } else { $out.="".$key.""; } } else // $out.=$key; $out.="$key"; $out.="".$value."".@(round ((($value/$total)*100),2))."
"; return $out; } function outt ($name, $maxr, $l=true, $isip=false) { global $isreport, $what, $filter, $cfile, $a, $z, $z2, $total, $filtered, $report, $filterfile; $filter=S_file ($filterfile); $a=S_file ($cfile); filt ($a, $filter); $out="

".$name."

". "
"; $out.= "

Filtered:
"; if (!$isreport) { $out.="[ modify filter ]  "; if ($what=="") { $out.= " [ show filtered ] "; } else { $out.= " [ hide filtered ]"; } } $out.= "

".(fout ($z2, false, $maxr, $isip)). "

Total: ".$total."
Filtered: ".$filtered." ( ".(@intval($filtered/$total*100)). "% )

Hits:


".(fout ($z, $l, $maxr, $isip))."
"; return $out; } function loggg ($file, $value) { $value=trim ($value); $fil = S_file ($file); $n=array_search ($value, $fil); if (($n!==false) and ($n!==null)) { $fil[$n+1]++; } else { $fil[]=$value; $fil[]=1; } $fullfile=implode ("\n", $fil); S_fw ($file, $fullfile); if ($n) return true; else return false; } function logg ($file, $value) { $fp = @fopen($file, "a"); fwrite($fp, $vaule."\n"); fclose($fp); } ?>