Вход Регистрация
Файл: chat/whoroom.php
Строк: 55
<?php
require '../lang_inc.php';
require 
'../sid.php';
require 
'../config.php';
$link = connect_db();
list(
$user, $id, $ps) = check_login($link);
include 
'../head.php';
include 
'../navigator.php';

$open = mysql_fetch_array(mysql_query("SELECT `open_chat` FROM `setting` WHERE `ids` = '1'"));
if (
$open[0] == 0) {
   
err(''.$lang['Чат закрыт Администратором'].'!');
   include 
'../foot.php';
   exit();
}

$rm = my_int($_GET['rm']);

$empty = mysql_query("SELECT * FROM `rooms` WHERE `id` = '$rm' LIMIT 1");

if (
mysql_num_rows($empty) == FALSE) {
    
header('Location: ../index.php?lg='.$lg.'&' . $ref);
    die();
} else {
    
$inf = mysql_fetch_assoc($empty);
}

$ASnum = mysql_num_rows(mysql_query("SELECT `id` FROM `users` WHERE `room` = 'room$rm' AND `onl` + '200' > '" . time() . "' ORDER BY `onl` DESC"));

echo 
$div_left . $div_title . ''.$lang['Кто здесь'].'' . $div_end . $div_menu . '
     <a href="index.php?lg='
.$lg.'&amp;'.$ref.'">'.$lang['Комнаты'].' | </a>
     <a href="room.php?rm='
.$rm.'&amp;lg='.$lg.'">' . $inf['name'] . '</a> |
     <a href="say.php?rm='
.$rm.'&amp;lg='.$lg.'">'.$lang['Сказать'].'</a> |
     <b>'
.$lang['Кто здесь'].'(' . $ASnum . ')</b>
     ' 
. $div_end;

$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `room` = 'room$rm' AND `onl` + '200' > '" . time() . "' ORDER BY `onl` DESC"), 0);

echo 
$div_left;
if (
$count != false) {
 
$n = new navigator($count, 10, '?rm='.$rm.'&amp;lg='.$lg.'&amp;');
 
$result = mysql_query("SELECT `id` FROM `users` WHERE `room` = 'room$rm' AND `onl` + '200' > '" . time() . "' ORDER BY `onl` DESC {$n->limit}");
 
$i = 0;
  while(
$sql = mysql_fetch_assoc($result)) {
   echo (
$i ++ % 2) ? $div_tworazdel : $div_razdel;
   echo 
nikus($sql['id']) . '<br/>';
  }
  echo 
$n->navi();
 } else {
 echo 
''.$lang['Никого нет'].'!<br/>';
}

echo 
$div_end;
include 
'../foot.php';
?>
Онлайн: 1
Реклама