Файл: chat/index.php
Строк: 26
<?php
require '../lang_inc.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 . ''.$lang['Чат'].' ' . $site . $div_end;
echo $div_aut . '<a href="../faq.php?do=chat&lg='.$lg.'">'.$lang['Правила Чата'].'</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'].'&lg='.$lg.'">' . $sql['name'] . '</a>
(<a href="whoroom.php?rm='.$sql['id'].'&lg='.$lg.'">' . $sql['c'] . '</a>)' . $div_end;
}
} else {
echo '<br/>'.$lang['Комнаты не созданы'].'!<br/>';
}
$NumModers = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `level` = '2'"), 0);
echo $div_aut . '
<a href="../settings.php?do=chat&lg='.$lg.'">'.$lang['Настройки чата'].'</a>
' . $div_end . '
<a href="../faq.php?do=moders_c&lg='.$lg.'">'.$lang['Модераторы'].'</a> (' . $NumModers . ')';
include '../foot.php';
?>