File size: 1.52Kb
<?php
////////////////начало проверки счётчика//////////////
$ip = $_SERVER['REMOTE_ADDR'];
$times=time() + $sdvigclock*3600;
$date=date("d:m:y",$times);
$offline=60;
$count = @mysql_query("select * from `count`;");
$total = @mysql_num_rows($count);
///////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 ("<a href='../../who-where.php'>Online: $online Гостей: $guest</a><br/>");
echo (" Хиты: $hits Хосты: $hosts Всего: $total");
?>