Файл: chat/online.php
Строк: 34
<?php
require '../sys/sid.php';
require '../sys/config.php';
include '../sys/user.php';
include '../sys/head.php';
include '../sys/navigator.php';
visit(0, 'chat');
$count = mysql_result(mysql_query("SELECT COUNT(*) FROM users WHERE onl + '300' > '$rtime' AND `where` = 'chat'"), 0);
if ($count != false)
{
$n = new navigator($count, 10, '?');
$result = mysql_query("SELECT id FROM users WHERE onl + '300' > '$rtime' AND `where` = 'chat' ORDER BY onl DESC {$n->limit}");
$cols = 0;
$names = array();
echo '<div style="padding:4px; margin:2px;">';
while($sql = mysql_fetch_assoc($result))
{
if (user($sql['id'], 'level') == 1) $adm = '<span class="war">[Мд]</span>';
elseif (user($sql['id'], 'level') == 2) $adm = '<span class="war">[Адм]</span>';
else $adm = '';
++$cols;
$num = ($n->start + $cols);
$names[] = '<a href="speak_'.user($sql['id'], 'nick').'&'.mt_rand(1000, 9999).'">' . user($sql['id'], 'nick') . '</a> ' . $adm;
}
echo implode(', ', $names) . '</div>';
echo $n->navi();
} else echo '<br/>В чате никого нет!<br/>';
echo '<br/><a href="index.php">Вернуться</a>';
include '../sys/foot.php';
?>