<?
//////////////////////////////////////////
////////MADE by Green-Day ICQ 9298034 СКРИПТ ЗАПРЕЩЕНО ПЕРЕПРОДАВАТЬ,МЕНЯТЬ,РАЗДАВАТЬ.СОБЛЮДАЙТЕ АВТОРСКИЕ ПРАВА!
///////////////////////////////////////////
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 'inc/thead.php';
title();


echo "<table class='post'>\n";

$q=mysql_query("SELECT * FROM `chat_rooms` ORDER BY `pos` ASC");

if (mysql_num_rows($q)==0) {

echo "   <tr>\n";
echo "  <td class='p_t'>\n";
echo "Нет комнат\n";
echo "  </td>\n";
echo "   </tr>\n";
}

while ($room = mysql_fetch_assoc($q))
{
echo "   <tr>\n";


if ($set['set_show_icon']==2){
echo "  <td class='icon48' rowspan='2'>\n";
echo "<img src='/style/themes/$set[set_them]/chat/48/room.png' />\n";
echo "  </td>\n";
}
elseif ($set['set_show_icon']==1)
{
echo "  <td class='icon14'>\n";
echo "<img src='/style/themes/$set[set_them]/chat/48/room.png' alt='' />";
echo "  </td>\n";
}


echo "  <td class='p_t'>\n";
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>\n";
echo "  </td>\n";
echo "   </tr>\n";
echo "   <tr>\n";
if ($set['set_show_icon']==1)echo "  <td class='p_m' colspan='2'>\n"; else echo "  <td class='p_m'>\n";
$in = mysql_query("SELECT * FROM `chat_who` WHERE `room` = '$room[id]'");
while($inroom = mysql_fetch_assoc($in))
{
$login=mysql_fetch_assoc(mysql_query("SELECT `nick` FROM `user` WHERE `id`='$inroom[id_user]'"));
echo "$login[nick], ";
}
echo "  </td>\n";
echo "   </tr>\n";

}

echo "</table>\n";



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