Do NOT remove any of the copyright notices in the script. # -> This script can not be distribuated by anyone else than the author, unless special permisson is given. # # The author is not responible if this script causes any damage to your server or computers. # $version = "2.4"; ################################# $toplevel_domains = array("ac", "ad", "ae", "af", "ag", "ai", "al", "am", "an", "ao", "aq", "ar", "as", "at", "au", "aw", "az", "ba", "bb", "bd", "be", "bf", "bg", "bh", "bi", "bj", "bm", "bn", "bo", "br", "bs", "bt", "bv", "bw", "by", "bz", "ca", "cc", "cd", "cf", "cg", "ch", "ci", "ck", "cl", "cm", "cn", "co", "cr", "cu", "cv", "cx", "cy", "cz", "de", "dj", "dk", "dm", "do", "dz", "ec", "ee", "eg", "eh", "er", "es", "et", "fi", "fj", "fk", "fm", "fo", "fr", "ga", "gd", "ge", "gf", "gg", "gh", "gi", "gl", "gm", "gn", "gp", "gq", "gr", "gs", "gt", "gu", "gw", "gy", "hk", "hm", "hn", "hr", "ht", "hu", "id", "ie", "il", "im", "in", "io", "iq", "ir", "is", "it", "je", "jm", "jo", "jp", "ke", "kg", "kh", "ki", "km", "kn", "kp", "kr", "kw", "ky", "kz", "la", "lb", "lc", "li", "lk", "lr", "ls", "lt", "lu", "lv", "ly", "ma", "mc", "md", "mg", "mh", "mk", "ml", "mm", "mn", "mo", "mp", "mq", "mr", "ms", "mt", "mu", "mv", "mw", "mx", "my", "mz", "na", "nc", "ne", "nf", "ng", "ni", "nl", "no", "np", "nr", "nu", "nz", "om", "pa", "pe", "pf", "pg", "ph", "pk", "pl", "pm", "pn", "pr", "ps", "pt", "pw", "py", "qa", "re", "ro", "ru", "rw", "sa", "sb", "sc", "sd", "se", "sg", "sh", "si", "sj", "sk", "sl", "sm", "sn", "so", "sr", "st", "sv", "sy", "sz", "tc", "td", "tf", "tg", "th", "tj", "tk", "tm", "tn", "to", "tp", "tr", "tt", "tv", "tw", "tz", "ua", "ug", "uk", "um", "us", "uy", "uz", "va", "vc", "ve", "vg", "vi", "vn", "vu", "wf", "ws", "ye", "yt", "yu", "za", "zm", "zr", "zw"); ################################# $start = microtime(); include("config.php"); require("functions.php"); if(!isset($action)) { if(isset($_GET['action'])) { $action=$_GET['action']; } elseif(isset($HTTP_GET_VARS['action'])) { $action=$HTTP_GET_VARS['action']; } else { $action="main"; } } if($action=="phpinfo") { die("Nope"); } //session_start(); ##login $login_user = new validate_user; if ($action == "login" && $confirm == "yes") { if ($login_user->validate_passwd($pass) == 1) { $login_user->make_user_loged_in(); $is_loged_in="1"; } } function main() { global $admin_pass, $lang_summary, $version; global $is_loged_in; global $use_pass; global $log_last_resett; global $server_url; global $max_log_size; $all_uniqe_ips = array(); $yall_uniqe_ips = array(); $tall_uniqe_ips = array(); $all_stats = file ("logs/stats.txt"); $visits_today = 0; $visits_yesterday = 0; $unike_today = 0; $visits_this_month = 0; $visits_last_month = 0; $current_month = date("n"); $current_day = date("j"); $current_year = date("Y"); $unike_ips = 0; $unike_ip_today = 0; $total_hits = 0; $unike_ip_yesterday = 0; $start_time=@file("logs/reset_time.txt"); $this_time=time(); $days_since_first=($this_time-$start_time[0]) / 86400; $days_since_first_arr=explode(".", $days_since_first); $days_since_first=$days_since_first_arr[0]; $new_yesterday = time()-86400; $last_day = date("j","$new_yesterday"); $yesterdays_month = date("n","$new_yesterday"); $that_year = date("Y","$new_yesterday"); while (list ($key, $val) = each ($all_stats)) { $tosplit = "|"; $contarr = explode($tosplit,$val); $hour = $contarr[0]; $day = $contarr[1]; $month = $contarr[2]; $year = $contarr[3]; $reffer = $contarr[4]; $browser = $contarr[5]; $vistors_ip = $contarr[6]; if ($day == $current_day && $month == $current_month && $year == $current_year) { $visits_today++; if(!isset($all_uniqe_ips[$vistors_ip])) { $unike_ip_today++; $all_uniqe_ips[$vistors_ip]="$visitors_ip"; } } if ($day == $last_day && $month == $yesterdays_month && $year == $that_year) {$visits_yesterday++; if(!isset($yall_uniqe_ips[$vistors_ip])) { $unike_ip_yesterday++; $yall_uniqe_ips[$vistors_ip]="1"; } } if (!isset($tall_uniqe_ips[$vistors_ip])) { $tall_uniqe_ips[$vistors_ip]="1"; $unike_ips++; } $total_hits++; } echo"
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $average_hits=$total_hits/$days_since_first; $average_unike=$unike_ips/$days_since_first; $average_unike=round($average_unike,1); $average_hits=round($average_hits,1); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo"
$lang_summary[0]
$lang_summary[3]$visits_today
$lang_summary[4]$unike_ip_today
$lang_summary[1]
$lang_summary[3]$visits_yesterday
$lang_summary[4]$unike_ip_yesterday
Media Giornaliera
$lang_summary[3]$average_hits
$lang_summary[4]$average_unike
$lang_summary[2]
$lang_summary[3]$total_hits
$lang_summary[4]$unike_ips
"; $log_file_size = filesize("logs/stats.txt"); echo "$lang_summary[5] $log_file_size $lang_summary[6] $max_log_size $lang_summary[7]"; echo""; $handle=opendir('language'); while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $filnavn = explode(".",$file); if($filnavn[1] == "lang"){ $lang=explode("_", $filnavn[0]); echo""; } } } closedir($handle); echo""; /*$latestversion = @file("http://www.xqus.com/x-stat/latestversion.txt"); if($latestversion[0] > $version) { echo"$lang_summary[10]
»x-stat homepage"; }*/ echo"
"; } ## slutt main ## start browser_os function browser_os() { global $admin_pass, $lang_browser_os; global $is_loged_in; global $use_pass; global $log_last_resett; global $server_url; global $max_log_size; $all_stats = file ("logs/stats.txt"); $oses = array(0,0,0,0,0,0); $os_titles = array("Windows 2000", "Windows 98", "Windows 95", "Windows NT 4.0", "Windows XP", "$lang_browser_os[2]"); $browsers = array(0,0,0,0,0,0,0,0); $browser_titles = array("Internet Explorer 6","Internet Explorer 5.5", "Internet Explorer 5", "Internet Explorer 4", "Netscpe 6.x", "Netscpe 4.x", "Opera", "$lang_browser_os[2]"); while (list ($key, $val) = each ($all_stats)) { $tosplit = "|"; $contarr = explode($tosplit,$val); $hour = $contarr[0]; $day = $contarr[1]; $month = $contarr[2]; $year = $contarr[3]; $reffer = $contarr[4]; $browser2 = $contarr[5]; $vistors_ip = $contarr[6]; $loaded = $contarr[7]; $loaded = trim ($loaded); $contarr = explode (";", $browser2); $browser = $contarr[1]; $os = $contarr[2]; $os = ereg_replace (" ", "", $os); $os = ereg_replace (")", "", $os); $browser = ereg_replace (" ", "", $browser); if (stristr($os, "Opera") === false ) {} else { $lang=explode("[", $os); $lang[1]=str_replace("]", "", $lang[1]); $os=str_replace("Opera6.0[$lang[1]]", "", $os); } if (trim($os) == "WindowsNT5.0") {$oses[0]++;} elseif (trim($os) == "Windows2000") {$oses[0]++;} elseif (trim($os) == "Windows98") {$oses[1]++;} elseif (trim($os) == "Windows95") {$oses[2]++;} elseif (trim($os) == "WindowsNT4.0") {$oses[3]++;} elseif (trim($os) == "WindowsNT5.1") {$oses[4]++;} elseif (trim($os) == "WindowsXP") {$oses[4]++;} $all_total++; if (stristr($browser2, "Opera") === false) { if (stristr($browser2, "Mozilla/4.7") === false) { if (stristr($browser2, "Mozilla/5.0") === false) { if (stristr($browser2, "MSIE 4.0") === false) { if (stristr($browser2, "MSIE 5.0") === false) { if (stristr($browser2, "MSIE 5.5") === false) { if (stristr($browser2, "MSIE 6.0") === false) { } else { $browsers[0]++; } } else { $browsers[1]++; } } else { $browsers[2]++; } } else { $browsers[3]++; } } else { $browsers[4]++; } } else { $browsers[5]++; } } else { $browsers[6]++; } } $os_total = "0"; echo""; foreach($oses as $eachos) { $os_total=$os_total+$eachos; } $oses[5] = $all_total - $os_total; echo ""; $os_nr="0"; if($os_total == 0) { $os_total = "1"; } foreach($oses as $eachos) { $width = $eachos / $os_total * 100 * 4; echo ""; $os_nr++; } $browser_total = "0"; foreach($browsers as $eachbrowser) { $browser_total = $browser_total+$eachbrowser; } echo ""; $browser_nr = "0"; $browsers[7] = $all_total - $browser_total; if($all_total == 0) { $all_total="1";} foreach($browsers as $eachbrowser) { $width = $eachbrowser / $all_total * 100 * 4; echo ""; $browser_nr++; } echo"
$lang_browser_os[0]
$os_titles[$os_nr]$eachos\"bar\"
$lang_browser_os[1]
$browser_titles[$browser_nr]$eachbrowser\"bar\"
"; } ## slutt browser_os ## start toplevel_domain function toplevel_domain() { global $admin_pass, $toplevel_domains, $lang_toplevel_domain; global $is_loged_in; global $use_pass; global $log_last_resett; global $server_url; global $max_log_size; $all_stats = file ("logs/stats.txt"); $totals=array(); $total = "0"; foreach ($toplevel_domains as $domain) { $totals[$domain] = "0"; } while (list ($key, $val) = each ($all_stats)) { $tosplit = "|"; $contarr = explode($tosplit,$val); $hour = $contarr[0]; $day = $contarr[1]; $month = $contarr[2]; $year = $contarr[3]; $reffer = $contarr[4]; $browser = $contarr[5]; $vistors_ip = $contarr[6]; $loaded = $contarr[7]; $hostmask = $contarr[8]; $hostmask = trim ($hostmask); $jalla = explode(".","$hostmask"); $topdomain = $jalla[sizeof($jalla) -1]; foreach ($toplevel_domains as $domain) { if($domain == $topdomain){ $totals[$domain]++; $total++; } } } echo"$lang_toplevel_domain[0]
$lang_toplevel_domain[1]"; echo""; if($total == 0) { $total=1; } natsort($totals); $totals = array_reverse($totals); while (list ($key, $val) = each ($totals)) { $width = $totals[$key] / $total * 100 * 4; if($totals[$key] > "0") { echo ""; } } echo"
$key$totals[$key]\"Bar\"


LEGENDA
"; include("domini.php"); } ## slutt toplevel_domain ## start last50_hosts function last50_hosts() { $get=new main_log; $get->get_last_hosts("50"); } ## slutt last50_hosts ## start uniqe_hosts function uniqe_hosts() { global $admin_pass, $lang_uniqe_hosts; global $is_loged_in; global $use_pass; global $log_last_resett; global $server_url; global $max_log_size; $all_stats = file ("logs/stats.txt"); $all_stats = array_reverse($all_stats); echo"$lang_uniqe_hosts[0]
$lang_uniqe_hosts[1]

"; $hosmasks = array(); while (list ($key, $val) = each ($all_stats)) { $tosplit = "|"; $contarr = explode($tosplit,$val); $hour = $contarr[0]; $day = $contarr[1]; $month = $contarr[2]; $year = $contarr[3]; $reffer = $contarr[4]; $browser = $contarr[5]; $vistors_ip = $contarr[6]; $loaded = $contarr[7]; $hostmask = $contarr[8]; $hostmask = trim ($hostmask); if(!isset($hosmasks[$hostmask])) { echo "$hostmask
"; $hosmasks[$hostmask] = "1"; } } } ## slutt uniqe_hosts ## start login function login() { global $admin_pass, $lang_login; global $is_loged_in; global $use_pass; global $pass; global $confirm; global $log_last_resett; global $server_url; global $max_log_size; if ($is_loged_in == "1") { echo "$lang_login[0]"; main(); } else { echo"
$lang_login[1]"; } } ## slutt login ## start monthly function monthly() { global $admin_pass, $lang_monthly; global $is_loged_in; global $use_pass; global $log_last_resett; global $server_url; global $max_log_size, $show_year; $all_stats = file ("logs/stats.txt"); $m1 = 0; $m2 = 0; $m3 = 0; $m4 = 0; $m5 = 0; $m6 = 0; $m7 = 0; $m8 = 0; $m9 = 0; $m10 = 0; $m11 = 0; $m12 = 0; if(!isset($show_year)) { $current_year = date("Y");} else { $current_year = $show_year;} while (list ($key, $val) = each ($all_stats)) { $tosplit = "|"; $contarr = explode($tosplit,$val); $hour = $contarr[0]; $day = $contarr[1]; $month = $contarr[2]; $year = $contarr[3]; $reffer = $contarr[4]; $browser = $contarr[5]; $vistors_ip = $contarr[6]; $loaded = $contarr[7]; $loaded = trim ($loaded); if ($month == 1 && $year == $current_year) { $m1++; } if ($month == 2 && $year == $current_year) { $m2++; } if ($month == 3 && $year == $current_year) { $m3++; } if ($month == 4 && $year == $current_year) { $m4++; } if ($month == 5 && $year == $current_year) { $m5++; } if ($month == 6 && $year == $current_year) { $m6++; } if ($month == 7 && $year == $current_year) { $m7++; } if ($month == 8 && $year == $current_year) { $m8++; } if ($month == 9 && $year == $current_year) { $m9++; } if ($month == 10 && $year == $current_year) { $m10++; } if ($month == 11 && $year == $current_year) { $m11++; } if ($month == 12 && $year == $current_year) { $m12++; } } $old_monthly = file("logs/monthly.log"); foreach($old_monthly as $year) { $line_arr = explode("|", $year); if($line_arr[0] == $current_year) { $m1=$m1+$line_arr[1]; $m2=$m2+$line_arr[2]; $m3=$m3+$line_arr[3]; $m4=$m4+$line_arr[4]; $m5=$m5+$line_arr[5]; $m6=$m6+$line_arr[6]; $m7=$m7+$line_arr[7]; $m8=$m8+$line_arr[8]; $m9=$m9+$line_arr[9]; $m10=$m10+$line_arr[10]; $m11=$m11+$line_arr[11]; $m12=$m12+$line_arr[12]; } } echo"
"; echo"$lang_monthly[0]$current_year
"; echo"$lang_monthly[1]

"; echo"$lang_monthly[2]"; echo"

"; $total = $m1 + $m2 + $m3 + $m4 + $m5 + $m6 + $m7 + $m8 + $m9 + $m10 + $m11 + $m12 ; if($total > 0) { $mb1 = $m1 / $total * 100 * 4; $mb2 = $m2 / $total * 100 * 4; $mb3 = $m3 / $total * 100 * 4; $mb4 = $m4 / $total * 100 * 4; $mb5 = $m5 / $total * 100 * 4; $mb6 = $m6 / $total * 100 * 4; $mb7 = $m7 / $total * 100 * 4; $mb8 = $m8 / $total * 100 * 4; $mb9 = $m9 / $total * 100 * 4; $mb10 = $m10 / $total * 100 * 4; $mb11 = $m11 / $total * 100 * 4; $mb12 = $m12 / $total * 100 * 4; echo""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo"
$lang_monthly[3]$m1\"Bar\"
$lang_monthly[4]$m2\"Bar\"
$lang_monthly[5]$m3\"Bar\"
$lang_monthly[6]$m4\"Bar\"
$lang_monthly[7]$m5\"Bar\"
$lang_monthly[8]$m6\"Bar\"
$lang_monthly[9]$m7\"Bar\"
$lang_monthly[10]$m8\"Bar\"
$lang_monthly[11]$m9\"Bar\"
$lang_monthly[12]$m10\"Bar\"
$lang_monthly[13]$m11\"Bar\"
$lang_monthly[14]$m12\"Bar\"
"; } else { echo"No hits in year $current_year

"; } } ## slutt monthly ## start query function query() { global $admin_pass, $lang_query; global $is_loged_in; global $use_pass; global $log_last_resett; global $server_url; global $max_log_size; $all_stats = file ("logs/stats.txt"); $total = 0; while (list ($key, $val) = each ($all_stats)) { $tosplit = "|"; $contarr = explode($tosplit,$val); $hour = $contarr[0]; $day = $contarr[1]; $month = $contarr[2]; $year = $contarr[3]; $reffer = $contarr[4]; $browser = $contarr[5]; $vistors_ip = $contarr[6]; $loaded = $contarr[7]; $hostmask = $contarr[8]; $hostmask = trim ($hostmask); if (strpos($reffer, "google.com/search?q") == false) { } else { $google[] = "$reffer"; } } if ($engine == "google") { $splitat = "q="; } while (list ($nr, $search) = each ($$engine)) { $jatta = explode($splitat,$search); if ($keyword[$jatta[1]]) { $keyword[$jatta[1]]++; } else { $keyword[$jatta[1]] = 1; } $total++; } echo ""; $dings = 0; while (list ($nr1, $key) = each ($keyword)) { $dings++; $graph[$dings] = $key / $total * 100 * 4; echo ""; } echo "
$nr1$key\"Bar\"
"; } ## slutt query ## start resett function resett() { global $admin_pass, $show_public, $want_monthly_log, $lang_reset; global $is_loged_in; global $use_pass; global $confirm; global $log_last_resett; global $server_url; global $max_log_size; global $pass; if (isset($confirm)) {} else { $confirm = "no"; } if ($confirm == "yes") { if ($pass == $admin_pass) { if ($want_monthly_log == "1") { gen_monthly_log(); } $new_stat = fopen ("logs/stats.txt", "w"); flock($new_stat, 2); // Write lock fclose ($new_stat); $new_time = fopen("logs/reset_time.txt", w); flock($new_time, 2); // Write lock fwrite($new_time, time()); fclose($new_time); echo"$lang_reset[4]"; } else { echo"$lang_reset[5]"; } } else { echo "$lang_reset[0]
$lang_reset[1]"; if($want_monthly_log == "1") { echo"$lang_reset[2]"; } echo".
$lang_reset[3]
"; echo "

"; } } ## slutt resett ## start search_engines function search_engines() { global $admin_pass, $lang_search_engines; global $is_loged_in; global $use_pass; global $log_last_resett; global $server_url; global $max_log_size; $all_stats = file ("logs/stats.txt"); $kvasir = 0; $google = 0; $yahoo = 0; $hotbot = 0; $altavista = 0; $alltheweb = 0; while (list ($key, $val) = each ($all_stats)) { $tosplit = "|"; $contarr = explode($tosplit,$val); $hour = $contarr[0]; $day = $contarr[1]; $month = $contarr[2]; $year = $contarr[3]; $reffer = $contarr[4]; $browser = $contarr[5]; $vistors_ip = $contarr[6]; $loaded = $contarr[7]; $hostmask = $contarr[8]; $hostmask = trim ($hostmask); if (strpos($reffer, "kvasir") == false) { if (strpos($reffer, "google.com/search?q=") == false) { if (strpos($reffer, "google.yahoo.com") == false) { if (strpos($reffer, "hotbot") == false) { if (strpos($reffer, "altavista") == false) { if (strpos($reffer, "alltheweb") == false) { } else { $alltheweb++; } } else { $altavista++; } } else { $hotbot++; } } else { $yahoo++; } } else { $google++; } } else { $kvasir++; } } echo"$lang_search_engines[0]
$lang_search_engines[1]"; echo""; if($kvasir > 0) { echo ""; } if($google > 0) { echo ""; } if($yahoo > 0) { echo ""; } if($hotbot > 0) { echo ""; } if($altavista > 0) { echo ""; } if($alltheweb > 0) { echo ""; } echo"
Kvasir:$kvasir
Google:$google
Yahoo:$yahoo
HotBot:$hotbot
Altavista:$altavista
Alltheweb:$alltheweb
"; } ## slutt search_engines ## start top10_pages function top10_pages() { global $admin_pass, $lang_top10_pages,$show,$logg_val,$action,$num_of; global $is_loged_in; global $use_pass; global $log_last_resett; global $server_url; global $max_log_size; if(!isset($num_of) || $num_of == "") { $num_of=10; } $file = new file_edit; $file->get_main_log(); echo"$lang_top10_pages[0]
$lang_top10_pages[1]
"; $echo = new show_stuff; $echo->show_display_what($action,1); echo""; while (list ($key, $val) = each ($logg_val)) { $tosplit = "|"; $contarr = explode($tosplit,$val); $hour = $contarr[0]; $day = $contarr[1]; $month = $contarr[2]; $year = $contarr[3]; $reffer = $contarr[4]; $browser = $contarr[5]; $vistors_ip = $contarr[6]; $loaded = $contarr[7]; $loaded = trim ($loaded); $loaded = str_replace("http://www.", "http://", $loaded); $siste_tegn = substr("$loaded", -1); if($siste_tegn == "/") { $loaded = substr("$loaded", 0, strlen($loaded)-1); } $sites = array(); if (isset($site[$loaded])) { $site[$loaded]++; } else { $site[$loaded] = 1; } $top_sites[$loaded] = "$site[$loaded]|$loaded"; } natsort ($top_sites); $top_sites = array_reverse ($top_sites); $numer_of = 0; while (list ($nr, $top_sites_db) = each ($top_sites)) { if ($numer_of < $num_of) { $tosplit = "|"; $contarr = explode($tosplit,$top_sites_db); $hits = $contarr[0]; $url = $contarr[1]; echo ""; } $numer_of++; } echo"
$url:$hits
"; } ## slutt top10_pages ## start top10_reffers function top10_reffers() { global $admin_pass, $lang_top10_reffers,$logg_val,$action,$num_of; global $is_loged_in; global $use_pass; global $log_last_resett; global $server_url; global $max_log_size; echo"$lang_top10_reffers[1]

"; echo""; $file = new file_edit; $file->get_main_log(); $echo = new show_stuff; $echo->show_display_what($action,1); while (list ($key, $val) = each ($logg_val)) { $tosplit = "|"; $contarr = explode($tosplit,$val); $hour = $contarr[0]; $day = $contarr[1]; $month = $contarr[2]; $year = $contarr[3]; $reffer = $contarr[4]; $browser = $contarr[5]; $vistors_ip = $contarr[6]; $reffer = trim ($reffer); if(!isset($num_of) || $num_of == "") { $num_of = 10; } if (isset($ref[$reffer])) { $ref[$reffer]++; } else { $ref[$reffer] = 1; } $reff[$reffer] = "$ref[$reffer]|$reffer"; } natsort ($reff); $reff = array_reverse ($reff); $numer_of = 0; while (list ($nr, $top_reffers_db) = each ($reff)) { if ($numer_of < $num_of) { $tosplit = "|"; $contarr = explode($tosplit,$top_reffers_db); $hits = $contarr[0]; $url = $contarr[1]; if (strpos($url, $server_url) === false) { $numer_of++; if (strlen($url) > 40) { $url2 = substr("$url",0, 40); $url_to_show = "$url2..."; } else { $url_to_show = $url; } echo ""; } } } echo"
$url_to_show:$hits
"; } ## slutt top10_refers ## start hourly function hourly() { global $admin_pass, $lang_hourly; global $is_loged_in; global $use_pass; global $log_last_resett; global $server_url; global $max_log_size; $total_hits = "0"; $all_stats = file ("logs/stats.txt"); echo ""; while (list ($key, $val) = each ($all_stats)) { $tosplit = "|"; $contarr = explode($tosplit,$val); $hour = $contarr[0]; $day = $contarr[1]; $month = $contarr[2]; $year = $contarr[3]; $reffer = $contarr[4]; $browser = $contarr[5]; $vistors_ip = $contarr[6]; $reffer = trim ($reffer); $total_hits++; if (isset($hours[$hour])) { $hours[$hour]++; } else { $hours[$hour] = "1"; } } ksort($hours); if($total_hits == 0) { $total_hits="0";} while (list ($time, $hits) = each ($hours)) { $width = $hits / $total_hits * 100 * 4; echo ""; } echo "
$time$hits\"Bar\"
"; } ## slutt hourly ##start daily function daily() { $last1_stmp = mktime (0,0,0,0,date("j")-1,0); $last2_stmp = mktime (0,0,0,0,date("j")-2,0); $last3_stmp = mktime (0,0,0,0,date("j")-3,0); $last4_stmp = mktime (0,0,0,0,date("j")-4,0); $last5_stmp = mktime (0,0,0,0,date("j")-5,0); $last1 = date("j","$last1_stmp"); $last2 = date("j","$last2_stmp"); $last3 = date("j","$last3_stmp"); $last4 = date("j","$last4_stmp"); $last5 = date("j","$last5_stmp"); $last_1_dayago = "0"; $last_2_dayago = "0"; $last_3_dayago = "0"; $last_4_dayago = "0"; $last_5_dayago = "0"; $today = "0"; global $admin_pass, $lang_daily; global $is_loged_in; global $use_pass; global $log_last_resett; global $server_url; global $max_log_size; $total_hits = "0"; $date_today = date("j"); $month_today = date("n"); $year_today = date("Y"); $all_stats = file ("logs/stats.txt"); echo"$lang_daily[0]

"; while (list ($key, $val) = each ($all_stats)) { $tosplit = "|"; $contarr = explode($tosplit,$val); $hour = $contarr[0]; $day = $contarr[1]; $month = $contarr[2]; $year = $contarr[3]; $reffer = $contarr[4]; $browser = $contarr[5]; $vistors_ip = $contarr[6]; $reffer = trim ($reffer); if ($day == $date_today && $month == $month_today && $year == $year_today) { $today++; } elseif ($day == $last1 && $month == $month_today && $year == $year_today) { $last_1_dayago++; } elseif ($day == $last2 && $month == $month_today && $year == $year_today) { $last_2_dayago++; } elseif ($day == $last3 && $month == $month_today && $year == $year_today) { $last_3_dayago++; } elseif ($day == $last4 && $month == $month_today && $year == $year_today) { $last_4_dayago++; } elseif ($day == $last5 && $month == $month_today && $year == $year_today) { $last_5_dayago++; } } $total = $today + $last_1_dayago + $last_2_dayago + $last_3_dayago + $last_4_dayago + $last_5_dayago; if ($total==0) { $total=1;} $width1 = $today / $total * 100 * 4; $width2 = $last_1_dayago / $total * 100 * 4; $width3 = $last_2_dayago / $total * 100 * 4; $width4 = $last_3_dayago / $total * 100 * 4; $width5 = $last_4_dayago / $total * 100 * 4; $width6 = $last_5_dayago / $total * 100 * 4; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
$lang_daily[1]$today\"Bar\"
$lang_daily[2]$last_1_dayago\"Bar\"
$lang_daily[3]$last_2_dayago\"Bar\"
$lang_daily[4]$last_3_dayago\"Bar\"
$lang_daily[5]$last_4_dayago\"Bar\"
$lang_daily[6]$last_5_dayago\"Bar\"
"; } ## slutt daily ###start refferign_sites function reffering_sites() { global $lang_reffering_sites; echo"$lang_reffering_sites[0]

$lang_reffering_sites[1]"; echo"

  $lang_reffering_sites[2]     "; echo"
  $lang_reffering_sites[3] "; echo"
  $lang_reffering_sites[4]     
"; $get = new main_log; $get->get_reffering_sites(10); } #### Slutt funksjoner! ?> x-stat
Statistiche