<?
require '../sys/inc/start.php';
require '../sys/inc/compress.php';
require '../sys/inc/sess.php';
require '../sys/inc/home.php';
require '../sys/inc/settings.php';
require '../sys/inc/db_connect.php';
require '../sys/inc/ipua.php';
require '../sys/inc/fnc.php';
require '../sys/inc/user.php';
$set['title']='Чат - Кто здесь?';
require '../sys/inc/thead.php';
title();

$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > '".(time()-100)."' AND `url` like '/chat/%'"), 0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$q = mysql_query("SELECT * FROM `user` WHERE `date_last` > '".(time()-100)."' AND `url` like '/chat/%' ORDER BY `date_last` DESC LIMIT $start, $set[p_str]");
if ($k_post==0)
{
?>
<div class='noy'>Нет никого</div>
<?
}
while ($chat = mysql_fetch_array($q))
{
if($num==1){
echo "<div class='enk_div'>\n";
$num=0;
}else{
echo "<div class='enk2_div'>\n";
$num=1;}
echo "".avatar2($chat['id'])."<br />";
echo "".on($chat['id'])."\n";
echo "".pol($chat['id'])."";
echo "<a href='/info.php?id=$chat[id]'><span style='color:$chat[ncolor]'>$chat[nick]</span></a>\n";
echo "".medal($ank['id'])."<br />";
echo "</div>\n";
}

if ($k_page>1)str("?",$k_page,$page);
require '../sys/inc/tfoot.php';
?>