Файл: region_clean/whoroom.php
Строк: 150
<?
#######################################
## Mod By KoT (borispol) [76-75-072] ##
#######################################
require_once "start.php";
require_once "sid.php";
header("Cache-Control: no-cache");
if ($ver == "wml") header ("Content-type:text/vnd.wap.wml; charset=utf-8");
else header("Content-Type:text/html; charset=UTF-8");
require_once "inc.php";
$link = connect_db();
list($row, $id, $ps, $fsize1, $fsize2) = check_login($link);
require_once "version.php";
if (isset($_GET['rm'])) { $rm = $_GET['rm']; }
if (!is_numeric($rm)) { header("Location: index.php?isset=403"); die; }
$rm = intval($rm);
if ($rm == 13)
{
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>
<card id="inroom" title="Кто тут?">
<p align="center">";
} else {
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
<title>Кто тут?</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
<div align="center">";
}
echo '<b>Все скрыто =)</b><br/>';
echo $divide;
if (isset($rm)) echo "<div class = 'd1'><a href="chat.php?$ses&rm=$rm&ref=$ref">В чат</a><br/>";
echo "<a href="enter.php?$ses&ref=$ref">Прихожая</a></div>";
echo $fsize2;
include_once 'foot.php';
}
elseif ($rm != 23) {
if ($rm == 10) $takep="&pwd=$pwd&ref=$ref";
else if ($mod == "privat") $takep="&mod=$mod&ref=$ref";
else $takep="&ref=$ref";
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>
<card id="inroom" title="Кто тут?">
<p align="center">";
} else {
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
<title>Кто тут?</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
<div align="center">";
}
echo $fsize1;
$room = "room" . $rm;
$tm = time() - 100;
$res = mysql_query ("Select usid,who,hid from $room WHERE id > '".$tm."' and usid != '1' and usid != '2' and usid != '3' and usid != '4' and usid != '5' and usid != '6' and usid != '7' and usid != '8' and usid != '9' and usid != '11' group by usid order by id desc");
if (mysql_affected_rows() == 0) {
echo 'Никого нет!<br/>';
} else {
$kol = mysql_affected_rows();
$roomselect = mysql_query ("Select name from rooms where rm=$rm");
$rooms = mysql_fetch_array($roomselect);
$roomname = $rooms['name'];
echo "<div class = 'd1'><a href="chat.php?$ses&rm=$rm$takep">$roomname(".($kol)."):</a></div>---<br/>";
echo '<b>В общей:</b><br/>';
for ($k = 0; $k < $kol; $k++) {
$lines = mysql_fetch_array ($res);
$user = $lines['who'];
$hd = $lines['hid'];
$res1 = mysql_query ("Select id from users WHERE user='".$user."'");
$lines1 = mysql_fetch_array ($res1);
$nk = $lines1['id'];
if ($hd != 1) echo "<a href="inside.php?$ses&rm=$rm&nk=$nk&ref=$ref">".col_n($user)."</a>";
elseif ($row['level'] > 6) echo "<a href="inside.php?$ses&rm=$rm&nk=$nk&ref=$ref">".col_n($user)."(!)</a>";
if (($k+1) != $kol) echo ', ';
}
if ($kol > 0) echo '<br/>';
unset($lines);
unset($lines1);
}
echo $divide;
if (isset($rm)) echo "<div class = 'd1'><a href="chat.php?$ses&rm=$rm&ref=$ref">В чат</a><br/>";
echo "<a href="enter.php?$ses&ref=$ref">Прихожая</a></div>";
echo $fsize2;
include_once 'foot.php';
} else {
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>n
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n
<card id="who" title="Кто тут?">n
<p>n";
} else {
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
<title>Кто тут?</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
<div align="left">";
}
echo $fsize1;
$rmaf = "room" . $rm;
$ringame = "ingame" . $rm;
$tm = time() - 100;
$ingame = '';
$outgame = '';
$res = mysql_query ("Select * from $rmaf WHERE id > '".$tm."' and usid != '1' and usid != '2' and usid != '3' and usid != '4' and usid != '5' and usid != '6' and usid != '7' and usid != '8' and usid != '9' and usid != '11' group by usid order by id desc");
$kol = mysql_affected_rows();
echo '<b>В игре:</b><br/>';
for ($k = 0; $k < $kol; $k++) {
$lines = mysql_fetch_array ($res);
$user = $lines['who'];
$user_id = $lines['usid'];
$r = mysql_query("select * from $ringame WHERE gamer_id = '".(int)$user_id."'");
$a = mysql_fetch_array($r);
$id_in_game = $a['id_in_game'];
if (mysql_affected_rows() != 0) $ingame = $ingame . col_n($user) . "($id_in_game), ";
else $outgame = $outgame . col_n($user) . ", ";
}
unset($lines);
echo $ingame;
echo '<br/><b>Вне игры:</b><br/>';
echo $outgame;
echo '<br/>';
echo $divide;
echo "<div class = 'd1'><a href="chat.php?$ses&rm=$rm&ref=$ref">В игру</a></div>n";
echo $fsize2;
include_once "foot.php";
}
mysql_close ($link);
?>