File size: 2.01Kb
<?php
/*********************************************************************/
#---------------------------KokirCMS Соц сети-------------------------#
#---------------------Kiriyan и kokir Сайт kiriyan.org----------------#
#-------------------------------2012 г.-------------------------------#
#------------------Связь ICQ 455002004. [email protected]#
#----------------------------Пример ewwap.ru--------------------------#
/*********************************************************************/
$noDelChatOnline = TRUE;
$title = 'Онлафн в чате';
require('../inc/head.php');
$id = FALSE;
if(!empty($_GET['id']) && ctype_digit($_GET['id']))
$id = $_GET['id'];
if($id)
{
$room = mysql_fetch_array(mysql_query("SELECT * FROM `chat_rooms` WHERE `id` = $id;"));
if(!$room)
$id = FALSE;
}
echo '<div class="caption"><a href="index.php">Чат</a>' . ($room ? ' » <a href="room.php?id=' . $id . '">' . $room['caption'] . '</a>' : '') . ' » Кто онлайн</div>';
$total = mysql_num_rows(mysql_query("SELECT * FROM `chat_online` WHERE " . ($id ? "`room` = $id" : "1") . ";"));
if($total)
{
$query = mysql_query("SELECT * FROM `chat_online` WHERE " . ($id ? "`room` = $id" : "1") . ";");
while($u = mysql_fetch_array($query))
{
echo '<div class="post">';
echo userInfo($u['user']);
if(!$id)
{
echo '<div class="sub">';
if($u['room'] > 0)
{
$r = mysql_fetch_array(mysql_query("SELECT * FROM `chat_rooms` WHERE `id` = " . $u['room'] . ";"));
echo 'В комнате: <a href="room.php?id=' . $r['id'] . '">' . $r['caption'] . '</a>';
}
else
echo '<a href="index.php">Выбирает комнату</a>';
echo '</div>';
}
echo '</div>';
}
echo '<div class="caption">Всего: ' . $total . '</div>';
}
else
echo '<div class="menu big-block">Никого нету</div>';
require('../inc/end.php');
?>