<?
//include_once '/sys/inc/mp3.php';
//include_once '/sys/inc/zip.php';
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';
$set['title']='Кто в чате';
include_once '../sys/inc/thead.php';
title();
aut();


$q=mysql_query("SELECT * FROM `chat_rooms` ORDER BY `pos` ASC");
while($room = mysql_fetch_assoc($q))
{
if($num==1){ 
echo "<div class='str'>"; 
$num=0;
}else{ 
echo "<div class='news'>"; 
$num=1;}
echo "<a href='/chat/room/$room[id]/".rand(1000,9999)."/'>$room[name] (".mysql_result(mysql_query("SELECT COUNT(*) FROM `chat_who` WHERE `room` = '$room[id]'"),0).")</a><br />\n";


$sql = mysql_query("SELECT `id_user` FROM `chat_who` WHERE `room` = '$room[id]'");
if ($sql==0){echo "Никого нет\n";}

while($us = mysql_fetch_assoc($sql))
{
$login=mysql_fetch_array(mysql_query("select `nick`,`pol`,`ncolor` from `user` where `id`='".$us['id_user']."' limit 1;"));

echo "<span style=\"color:$login[ncolor]\">$login[nick],</span> ";
}


echo "</div>"; 
}

include_once '../sys/inc/tfoot.php';
?>