Файл: chat/index.php
Строк: 19
<?php
require '../sid.php';
require '../config.php';
$link = connect_db();
if (!empty($_SESSION['us'])) {
list($user, $id, $ps) = check_login($link);
whorm($rm, 'room');
}
include '../head.php';
include '../navigator.php';
echo $div_title . 'Чат ' . $site . $div_end;
echo $div_aut . '<a href="../faq.php?do=chat">Правила Чата</a>' . $div_end;
$result = mysql_query("SELECT `rooms`.*,(SELECT COUNT(*) FROM `users` WHERE `users`.`room` = CONCAT('room', `rooms`.`id`) AND `users`.`onl` + '200' > '" . time() . "') AS c FROM `rooms` ORDER BY `rooms`.`pos` ASC");
$dv = 0;
if (mysql_num_rows($result) != FALSE) {
while($sql = mysql_fetch_assoc($result)) {
echo ($dv ++ % 2) ? $div_tworazdel : $div_razdel;
echo '<a href="room.php?rm='.$sql['id'].'">' . $sql['name'] . '</a>
(<a href="whoroom.php?rm='.$sql['id'].'">' . $sql['c'] . '</a>)' . $div_end;
}
} else {
echo '<br/>Комнаты не созданы!<br/>';
}
$NumModers = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `level` = '2'"), 0);
echo $div_aut . '
<a href="../settings.php?do=chat">Настройки чата</a>
' . $div_end . '
<a href="../faq.php?do=moders_c">Модераторы</a> (' . $NumModers . ')';
include '../foot.php';
?>