Файл: test.masteram.us/besedka/index.php
Строк: 142
<?
include '../Core.php';
if(!isset($user))
{
$set['title']=''.$ln['err'].'';
include_once '../sys/inc/thead.php';
title();
err();
echo ''.$ln['reg'].'';
include_once '../sys/inc/tfoot.php';
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 `besedka_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 `besedka_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=/besedka/room/$room[id]/".rand(1000,9999).'/'); // автообновление
$set['title']='('.mysql_result(mysql_query("SELECT COUNT(*) FROM `chat_who` WHERE `room` = '$room[id]'"),0).')'; // заголовок страницы
include_once 'inc/thead.php';
title();
if($_GET['priv'] == 1) $checkbox = ' checked="checked"';
echo "<div class='tmn'>n";
echo "<a href='/info.php?id=$ank[id]'></a> | <a href='/prof.php?id=$ank[id]'>".$ln['ank']."</a><br />n";
echo "</div>n";
echo "<div class='textmes'>n";
echo "<form method="post" action="/besedka/room/$room[id]/".rand(1000,9999)."/">n";
echo "<br />n<textarea name="msg">$ank[nick], </textarea><br />n";
echo "<label><input type="checkbox"$checkbox name="privat" value="$ank[id]" /> p</label><br />n";
if($user['group_access'] > 1){
echo "<label><input type="checkbox" name="bold" value="$ank[id]" /> b</label><br />n";
echo "<label><input type="checkbox" name="under" value="$ank[id]" /> _</label><br />n";}
echo ''.$ln['color'].' <select name="color">
<option value="">Стандарт</option>
<option value="#000000">Чёрный</option>
<option value="#808080">Серый</option>
<option value="#808000">Оливковый</option>
<option value="#008000">Зеленый</option>
<option value="#800080">Фиолетовый</option>
<option value="#0000FF">Синий</option>
<option value="#00FFFF">Голубой</option>
<option value="#FF00FF">Розовый</option>
<option value="#00FF00">Салатовый</option>
<option value="#FFFF00">Желтый</option>
<option value="#ff0000">Красный</option>
<option value="#e90080">Малиновый</option>
<option value="#008800">Хаки</option>
<option value="#f7bc5b">Телесный</option>
<option value="#446d8c">Мурена</option>
<option value="#b7770d">Коричневый</option>
</select><br/>';
echo "<input value="OK" type="submit" />n";
echo "</div>n";
echo "</form>n";
echo "<div class="foot">n";
echo "«<a href="/besedka/room/6/5555/">".$ln['back']."</a><br />n";
echo "</div>n";
include_once '../sys/inc/tfoot.php';
}
if (isset($_GET['call']))
{
echo "<div class="err">";
echo "".$ln['moder']."<br />n";
echo "<a href="?call2">yes</a> n";
echo "<a href="?">no</a><br />n";
echo "</div>";
}
if(isset($_GET['call2']))
{
include 'call.php';
msg(''.$ln['good'].'');
}
if (isset($_GET['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `besedka_rooms` WHERE `id` = '".intval($_GET['id'])."'"),0)==1)
{
$room=mysql_fetch_assoc(mysql_query("SELECT * FROM `besedka_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=/besedka/room/$room[id]/".rand(1000,9999).'/'); // автообновление
$set['title']=' ('.mysql_result(mysql_query("SELECT COUNT(*) FROM `chat_who` WHERE `room` = '$room[id]'"),0).')'; // заголовок страницы
include_once 'inc/thead.php';
title();
include 'inc/room.php';
include_once '../sys/inc/tfoot.php';
}
$set['title']=''.$ln['bes'].''; // заголовок страницы
include_once 'inc/thead.php';
title();
include 'inc/admin_act.php';
err();
echo "<table class='post'>n";
$q=mysql_query("SELECT * FROM `besedka_rooms` ORDER BY `pos` ASC");
if (mysql_num_rows($q)==0) {
echo "".$ln['null']."n";
}
while ($room = mysql_fetch_array($q))
{
if($num==1){
echo "<div class='rekl_main'>";
$num=0;
}else{
echo "<div class='menu_razd'>";
$num=1;}
echo "<div class='tmn'>";
//echo "<img src='/style/icons/chat.gif' alt='' /> <a href='/besedka/room/$room[id]/".rand(1000,9999)."/'>$room[name]</a> (".mysql_result(mysql_query("SELECT COUNT(*) FROM `chat_who` WHERE `room` = '$room[id]'"),0).")</a><br />n";
//if ($room['opis']!=NULL)echo esc(trim(br(bbcode(smiles(links(stripcslashes(htmlspecialchars($room['opis']))))))))."<br />n";
echo "</div>";
}
include_once '../sys/inc/tfoot.php';
?>