Файл: forum/inc/them.php
Строк: 389
<?
if (isset($_GET['act']) && $_GET['act']=='txt')
{
ob_clean();
ob_implicit_flush();
header('Content-Type: text/plain; charset=utf-8', true);
header('Content-Disposition: attachment; filename="'.retranslit($them['name']).'.txt";');
echo "Тема: $them[name] ($forum[name]/$razdel[name])rn";
$q=mysql_query("SELECT * FROM `forum_p` WHERE `id_them` = '$them[id]' AND `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' ORDER BY `time` ASC");
while ($post = mysql_fetch_assoc($q))
{
echo "rn";
$ank=get_user($post['id_user']);
echo "$ank[nick] (".date("j M Y в H:i", $post['time']).")rn";
if ($post['cit']!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id` = '$post[cit]'"),0)==1)
{
$cit=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_p` WHERE `id` = '$post[cit]' LIMIT 1"));
$ank_c=get_user($cit['id_user']);
echo "--Цитата--rn";
echo "$ank_c[nick] (".date("j M Y в H:i", $cit['time'])."):rn";
echo trim(br($cit['msg'],"rn"))."rn";
echo "----------rn";
}
echo trim(br($post['msg'],"rn"))."rn";
}
echo "rnИсточник: http://$_SERVER[SERVER_NAME]/forum/$forum[id]/$razdel[id]/$them[id]/rn";
exit;
}
if (isset($user) && isset($_GET['f_del']) && is_numeric($_GET['f_del']) && isset($_SESSION['file'][$_GET['f_del']]))
{
@unlink($_SESSION['file'][$_GET['f_del']]['tmp_name']);
}
if (isset($user) && isset($_GET['zakl']) && $_GET['zakl']==1)
{
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_zakl` WHERE `id_user` = $user[id] AND `id_them` = '$them[id]'"),0)!=0)
{
$err[]="Тема уже есть в ваших закладках";
} else {
mysql_query("INSERT INTO `forum_zakl` (`id_user`, `time`, `id_them`, `time_obn`) values('$user[id]', '$time', '$them[id]', '$time')");
msg('Тема добавлена в закладки');
}
}
elseif (isset($user) && isset($_GET['zakl']) && $_GET['zakl']==0)
{
mysql_query("DELETE FROM `forum_zakl` WHERE `id_user` = '$user[id]' AND `id_them` = '$them[id]'");
msg('Тема удалена из закладок');
}
if (isset($user) && isset($_GET['act']) && $_GET['act']=='new' && isset($_FILES['file_f']) && preg_match('#.#', $_FILES['file_f']['name']) && isset($_POST['file_s']))
{
copy($_FILES['file_f']['tmp_name'], H.'sys/tmp/'.$user['id'].'_'.md5_file($_FILES['file_f']['tmp_name']).'.forum.tmp');
chmod(H.'sys/tmp/'.$user['id'].'_'.md5_file($_FILES['file_f']['tmp_name']).'.forum.tmp', 0777);
if (isset($_SESSION['file']))
$next_f=count($_SESSION['file']);
else
$next_f=0;
$file=esc(stripcslashes(htmlspecialchars($_FILES['file_f']['name'])));
$_SESSION['file'][$next_f]['name']=preg_replace('#.[^.]*$#i', NULL, $file); // имя файла без расширения
$_SESSION['file'][$next_f]['ras']=strtolower(preg_replace('#^.*.#i', NULL, $file));
$_SESSION['file'][$next_f]['tmp_name']=H.'sys/tmp/'.$user['id'].'_'.md5_file($_FILES['file_f']['tmp_name']).'.forum.tmp';
$_SESSION['file'][$next_f]['size']=filesize(H.'sys/tmp/'.$user['id'].'_'.md5_file($_FILES['file_f']['tmp_name']).'.forum.tmp');
$_SESSION['file'][$next_f]['type']=$_FILES['file_f']['type'];
}
if (isset($user) && ($them['close']==0 || $them['close']==1 && user_access('forum_post_close')) && isset($_GET['act']) && $_GET['act']=='new' && isset($_POST['msg']) && !isset($_POST['file_s']))
{
$msg=$_POST['msg'];
if (strlen2($msg)<2)$err='Короткое сообщение';
if (strlen2($msg)>50000)$err='Длина сообщения превышает предел в 50000 символа';
$mat=antimat($msg);
if ($mat)$err[]='В тексте сообщения обнаружен мат: '.$mat;
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_them` = '$them[id]' AND `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' AND `id_user` = '$user[id]' AND `msg` = '".my_esc($msg)."' LIMIT 1"),0)!=0)$err='Ваше сообщение повторяет предыдущее';
//Начисление рейтинга и монет за активность
mysql_query("UPDATE `user` SET `money` = '" . ($user['money'] + 3) . "', `rating` = '" . ($user['rating'] + 1) . "' WHERE `id` = '$user[id]' LIMIT 1");
if (!isset($err))
{
if (isset($_POST['cit']) && is_numeric($_POST['cit']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id` = '".intval($_POST['cit'])."' AND `id_them` = '".intval($_GET['id_them'])."' AND `id_razdel` = '".intval($_GET['id_razdel'])."' AND `id_forum` = '".intval($_GET['id_forum'])."'"),0)==1)
$cit=intval($_POST['cit']); else $cit='null';
mysql_query("UPDATE `user` SET `balls` = '".($user['balls']+1)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `forum_zakl` SET `time_obn` = '$time' WHERE `id_them` = '$them[id]'");
mysql_query("INSERT INTO `forum_p` (`id_forum`, `id_razdel`, `id_them`, `id_user`, `msg`, `time`, `cit`) values('$forum[id]', '$razdel[id]', '$them[id]', '$user[id]', '".my_esc($msg)."', '$time', $cit)");
$post_id=mysql_insert_id();
if (isset($_SESSION['file']) && isset($user))
{
for ($i=0; $i<count($_SESSION['file']);$i++)
{
if (isset($_SESSION['file'][$i]) && is_file($_SESSION['file'][$i]['tmp_name']))
{
mysql_query("INSERT INTO `forum_files` (`id_post`, `name`, `ras`, `size`, `type`) values('$post_id', '".$_SESSION['file'][$i]['name']."', '".$_SESSION['file'][$i]['ras']."', '".$_SESSION['file'][$i]['size']."', '".$_SESSION['file'][$i]['type']."')");
$file_id=mysql_insert_id();
copy($_SESSION['file'][$i]['tmp_name'], H.'sys/forum/files/'.$file_id.'.frf');
unlink($_SESSION['file'][$i]['tmp_name']);
}
}
unset($_SESSION['file']);
}
unset($_SESSION['msg']);
$ank=get_user($them['id_user']); // Определяем автора
mysql_query("UPDATE `user` SET `rating_tmp` = '".($user['rating_tmp']+1)."' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `forum_r` SET `time` = '$time' WHERE `id` = '$razdel[id]' LIMIT 1");
mysql_query("UPDATE `forum_t` SET `time_create` = '$time' WHERE `id` = '$them[id]' LIMIT 1");
/*
====================================
Обсуждения
====================================
*/
$q = mysql_query("SELECT * FROM `frends` WHERE `user` = '".$them['id_user']."' AND `i` = '1'");
while ($f = mysql_fetch_array($q))
{
$a=get_user($f['frend']);
$discSet = mysql_fetch_array(mysql_query("SELECT * FROM `discussions_set` WHERE `id_user` = '".$a['id']."' LIMIT 1")); // Общая настройка обсуждений
if ($f['disc_forum']==1 && $discSet['disc_forum']==1) /* Фильтр рассылки */
{
// друзьям автора
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `discussions` WHERE `id_user` = '$a[id]' AND `type` = 'them' AND `id_sim` = '$them[id]' LIMIT 1"),0)==0)
{
if ($them['id_user']!=$a['id'] || $a['id'] != $user['id'])
mysql_query("INSERT INTO `discussions` (`id_user`, `avtor`, `type`, `time`, `id_sim`, `count`) values('$a[id]', '$them[id_user]', 'them', '$time', '$them[id]', '1')");
}
else
{
$disc = mysql_fetch_array(mysql_query("SELECT * FROM `discussions` WHERE `id_user` = '$a[id_user]' AND `type` = 'them' AND `id_sim` = '$them[id]' LIMIT 1"));
if ($them['id_user']!=$a['id'] || $a['id'] != $user['id'])
mysql_query("UPDATE `discussions` SET `count` = '".($disc['count']+1)."', `time` = '$time' WHERE `id_user` = '$a[id]' AND `type` = 'them' AND `id_sim` = '$them[id]' LIMIT 1");
}
}
}
// отправляем автору
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `discussions` WHERE `id_user` = '$them[id_user]' AND `type` = 'them' AND `id_sim` = '$them[id]' LIMIT 1"),0)==0)
{
if ($them['id_user'] != $user['id'] && $them['id_user'] != $ank_otv['id'])
mysql_query("INSERT INTO `discussions` (`id_user`, `avtor`, `type`, `time`, `id_sim`, `count`) values('$them[id_user]', '$them[id_user]', 'them', '$time', '$them[id]', '1')");
}
else
{
$disc = mysql_fetch_array(mysql_query("SELECT * FROM `discussions` WHERE `id_user` = '$them[id_user]' AND `type` = 'them' AND `id_sim` = '$them[id]' LIMIT 1"));
if ($them['id_user'] != $user['id'] && $them['id_user'] != $ank_otv['id'] )
mysql_query("UPDATE `discussions` SET `count` = '".($disc['count']+1)."', `time` = '$time' WHERE `id_user` = '$them[id_user]' AND `type` = 'them' AND `id_sim` = '$them[id]' LIMIT 1");
}
/*
==========================
Уведомления об ответах
==========================
*/
if (isset($user) && $respons==TRUE){
$notifiacation=mysql_fetch_assoc(mysql_query("SELECT * FROM `notification_set` WHERE `id_user` = '".$ank_otv['id']."' LIMIT 1"));
if ($notifiacation['komm'] == 1)
mysql_query("INSERT INTO `notification` (`avtor`, `id_user`, `id_object`, `type`, `time`) VALUES ('$user[id]', '$ank_otv[id]', '$them[id]', 'them_komm', '$time')");
}
if($user['pol']==1){
$pol = 'Написал';
}else{
$pol='Написала';
}
mysql_query("INSERT INTO `activnost` SET `msg` = '$pol сообщение в [url=/forum/]форуме[/url] [img]https://offzon.ru/style/smiles/1/932.gif[/img]', `time`='$time' ,`id_user` = '$user[id]'");
$_SESSION['message'] = 'Сообщение успешно добавлено';
header("Location: ?page=".intval($_GET['page'])."");
exit;
}
}
/*
================================
Модуль жалобы на пользователя
и его сообщение либо контент
в зависимости от раздела
================================
*/
if (isset($_GET['spam']) && isset($user))
{
$mess = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_p` WHERE `id` = '".intval($_GET['spam'])."' limit 1"));
$spamer = get_user($mess['id_user']);
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `spamus` WHERE `id_user` = '$user[id]' AND `id_spam` = '$spamer[id]' AND `razdel` = 'forum' AND `spam` = '".$mess['msg']."'"),0)==0)
{
if (isset($_POST['spamus']))
{
if ($mess['id_user']!=$user['id'])
{
$msg=mysql_real_escape_string($_POST['spamus']);
if (strlen2($msg)<3)$err='Укажите подробнее причину жалобы';
if (strlen2($msg)>1512)$err='Длина текста превышает предел в 512 символов';
if(isset($_POST['types'])) $types=intval($_POST['types']);
else $types='0';
if (!isset($err))
{
mysql_query("INSERT INTO `spamus` (`id_object`, `id_user`, `msg`, `id_spam`, `time`, `types`, `razdel`, `spam`) values('$them[id]', '$user[id]', '$msg', '$spamer[id]', '$time', '$types', 'forum', '".my_esc($mess['msg'])."')");
$_SESSION['message'] = 'Заявка на рассмотрение отправлена';
header("Location: /forum/$forum[id]/$razdel[id]/$them[id]/?spam=$mess[id]&page=$pageEnd");
exit;
}
}
}
}
aut();
err();
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `spamus` WHERE `id_user` = '$user[id]' AND `id_spam` = '$spamer[id]' AND `razdel` = 'forum'"),0)==0)
{
echo "<div class='mess'>Ложная информация может привести к блокировке ника.
Если вас постоянно достает один человек - пишет всякие гадости, вы можете добавить его в черный список.</div>";
echo "<form class='nav1' method='post' action='/forum/$forum[id]/$razdel[id]/$them[id]/?spam=$mess[id]&page=".intval($_GET['page'])."'>n";
echo "<b>Пользователь:</b> ";
echo " ".avatar($spamer['id'])." ".group($spamer['id'])." <a href="/info.php?id=$spamer[id]">$spamer[nick]</a>n";
echo "".medal($spamer['id'])." ".online($spamer['id'])." (".vremja($mess['time']).")<br />";
echo "<b>Нарушение:</b> <font color='green'>".output_text($mess['msg'])."</font><br />";
echo "Причина:<br />n<select name='types'>n";
echo "<option value='1' selected='selected'>Спам/Реклама</option>n";
echo "<option value='2' selected='selected'>Мошенничество</option>n";
echo "<option value='3' selected='selected'>Оскорбление</option>n";
echo "<option value='0' selected='selected'>Другое</option>n";
echo "</select><br />n";
echo "Комментарий:";
echo $tPanel."<textarea name="spamus"></textarea><br />";
echo "<input value="Отправить" type="submit" />n";
echo "</form>n";
}else{
echo "<div class='mess'>Жалоба на <font color='green'>$spamer[nick]</font> будет рассмотрена в ближайшее время.</div>";
}
echo "<div class='foot'>n";
echo "<img src='/style/icons/str2.gif' alt='*'> <a href='?page=".intval($_GET['page'])."'>Назад</a><br />n";
echo "</div>n";
include_once '../sys/inc/tfoot.php';
exit;
}
if ($them['close']==1)
$err = 'Тема закрыта для обсуждения';
if (isset($user) && $user['balls']>=50 && $user['rating']>=0 && isset($_GET['id_file'])
&&
mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_files` WHERE `id` = '".intval($_GET['id_file'])."'"), 0)==1
&&
mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_files_rating` WHERE `id_user` = '$user[id]' AND `id_file` = '".intval($_GET['id_file'])."'"), 0)==0)
{
if (isset($_GET['rating']) && $_GET['rating']=='down')
{
mysql_query("INSERT INTO `forum_files_rating` (`id_user`, `id_file`, `rating`) values('$user[id]', '".intval($_GET['id_file'])."', '-1')");
msg ('Ваш отрицательный отзыв принят');
}
elseif(isset($_GET['rating']) && $_GET['rating']=='up')
{
mysql_query("INSERT INTO `forum_files_rating` (`id_user`, `id_file`, `rating`) values('$user[id]', '".intval($_GET['id_file'])."', '1')");
msg ('Ваш положительный отзыв принят');
}
}
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_them` = '$them[id]' AND `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]'"),0);
$k_page = k_page($k_post,$set['p_str']);
$page = page($k_page);
$start = $set['p_str']*$page-$set['p_str'];
aut();
err();
echo '<a class="link" href="/forum/'.$forum['id'].'/'.$razdel['id'].'/"><i class="fas fa-angle-left"></i> '.text($razdel['name']).'</a>';
/*
======================================
Перемещение темы
======================================
*/
if (isset($_GET['act']) && $_GET['act']=='mesto' && (user_access('forum_them_edit') || $ank2['id']==$user['id']))
{
echo "<form method="post" action="/forum/$forum[id]/$razdel[id]/$them[id]/?act=mesto&ok">n";
echo "<div class='main'>";
echo "Перемещение темы <b>".output_text($them['name'])."</b>n";
echo "</div>";
echo "<div class='mess'>";
echo "Раздел:<br />n";
echo "<select name="razdel">n";
if (user_access('forum_them_edit')){
$q = mysql_query("SELECT * FROM `forum_f` ORDER BY `pos` ASC");
while ($forums = mysql_fetch_assoc($q))
{
echo "<optgroup label='$forums[name]'>n";
$q2 = mysql_query("SELECT * FROM `forum_r` WHERE `id_forum` = '$forums[id]' ORDER BY `time` DESC");
while ($razdels = mysql_fetch_assoc($q2))
{
echo "<option".($razdel['id']==$razdels['id']?' selected="selected"':null)." value="$razdels[id]">" . text($razdels['name']) . "</option>n";
}
echo "</optgroup>n";
}
}
else
{
$q2 = mysql_query("SELECT * FROM `forum_r` WHERE `id_forum` = '$forum[id]' ORDER BY `time` DESC");
while ($razdels = mysql_fetch_assoc($q2))
{
echo "<option".($razdel['id']==$razdels['id']?' selected="selected"':null)." value='$razdels[id]'>" . text($razdels['name']) . "</option>n";
}
}
echo "</select><br />n";
echo "<input value="Переместить" type="submit" /> n";
echo "</form>n";
echo "</div>";
echo "<a class='link' href='/forum/$forum[id]/$razdel[id]/$them[id]/?'><i class='fas fa-angle-left'></i> В тему</a>";
include_once '../sys/inc/tfoot.php';
exit;
}
/*
======================================
Редактирование темы
======================================
*/
if (isset($_GET['act']) && $_GET['act']=='set' && (user_access('forum_them_edit') || $ank2['id']==$user['id']))
{
echo "<form method='post' action='/forum/$forum[id]/$razdel[id]/$them[id]/?act=set&ok' name='message'>";
echo "<div class='main'>";
echo "Редактирование темы <b>".output_text($them['name'])."</b>n";
echo "</div>";
echo "<div class="mess">n";
echo "Название:<br />n";
echo "<input name='name' type='text' maxlength='32' value='".text($them['name'])."' /><br />n";
echo "Сообщение:$tPanel<textarea name="msg">".text($them['text'])."</textarea><br />n";
if ($user['level']>0){
if ($them['up']==1)
$check=' checked="checked"';
else
$check=NULL;
echo "<label><input type="checkbox"$check name="up" value="1" /> Всегда наверху</label><br />n";
}
if ($them['close']==1)
$check=' checked="checked"';
else
$check=NULL;
echo "<label><input type="checkbox"$check name="close" value="1" /> Закрыть</label><br />n";
if ($ank2['id']!=$user['id']){
echo "<label><input type="checkbox" name="autor" value="1" /> Забрать у автора права</label><br />n";
}
echo '<table>';
echo "<td><input value="Изменить" type="submit" /></td>";
?><td width="1"><a href="#" onclick="$('.smile').toggle();return false;"><i style="color: #757577; font-size: 18px;" class="far fa-smile"></i></a></td><?
echo '</table>';
echo "</form>n";
echo "</div>";
include '../ajax/smile.php';
echo "<a class='link' href='/forum/$forum[id]/$razdel[id]/$them[id]/?'><i class='fas fa-angle-left'></i> В тему</a>";
include_once '../sys/inc/tfoot.php';
exit;
}
if (user_access('forum_post_ed') && isset($_GET['del'])) // удаление поста
{
mysql_query("DELETE FROM `forum_p` WHERE `id` = '" . intval($_GET['del']) . "' LIMIT 1");
$_SESSION['message'] = 'Сообщение успешно удалено';
header("Location: /forum/$forum[id]/$razdel[id]/$them[id]/?page=" . intval($_GET['page']) . "");
exit;
}
/*
======================================
Удаление темы
======================================
*/
if (isset($_GET['act']) && $_GET['act']=='del' && user_access('forum_them_del') && ($ank2['level']<=$user['level'] || $ank2['id']==$user['id']))
{
echo "<div class="mess">n";
echo "Подтвердите удаление темы <b>".output_text($them['name'])."</b><br />n";
echo "</div>n";
echo "<div class="main">n";
echo "<a href="/forum/$forum[id]/$razdel[id]/$them[id]/?act=delete&ok"><i class='fas fa-check-circle'></i> Да</a> <a href="/forum/$forum[id]/$razdel[id]/$them[id]/"><i class='fas fa-times-circle'></i> Нет</a>";
echo "</div>n";
echo "<a class='link 'href='/forum/$forum[id]/$razdel[id]/$them[id]/?'><i class='fas fa-angle-left'></i> В тему</a>";
include_once '../sys/inc/tfoot.php';
exit;
}
if ($page == 1){
//Содержимое темы
echo '<table style="border-bottom:none;" class="mess">';
echo "<td width='3%'>".avatar($them['id_user'])."</td><td>".group($them['id_user'])."";
echo user::nick($them['id_user'])."";
echo "".medal($them['id_user'])."".online($them['id_user'])."</br>";
echo "Добавлено в ".vremja($them['time'])."</td>";
echo '</table>';
echo "<div class='mess'>".output_text($them['text'])."</div>";
}
//--------------
//Управлание
if (isset($user) && (((!isset($_GET['act']) || $_GET['act']!='post_delete') && (user_access('forum_post_ed') || $ank2['id']==$user['id']))
|| ((user_access('forum_them_edit') || $ank2['id']==$user['id']))
|| (user_access('forum_them_del') || $ank2['id']==$user['id']))){
echo '<table style="text-align:center;" cellspacing="0" cellpadding="0">';
if (user_access('forum_them_edit') || $ank2['id']==$user['id']){
echo "<td><a style='border-right:none;box-shadow: none;' class='link' href='/forum/$forum[id]/$razdel[id]/$them[id]/?act=mesto'>Переместить</a></td>";
echo "<td><a style='border-right:none;box-shadow: none;' class='link' href='/forum/$forum[id]/$razdel[id]/$them[id]/?act=set'>Изменить</a></td>";
}
if (user_access('forum_them_del') || $ank2['id']==$user['id']){
echo "<td><a style='box-shadow: none;' class='link' href='/forum/$forum[id]/$razdel[id]/$them[id]/?act=del'>Удалить</a></td>";
}
echo '</table>';
}
/*------------сортировка по времени--------------
if (isset($user))
{
echo "<div id='comments' class='menus'>";
echo "<div class='webmenu'>";
echo "<a href='/forum/$forum[id]/$razdel[id]/$them[id]/?page=$page&sort=1' class='".($user['sort']==1?'activ':'')."'>Внизу</a>";
echo "</div>";
echo "<div class='webmenu'>";
echo "<a href='/forum/$forum[id]/$razdel[id]/$them[id]/?page=$page&sort=0' class='".($user['sort']==0?'activ':'')."'>Вверху</a>";
echo "</div>";
echo "</div>";
}
/*---------------alex-borisi---------------------*/
if ((user_access('forum_post_ed') || isset($user) && $ank2['id']==$user['id']) && isset($_GET['act']) && $_GET['act']=='post_delete'){
$lim=NULL;
} else {
$lim=" LIMIT $start, $set[p_str]";
}
$q=mysql_query("SELECT * FROM `forum_p` WHERE `id_them` = '$them[id]' AND `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' ORDER BY `time` $sort$lim");
if (mysql_num_rows($q)==0) {
echo '<div class="gmenu">Сообщений нет</div>';
}
echo '<div style="margin-top:6px;"></div>';
while ($post = mysql_fetch_assoc($q)){
$ank=get_user($post['id_user']);
if ((user_access('forum_post_ed') || isset($user) && $ank2['id']==$user['id']) && isset($_GET['act']) && $_GET['act']=='post_delete'){
echo '<input type="checkbox" name="post_'.$post['id'].'" value="1" />';
}
echo '<table class="mess">';
echo "<td style='vertical-align: top;' width='3%'>";
if (isset($user) && $user['id']!=$ank['id'] && $ank['id']!=0){
echo '<a href="/forum/'.$forum['id'].'/'.$razdel['id'].'/'.$them['id'].'/?response='.$ank['id'].'&page='.$page.'" title="Ответить '.$ank['nick'].'">';}
echo "".avatar($post['id_user'])."</a>";
echo '</td>';
echo "<td>".group($post['id_user'])."";
echo user::nick($post['id_user'],1, 1, 1);
echo '<span style="float:right;font-size: .7em;">'.vremja($post['time']).'</span>';
echo '<br>';
$postBan = mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE (`razdel` = 'all' OR `razdel` = 'forum') AND `post` = '1' AND `id_user` = '$post[id_user]' AND (`time` > '$time' OR `navsegda` = '1')"), 0);
if ($postBan == 0) // Блок сообщения
{
# Цитирование поста
if ($post['cit']!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id` = '$post[cit]'"),0)==1){
$cit=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_p` WHERE `id` = '$post[cit]' LIMIT 1"));
$ank_c=get_user($cit['id_user']);
echo '<div class="cit">
<b>'.$ank_c['nick'].' ('.vremja($cit['time']).'):</b><br />
'.output_text($cit['msg']).'<br />
</div>';
}
echo '<div style="padding-top:3px;font-size: 12px;">' . output_text($post['msg']).'</div>'; // Посты темы
echo '<table>';
include H.'/forum/inc/file.php'; // Прекрепленные файлы
echo '</table>';
}else{
echo output_text($banMess).'<br />';
}
echo '</td></table>';
if (isset($user)){
echo '<span style="float: right; margin: -20px 10px 0px 0px; font-size: 12px;">';
if ($them['close']==0) {
}
if (user_access('forum_post_ed') && ($ank['level']<=$user['level'] || $ank['level']==$user['level'] && $post['id_user']==$user['id']))
echo "<a href="/forum/$forum[id]/$razdel[id]/$them[id]/$post[id]/edit" title='Изменить пост $ank[nick]'><i class='fas fa-edit'></i></a> ";
elseif ($user['id']==$post['id_user'] && $post['time']>time()-600)
echo "<a href="/forum/$forum[id]/$razdel[id]/$them[id]/$post[id]/edit" title='Изменить мой пост'><i class='fas fa-edit'></i> (".($post['time']+600-time())." сек)</a> ";
if ($user['id']!= $post['id_user'] && $post['id_user']!=0) {
echo "<a href="/forum/$forum[id]/$razdel[id]/$them[id]/?spam=$post[id]&page=$page" title='Это спам'><i class='fas fa-exclamation-triangle'></i></a>";
}
if (user_access('forum_post_ed')) {
echo "<a href="/forum/$forum[id]/$razdel[id]/$them[id]/?del=$post[id]&page=$page" title='Удалить' ><i class='fas fa-times-circle'></i></a>";
}
echo '</span>';
}
}
if ((user_access('forum_post_ed') || isset($user) && $ank2['id']==$user['id']) && isset($_GET['act']) && $_GET['act']=='post_delete'){}
elseif ($k_page>1)str("/forum/$forum[id]/$razdel[id]/$them[id]/?",$k_page,$page);
if ((user_access('forum_post_ed') || isset($user) && $ank2['id']==$user['id']) && isset($_GET['act']) && $_GET['act']=='post_delete'){}
elseif (isset($user) && ($them['close']==0 || $them['close']==1 && user_access('forum_post_close')))
{
echo '<div class="mess">';
if ($user['set_files']==1)
echo "<form method='post' name='message' enctype='multipart/form-data' action='/forum/$forum[id]/$razdel[id]/$them[id]/new?page=$page&$passgen&".$go_otv."'>n";
else
echo "<form method='post' name='message' action='/forum/$forum[id]/$razdel[id]/$them[id]/new?page=$page&$passgen&".$go_otv."'>n";
if (isset($_POST['msg']) && isset($_POST['file_s']))$msg2=output_text($_POST['msg'],false,true,false,false,false); else $msg2=NULL;
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 "$tPanel<textarea placeholder='Введите сообщение...' name="msg">$otvet$msg2</textarea><br />n";
echo '<table>';
if ($user['set_files']==1)
{
if (isset($_SESSION['file']))
{
echo "Прикрепленные файлы:<br />n";
for ($i=0; $i<count($_SESSION['file']);$i++)
{
if (isset($_SESSION['file'][$i]) && is_file($_SESSION['file'][$i]['tmp_name']))
{
echo "<img src='/style/themes/$set[set_them]/forum/14/file.png' alt='' />n";
echo $_SESSION['file'][$i]['name'].'.'.$_SESSION['file'][$i]['ras'].' (';
echo size_file($_SESSION['file'][$i]['size']);
echo ") <a href='/forum/$forum[id]/$razdel[id]/$them[id]/d_file$i' title='Удалить из списка'><img src='/style/themes/$set[set_them]/forum/14/del_file.png' alt='' /></a>n";
echo "<br />n";
}
}
}
echo "<input name='file_f' type='file' /><br />n";
echo "<td><input name='file_s' value='Прикрепить' type='submit' /></td>";
}
echo '<td><input name="post" value="Отправить" type="submit" /></td>';
?><td width="1"><a href="#" onclick="$('.smile').toggle();return false;"><i style="color: #757577; font-size: 18px;" class="far fa-smile"></i></a></td><?
echo '</table>';
echo '</form>';
echo '</div>';
include '../ajax/smile.php';
}