Файл: vk.com_vhllam/chat/index.php
Строк: 163
<?
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';
/* Бан пользователя */
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `razdel` = 'chat' AND `id_user` = '$user[id]' AND (`time` > '$time' OR `view` = '0' OR `navsegda` = '1')"), 0)!=0)
{
header('Location: /ban.php?'.SID);exit;
}
if (isset($user))mysql_query("DELETE FROM `chat_who` WHERE `id_user` = '$user[id]'");
mysql_query("DELETE FROM `chat_who` WHERE `time` < '".($time-120)."'");
if (isset($user) && isset($_GET['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `chat_rooms` WHERE `id` = '".intval($_GET['id'])."'"),0)==1
&& isset($_GET['msg']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '".intval($_GET['msg'])."'"),0)==1)
{
$room=mysql_fetch_assoc(mysql_query("SELECT * FROM `chat_rooms` WHERE `id` = '".intval($_GET['id'])."' LIMIT 1"));
$ank=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = '".intval($_GET['msg'])."' LIMIT 1"));
if (isset($user))mysql_query("INSERT INTO `chat_who` (`id_user`, `time`, `room`) values('$user[id]', '$time', '$room[id]')");
if ($set['time_chat']!=0)header("Refresh: $set[time_chat]; url=/chat/room/$room[id]/".rand(1000,9999).'/'); // автообновление
$set['title']='Чат - '.$room['name'].' ['.mysql_result(mysql_query("SELECT COUNT(*) FROM `chat_who` WHERE `room` = '$room[id]'"),0).']'; // заголовок страницы
include_once '../sys/inc/thead.php';
title();
aut(); // форма авторизации
echo "<div class="mails"><a href='/info.php?id=$ank[id]'>Посмотреть анкету</a></div>n";
echo "<form method="post" action="/chat/room/$room[id]/".rand(1000,9999)."/">n";
echo "<textarea name="msg">$ank[nick], </textarea>n";
if($user['group_access'] > 1){
echo "<span class="msg"><label><input type="checkbox" name="bold" value="$user[id]" /><b>B</b></label>n";
echo "<label><input type="checkbox" name="under" value="$user[id]" /><u>U</u></label>n";
echo "<label><input type="checkbox" name="red" value="$user[id]" /><font color="#FF0000">R</font></label></span><br />n";}
echo "<label><input type="checkbox" name="privat" value="$ank[id]" /> Приватно</label><br />n";
echo "<input value="Отправить" type="submit" />n";
echo "</form>n";
echo "<div class="cont">n";
echo "«<a href="/chat/room/$room[id]/".rand(1000,9999)."/">В комнату</a><br />n";
echo "«<a href="/chat/">Прихожая</a><br />n";
echo "</div>n";
include_once '../sys/inc/tfoot.php';
}
if (isset($_GET['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `chat_rooms` WHERE `id` = '".intval($_GET['id'])."'"),0)==1)
{
$room=mysql_fetch_assoc(mysql_query("SELECT * FROM `chat_rooms` WHERE `id` = '".intval($_GET['id'])."' LIMIT 1"));
if (isset($user))mysql_query("INSERT INTO `chat_who` (`id_user`, `time`, `room`) values('$user[id]', '$time', '$room[id]')");
if ($set['time_chat']!=0)header("Refresh: $set[time_chat]; url=/chat/room/$room[id]/".rand(1000,9999).'/'); // автообновление
$set['title']='Чат - '.$room['name'].' ('.mysql_result(mysql_query("SELECT COUNT(*) FROM `chat_who` WHERE `room` = '$room[id]'"),0).')'; // заголовок страницы
include_once '../sys/inc/thead.php';
title();
aut(); // форма авторизации
include 'inc/room.php';
echo "<div class="cont">n";
echo "«<a href="/chat/">Прихожая</a><br />n";
echo "</div>n";
include_once '../sys/inc/tfoot.php';
}
$set['title']='Чат - xhata.su'; // заголовок страницы
include_once '../sys/inc/thead.php';
err();
title();
aut(); // форма авторизации
echo "<div class='kabinet'><img src='/style/icons/122.gif' alt='enk'> <a href='rulez_chat.php'>Правила чата</a></br>";
echo "<img src='/style/icons/pt.png' alt='enk'> <a href='who.php'>Кто в чате?";
echo " [<font color='red'>";
echo mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_last` > '".(time()-600)."' AND `url` like '/chat/%'"), 0).'чел.</font>]</div></a>';
include 'inc/admin_act.php';
echo "<table class='post'>n";
$num = 0;
$q=mysql_query("SELECT * FROM `chat_rooms` ORDER BY `pos` ASC");
if (mysql_num_rows($q)==0) {
echo " <tr>n";
echo " <td class='mess'>n";
echo "Нет комнатn";
echo " </td>n";
echo " </tr>n";
}
while ($room = mysql_fetch_assoc($q))
{
echo " <tr>n";
if ($set['set_show_icon']==2){
echo " <td class='icon48'>n";
echo "<img src='/style/themes/$set[set_them]/chat/48/room.png' />n";
echo " </td>n";
}
elseif ($set['set_show_icon']==1)
{
echo " <td class='icon14'>n";
echo "<img src='/style/icons/str.gif' alt='*' />";
echo " </td>n";
}
echo " <td class='p_t'>n";
echo "<a href='/chat/room/$room[id]/".rand(1000,9999)."/'>$room[name]</a> <a href='/chat/room/$room[id]/".rand(1000,9999)."/?online'>[<font color='green'>".mysql_result(mysql_query("SELECT COUNT(*) FROM `chat_who` WHERE `room` = '$room[id]'"),0)." чел.</font>]</a>n";
if (user_access('chat_room'))
echo "<a href='?set=$room[id]'><img src='/style/icons/edit.gif' alt='' /></a>n";
echo " </td>n";
echo " </tr>n";
}
echo "</table>n";
{
$k=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `group_access` = '2'"),0);
echo "<div class='admins'><img src='/style/icons/police.png'> <a href='adm.php'>Модеры Чата</a> [$k чел.]</div>n";
}
if (user_access('chat_room')){
echo "<div class="foot">n";
include 'inc/admin_form.php';
echo "</div>n";
}
include_once '../sys/inc/tfoot.php';
?>