Файл: vk.com_vhllam/klan/who_chat.php
Строк: 52
<?
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';
echo 'Сейчас в комнате: ';
$uss = mysql_fetch_array(mysql_query("SELECT * FROM `clan_user` WHERE `id_user` = '$user[id]' LIMIT 1"));
$clan = mysql_fetch_array(mysql_query("SELECT * FROM `clan` WHERE `id` = '$uss[id_clan]' LIMIT 1"));
mysql_query("UPDATE `clan_chat` SET `date_last` = ".time()." WHERE `id_user` = '$user[id]' LIMIT 1");
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `clan_chat` WHERE `date_last` > '".(time()-600)."'"), 0);
$k_page=k_page($k_post,100);
$page=page($k_page);
$start=100*$page-100;
$q = mysql_query("SELECT `id_user` FROM `clan_chat` WHERE `id_clan` = '$clan[id]' AND `date_last` > '".(time()-600)."' ORDER BY `date_last` DESC LIMIT $start, 100");
if ($k_post==0)
{
echo "В чате никого нетn";
}
while ($uss = mysql_fetch_array($q))
{
$login=mysql_fetch_array(mysql_query("SELECT `nick`,`pol`,`ncolor` FROM `user` WHERE `id`='".$uss['id_user']."' LIMIT 1;"));
echo "<a href='/info.php?id=$uss[id_user]'><span style="color:$login[ncolor]">$login[nick]</span></a>, ";
}
?>