Файл: who.php
Строк: 52
<?
require'includes.php';
$user['avr'] = 0;
$align='left';
$title='Кто где? '.mysql_result(query("SELECT COUNT(*) FROM `who`"),0);
aut();
head();
if (!isset($v_us['user'])) { exit('Ошибка!Вам надо авторизоваться');}
if ($ver=='xhtml')echo '<div style="margin-left:2%">';
echo '<br />';
$rooms = query("SELECT * FROM `rooms` WHERE tip = 0 ORDER BY `pos` ASC");
if(mysql_num_rows($rooms)!=0){
echo menu.'<b>Комнаты:</b>'.div;
while($room = mysql_fetch_assoc($rooms)){
if ($room['sartir']==1)echo '<a href="room?rm='.$room['rm'].'&sartir">'.$room['name'].'</a>('.mysql_result(query('SELECT COUNT(*) FROM `who` WHERE `room` = "room" and `rm` = "'.$room['rm'].'"'),0).')<br />';
else if ($room['intim']==1)echo '<a href="room?rm='.$room['rm'].'&intim">'.$room['name'].'</a>('.mysql_result(query('SELECT COUNT(*) FROM `who` WHERE `room` = "room" and `rm` = "'.$room['rm'].'"'),0).')<br />';
else if ($room['level']<=$user['level'])echo '<a href="room?rm='.$room['rm'].'">'.$room['name'].'</a>('.mysql_result(query('SELECT COUNT(*) FROM `who` WHERE `room` = "room" and `rm` = "'.$room['rm'].'"'),0).')<br />';
if (($room['intim']!=1)&&($room['inkog']!=1)){
$whos = query("SELECT * FROM `who` WHERE `room` = 'room' and `rm` = '$room[rm]' ORDER BY `time` DESC");
if(mysql_num_rows($whos)>1) $zp = ', '; else $zp = '';
while($who = mysql_fetch_assoc($whos)){
echo nik2($who['user']).$zp;
}
if(mysql_num_rows($whos)>0)echo '<br />';
}
}
}else{
echo 'Комнаты не созданны<br />';
}
echo '<dl><dt></dt></dl>';
$rooms = query("SELECT * FROM `rooms` WHERE tip = 1 ORDER BY `pos` ASC");
if(mysql_num_rows($rooms)!=0){
echo menu.'<b>Посольства:</b>'.div;
while($room = mysql_fetch_assoc($rooms)){
if ($room['sartir']==1)echo '<a href="room?rm='.$room['rm'].'&sartir">'.$room['name'].'</a>('.mysql_result(query('SELECT COUNT(*) FROM `who` WHERE `room` = "room" and `rm` = "'.$room['rm'].'"'),0).')<br />';
else if ($room['intim']==1)echo '<a href="room?rm='.$room['rm'].'&intim">'.$room['name'].'</a>('.mysql_result(query('SELECT COUNT(*) FROM `who` WHERE `room` = "room" and `rm` = "'.$room['rm'].'"'),0).')<br />';
else if ($room['level']<=$user['level'])echo '<a href="room?rm='.$room['rm'].'">'.$room['name'].'</a>('.mysql_result(query('SELECT COUNT(*) FROM `who` WHERE `room` = "room" and `rm` = "'.$room['rm'].'"'),0).')<br />';
if (($room['intim']!=1)&&($room['inkog']!=1)){
$whos = query("SELECT * FROM `who` WHERE `room` = 'room' and `rm` = '$room[rm]' ORDER BY `time` DESC");
if(mysql_num_rows($whos)>1) $zp = ', '; else $zp = '';
while($who = mysql_fetch_assoc($whos)){
echo nik2($who['user']).$zp;
}
if(mysql_num_rows($whos)>0)echo '<br />';
}
}
}
echo '<dl><dt></dt></dl>';
$whos = query("SELECT * FROM `who` WHERE `room` = 'love' ORDER BY `time` DESC");
if(mysql_num_rows($whos)>1) $zp = ', '; else $zp = '';
echo '<a href="love/">Знакомства</a> ('.mysql_num_rows($whos).')<br />';
while($who = mysql_fetch_assoc($whos)){
echo nik2($who['user']).$zp;
}
echo '<dl><dt></dt></dl>';
$whos = query("SELECT * FROM `who` WHERE `room` != 'enter' and `room` != 'room' and `room` != 'love' ORDER BY `time` DESC");
if(mysql_num_rows($whos)>1) $zp = ', '; else $zp = '';
echo '<a href="forum/">Форум</a> ('.mysql_num_rows($whos).')<br />';
while($who = mysql_fetch_assoc($whos)){
echo nik2($who['user']).$zp;
}
echo '<dl><dt></dt></dl>';
$whos = query("SELECT * FROM `who` WHERE `room` = 'enter' ORDER BY `time` DESC");
if(mysql_num_rows($whos)>1) $zp = ', '; else $zp = '';
echo '<a href="enter">В других разделах</a> ('.mysql_num_rows($whos).')<br />';
while($who = mysql_fetch_assoc($whos)){
echo nik2($who['user']).$zp;
}
if(mysql_num_rows($whos)>0)echo '<br />';
if ($ver=='xhtml')echo '</div>';
echo '<br />';
echo gb.'<a href="'.H.'enter">Прихожая</a>'.div;
foot(); // автор -=ШАХТЕР=- http://waphp.ru
?>