Просмотр файла file/counter/stat.php

Размер файла: 1.79Kb
<?php
////////////////начало проверки счётчика//////////////
$ip = $_SERVER['REMOTE_ADDR'];
$times=time() + $sdvigclock*3600;
$date=date("d:m:y",$times);
$offline=60;
$count = @mysql_query("select * from `count`;");
////////clear table
    $popravka = $sdvigclock*3600;
    $hour = date("G",time() + $popravka); 
    $hour = round($hour);
    $time=date("$hour:i:s", time() + $popravka);
    $ti="00:00:00";
if ($time==$ti) {@mysql_query("TRUNCATE TABLE `count`;");} 
   ////////end clear
   ///////online
    $counthosttoday = @mysql_query("select `ip` from `count` where time>'".intval($times-$offline )."';");
    $mass=array();
    while($massivh = @mysql_fetch_array($counthosttoday))
    {
	$mass[]=$massivh[ip];
	}
    $zmass = array_unique($mass);
    $online=count($zmass);
    ///////end_of_online
    ///////hits
    $counthosttoday = @mysql_query("select `ip`,`time` from `count`;");
    $masshost=array();
    while($massivh = @mysql_fetch_array($counthosttoday))
    { $data=date("d:m:y",$massivh['time']);
     	if ($data==$date)
    	{
	  $masshost[]=$massivh['ip'];
		}
	}

    $hits=count($masshost);
        ///////end_of_hits
        ///////hosts
        $hosts = array_unique($masshost);
        $hosts=count($hosts);
        ///////end_of_hosts
//
$mass=array();
    $countguest = @mysql_query("select `ip` from `count` where time>'".intval($times-$offline )."' and name='Guest';");
        while($massivh=mysql_fetch_array($countguest))
    {
    $mass[]=$massivh[ip];
	}
    $guest = count(array_unique($mass));

  echo ("<div class='raz'>Online: [<a href='".$home."/who-where.php'>$online / $guest</a>]<br/>");
    echo ("Хосты: $hosts <br /> Хиты: $hits <br />");
    include $home.'/file/ip.php';
    echo "</div>";
 ?>