Файл: vk.com_vhllam/klan/adm_chat.php
Строк: 157
<?php
require_once$_SERVER['DOCUMENT_ROOT'] . '/sys/inc/start.php';
require_once$_SERVER['DOCUMENT_ROOT'] . '/sys/inc/compress.php';
require_once$_SERVER['DOCUMENT_ROOT'] . '/sys/inc/sess.php';
require_once$_SERVER['DOCUMENT_ROOT'] . '/sys/inc/home.php';
require_once$_SERVER['DOCUMENT_ROOT'] . '/sys/inc/settings.php';
require_once$_SERVER['DOCUMENT_ROOT'] . '/sys/inc/db_connect.php';
require_once$_SERVER['DOCUMENT_ROOT'] . '/sys/inc/ipua.php';
require_once$_SERVER['DOCUMENT_ROOT'] . '/sys/inc/fnc.php';
require_once$_SERVER['DOCUMENT_ROOT'] . '/sys/inc/user.php';
$us = mysql_fetch_array(mysql_query("SELECT * FROM `clan_user` WHERE `id_user` = '$user[id]' LIMIT 1"));
$clan = mysql_fetch_array(mysql_query("SELECT * FROM `clan` WHERE `id` = '$us[id_clan]' LIMIT 1"));
$set['title'] = 'Чат клана '.$clan['name'];
include_once '../sys/inc/thead.php';
title();
aut();
include_once 'functions.php';
if (ban($user['id'], $id)) {
$us = mysql_fetch_array(mysql_query("SELECT * FROM `clan_user` WHERE `id_user` = '".$user['id']."' && `id_clan` = '$clan[id]' AND `activaty` = '0'"));
echo '<div class="mess"><b>Вы забанены в данном клане!</b><br /><b>Причина:</b> ' . $us['ban_prich'] . '<br /><b>Время окончания бана:</b> ' . vremja($us['ban_time']) . '</div>';
echo "<div class='aut'>";
echo "<a href='/klan/'>Все кланы</a><br/>n";
echo "<a href='/klan/rules.php'>Помощь и Правила</a>n";
echo "</div>n";
include_once '../sys/inc/tfoot.php';
exit();
}
if (mysql_result(mysql_query("SELECT COUNT(id) FROM `clan_user` where `id_user` = '$user[id]' AND `activaty` = '0' LIMIT 1"),0)==0){
echo "<div class="err">n";
echo "Вы не состоите в кланеn";
echo "</div>n";
}
else
{
if($us['level']>0){
if (isset($_POST['msg']) && isset($user))
{
$msg=$_POST['msg'];
if (isset($_POST['translit']) && $_POST['translit']==1)$msg=translit($msg);
if (strlen2($msg)>512){$err='Сообщение слишком длинное';}
elseif (strlen2($msg)<2){$err='Короткое сообщение';}
elseif (mysql_result(mysql_query("SELECT COUNT(*) FROM `clan_adm_chat` WHERE `id_user` = '$user[id]' AND `id_clan` = '$clan[id]' AND `msg` = '".mysql_escape_string($msg)."' AND `time` > '".($time-300)."' LIMIT 1"),0)!=0){$err='Ваше сообщение повторяет предыдущее';}
else{
$msg=mysql_escape_string($msg);
mysql_query("INSERT INTO `clan_adm_chat` (`id_user`, `time`, `msg`, `id_clan`) values('$user[id]', '$time', '$msg', '$clan[id]')");
mysql_query("UPDATE `user` SET `balls` = '".($user['balls']+1)."' WHERE `id` = '$user[id]' LIMIT 1");
msg('Сообщение успешно добавлено');
}
}
echo "<div class="menu"><a href='?act=chat&".rand(1000,9999)."'>Обновить</a></div>n";
if (isset($user))
{
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '".intval($_GET['reply'])."' LIMIT 1"));
$ank['nick'] = isset($ank['nick']) ? mysql_escape_string($ank['nick']).',' : '';
echo "<div class="mails"><form method="post" name='message' action="?act=chat">n";
if ($set['web'] && is_file(H.'style/themes/'.$set['set_them'].'/altername_post_form.php'))
include_once H.'style/themes/'.$set['set_them'].'/altername_post_form.php';
else
echo "Сообщение:<br />n<textarea name="msg">$ank[nick]</textarea><br />n";
echo "<input value="Отправить" type="submit" />n";
echo "</form></div>n";
}
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `clan_adm_chat` WHERE `id_clan` = '$clan[id]'"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
if ($k_post==0)
{
echo " <tr>n";
echo " <td class='mess'>n";
echo "Нет сообщенийn";
echo " </td>n";
echo " </tr>n";
}
$q=mysql_query("SELECT * FROM `clan_adm_chat` WHERE `id_clan` = '$clan[id]' ORDER BY id DESC LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_array($q))
{
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $post[id_user] LIMIT 1"));
if(@$num==1){
echo "<div class='x1'>";
@$num=0;
}else{
echo "<div class='x2'>";
@$num=1;}
echo status($ank['id'])." <a href='/info.php?id=$ank[id]'><span style="color:$ank[ncolor]">$ank[nick]</span></a> (".vremja($post['time']).")n";
if(isset($user) && $us['level']==2){
echo "<a href='adminka.php?act=delpost&id=$post[id_clan]&del=$post[id]'><font color = orange>DEL</font></a><br />n";
}
if(isset($user) && $us['level']==1){
echo "<a href='moderka.php?act=delpost&id=$post[id_clan]&del=$post[id]'><font color = orange>DEL</font></a><br />n";
}
echo "<br?n";
echo "<span style="color:$ank[color]">n";
echo esc(trim(br(bbcode(smiles(links(stripcslashes(htmlspecialchars($post['msg']))))))))."n";
echo "</span><br/>n";
echo "<a href='?reply=$post[id_user]&".rand(1000,9999)."'><font color = orange>Ответить</font></a><br />n";
echo "</div>";
}
if ($k_page>1)str("?",$k_page,$page); // Вывод страниц
}
else
{
echo "<div class='err'>n";
echo "Вы не являетесь членом админ состава данного клана!n";
echo "</div>n";
}
}
echo "<div class='aut'>";
echo "<a href='/klan/myklan.php'>Мой клан</a><br/>n";
echo "<a href='/klan/'>Все кланы</a><br/>n";
echo "<a href='/klan/rules.php'>Помощь и Правила</a>n";
echo "</div>n";
include_once '../sys/inc/tfoot.php';
?>