Файл: forum/inc/them.php
Строк: 323
<?php
mysql_query("UPDATE `forum_t` SET prosm = prosm +1 WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' AND `id` = '$them[id]' LIMIT 1");
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'] == 'g') {
$golos = $_POST['g'];
if (utf8_strlen($msg) < 2) {
$err = 'Короткое сообщение';
}
if (utf8_strlen($msg) > 10024) {
$err = 'Длина сообщения превышает предел в 10024 символа';
}
$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` = '" . mysql_real_escape_string($msg) . "' LIMIT 1"), 0) != 0) {
$err = 'Ваше сообщение повторяет предыдущее';
}
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 `money` = '" . ($user['money'] + 5) . "', `activity` = '" . ($user['activity'] + 0.03) . "' 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]', '" . mysql_real_escape_string($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']);
mysql_query("UPDATE `forum_r` SET `time` = '$time' WHERE `id` = '$razdel[id]' LIMIT 1");
mysql_query("UPDATE `forum_t` SET `time` = '$time' WHERE `id` = '$them[id]' LIMIT 1");
$q = mysql_query("SELECT * FROM `friends` WHERE `user` = '" . $them['id_user'] . "' AND `i` = '1'");
while ($f = mysql_fetch_array($q)) {
$a = get_user($f['friends']);
$tape_set = mysql_fetch_array(mysql_query("SELECT * FROM `tape_set` WHERE `id_user` = '" . $a['id'] . "' LIMIT 1"));
if ($f['tape_forum'] == 1 && $tape_set['tape_forum'] == 1) {
if ($them['id_user'] != $a['id'] || $a['id'] != $user['id'])
$tape_msg = "" . ($user['sex'] ? 'ответил' : 'ответила') . " на сообщение в [url=/news/?news=$news[id]]этой[/url] новости";
mysql_query("INSERT INTO `tape` (`id_user`, `id_kont`, `msg`, `time`) values('$a[id]', '$them[id_user]', '$tape_msg', '$time')");
}
}
$anki = get_user($them['id_user']); // Определяем автора
if ($anki['id'] != $user['id']) {
mysql_query("INSERT INTO `tape` (`id_user`, `id_kont`, `msg`, `time`, `razdel`, `name`, `ok`) VALUES ('0', '$anki[id]', 'В вашей теме оставили [url=/forum/$forum[id]/$razdel[id]/$them[id]/?page=end]коментарий[/url]', '$time', 'forum', 'Форум', '1')");
} else {
mysql_query("INSERT INTO `tape` (`id_user`, `id_kont`, `msg`, `time`, `razdel`, `name`, `ok`) VALUES ('0', '$us[id]', 'Вам ответили на [url=/forum/$forum[id]/$razdel[id]/$them[id]/?page=end]сообщение![/url]', '$time', 'forum', 'Форум', '1')");
}
msg('Сообщение успешно добавлено');
aut();
header("Refresh: 1; url = /forum/$forum[id]/$razdel[id]/$them[id]/?page=end&" . SID);
echo "<div class = 'foot'>";
echo "<img src = '/style/icons/left.png' /> <a href = '/forum/$forum[id]/$razdel[id]/$them[id]/?page=end'>В тему</a><br />";
echo "<img src = '/style/icons/left.png' /> <a href = '/forum/$forum[id]/$razdel[id]/'>$razdel[name]</a><br />";
echo "<img src = '/style/icons/left.png' /> <a href = '/forum/$forum[id]/'>$forum[name]</a><br />";
echo "<img src = '/style/icons/left.png' /> <a href = '/forum/'>Форум</a><br />";
echo "</div>";
require_once '../../sys/inc/tfoot.php';
}
}
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 (utf8_strlen($msg) < 2) {
$err = 'Короткое сообщение';
}
if (utf8_strlen($msg) > 10024) {
$err = 'Длина сообщения превышает предел в 10024 символа';
}
$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` = '" . mysql_real_escape_string($msg) . "' LIMIT 1"), 0) != 0) {
$err = 'Ваше сообщение повторяет предыдущее';
}
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 `money` = '" . ($user['money'] + 5) . "' WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `activity` = '" . ($user['activity'] + 0.03) . "' 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]', '" . mysql_real_escape_string($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']);
mysql_query("UPDATE `forum_r` SET `time` = '$time' WHERE `id` = '$razdel[id]' LIMIT 1");
mysql_query("UPDATE `forum_t` SET `time` = '$time' WHERE `id` = '$them[id]' LIMIT 1");
$q = mysql_query("SELECT * FROM `friends` WHERE `user` = '" . $them['id_user'] . "' AND `i` = '1'");
while ($f = mysql_fetch_array($q)) {
$a = get_user($f['friends']);
$tape_set = mysql_fetch_array(mysql_query("SELECT * FROM `tape_set` WHERE `id_user` = '" . $a['id'] . "' LIMIT 1"));
if ($f['tape_forum'] == 1 && $tape_set['tape_forum'] == 1) {
if ($them['id_user'] != $a['id'] || $a['id'] != $user['id']) {
$tape_msg = "" . ($user['sex'] ? 'ответил' : 'ответила') . " на сообщение в [url=/forum/]этой[/url] новости";
}
mysql_query("INSERT INTO `tape` (`id_user`, `id_kont`, `msg`, `time`) values('$a[id]', '$them[id_user]', '$tape_msg', '$time')");
}
}
$anki = get_user($them['id_user']); // Определяем автора
if ($anki['id'] != $user['id']) {
mysql_query("INSERT INTO `tape` (`id_user`, `id_kont`, `msg`, `time`, `razdel`, `name`, `ok`) VALUES ('0', '$anki[id]', 'В вашей теме оставили [url=/forum/$forum[id]/$razdel[id]/$them[id]/?page=end]коментарий[/url]', '$time', 'forum', 'Форум', '1')");
} else {
mysql_query("INSERT INTO `tape` (`id_user`, `id_kont`, `msg`, `time`, `razdel`, `name`, `ok`) VALUES ('0', '$us[id]', 'Вам ответили на [url=/forum/$forum[id]/$razdel[id]/$them[id]/?page=end]сообщение![/url]', '$time', 'forum', 'Форум', '1')");
}
msg('Сообщение успешно добавлено');
aut();
header("Refresh: 1; url=/forum/$forum[id]/$razdel[id]/$them[id]/?page=end&" . SID);
echo "<div class = 'foot'>";
echo "<img src = '/style/icons/left.png' /> <a href = '/forum/$forum[id]/$razdel[id]/$them[id]/?page=end'>В тему</a><br />";
echo "<img src = '/style/icons/left.png' /> <a href = '/forum/$forum[id]/$razdel[id]/'>$razdel[name]</a><br />";
echo "<img src = '/style/icons/left.png' /> <a href = '/forum/$forum[id]/'>$forum[name]</a><br />";
echo "<img src = '/style/icons/left.png' /> <a href = '/forum/'>Форум</a><br />";
echo "</div>";
require_once '../sys/inc/tfoot.php';
}
}
if ($them['close']) {
echo "<div class = 'err'>Тема закрыта</div>";
}
#Рейтинг файлов
if (isset($user) && $user['money'] >= 10 && $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('Ваш положительный отзыв принят');
}
}
err();
aut();
$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'];
$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 LIMIT $start, $set[p_str]");
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]";
}
echo "<div class = 'menu_razd'>Тема `$them[name]`</div>";
if (mysql_num_rows($q) == 0) {
echo "<table class = 'foot'><tr><td class = 'null'>";
echo "<img src = '/style/icons/bullet_error.png' /> Нет сообщений в теме "$them[name]"";
echo "</td></tr></table>";
}
$post_k = $start;
while ($post = mysql_fetch_assoc($q)) {
$ank = get_user($post['id_user']);
$post_k++;
echo "<table class = 'foot'><tr><td class = 'icon14'>";
if ($set['show_num_post'] == 1) {
$num_post1 = $post_k;
} else {
$num_post1 = NULL;
}
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' />";
} else {
if (IS_WEB) {
avatar($ank['id'], '50');
} else {
avatar($ank['id'], '36');
}
echo "<br />";
if ($them['id_user'] == $post['id_user']) {
echo "<small>Автор</small>";
} else {
echo "<small>Постер</small>";
}
echo "<br />";
echo "<font color = 'blue'>$num_post1</font>";
}
echo "</td><td class = 'null'>";
$k_them = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t` WHERE `id_user` = '$ank[id]'"), 0);
$k_p_forum = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_user` = '$ank[id]'"), 0);
if (isset($user) && $them['close'] == 0) {
user($ank['id']);
echo "<span class = 'count1'>";
echo "<font color = 'red'>+$k_p_forum</font>";
echo "<font color = 'green'>+$k_them</font>";
echo "</span><br />";
} else {
user($ank['id']);
echo "<span class = 'count1'>";
echo "<font color = 'red'>+$k_p_forum</font>";
echo "<font color = 'green'>+$k_them</font>";
echo "</span><br />";
}
echo "<div class = 'right' id = 'hide'>";
if (user_access('forum_post_ed') && ($ank['level'] <= $user['level'] || $ank['level'] == $user['level'] && $ank['id'] == $user['id'])) {
echo "<a href = '/forum/$forum[id]/$razdel[id]/$them[id]/$post[id]/edit' title = 'Редактировать'><img src='/style/icons/set.png' /></a> ";
} elseif (isset($user) && $user['id'] == $post['id_user']) {
echo "<a href = '/forum/$forum[id]/$razdel[id]/$them[id]/$post[id]/edit' title = 'Редактировать'><img src='/style/icons/set.png' /></a> ";
}
if (isset($user) && $them['close'] == 0 && $user['id'] == $post['id_user'] && $post['time'] > time() - 600 && $post_k == $k_post) {
echo ' ';
} elseif ($them['close'] == 0 && user_access('forum_post_ed') && ($ank['level'] < $user['level'] || $ank['level'] == $user['level'] && $ank['id'] == $user['id'])) {
echo ' ';
}
if ($them['close'] == 0 && isset($user)) {
echo "<a href = '/forum/$forum[id]/$razdel[id]/$them[id]/$post[id]/zhal' title = 'Жалоба'><img src='/style/icons/zhaloba.png' /></a>n";
echo "<a href = '/forum/$forum[id]/$razdel[id]/$them[id]/$post[id]/cit' title = 'Цитировать'><img src='/style/icons/cit.png' /></a> ";
echo "<a href = '/forum/$forum[id]/$razdel[id]/$them[id]/$post[id]/msg' title = 'Ответить'><img src='/style/icons/pencil.png' /></a>";
}
if ($ank['level'] < $user['level']) {
echo "<a href = '/adm_panel/ban.php?f=$forum[id]&r=$razdel[id]&t=$them[id]&p=$post[id]&id=$ank[id]' title = 'Дать бан'><img src='/style/icons/ban.png' /></a>";
}
if ($post['red'] == 1) {
echo "<a href = '/forum/$forum[id]/$razdel[id]/$them[id]/$post[id]/hist' title = 'История изменений'><img src='/style/icons/history.png' /></a>";
}
echo "</div>";
#Цитируем
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'>";
echo "<b>$ank_c[nick] (" . vremja($cit['time']) . "):</b><br />";
echo output_text($cit['msg']);
echo "</div>";
}
if ($post['opros'] == '1' and $num_post1 == '1') {
echo "<div class = 'status'>";
echo output_text($post['msg']);
echo "</div>";
$q2 = mysql_query("SELECT * FROM `forum_opr` WHERE `id_them` = '$them[id]' AND `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' AND `id_post`='$post[id]' ORDER BY `id` ASC");
if (mysql_num_rows($q2) == 0) {
echo "Ошибка не найдено ни одного варианта n";
}
while ($post2 = mysql_fetch_assoc($q2)) {
$zavse = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_opres` WHERE `id_them` = '$them[id]' AND `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' AND `id_post`='$post[id]' ", $db), 0);
$zaet = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_opres` WHERE `id_them` = '$them[id]' AND `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' AND `id_post`='$post[id]' AND `id_var`='$post2[id]' ", $db), 0);
$prov = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_opres` WHERE `id_them` = '$them[id]' AND `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' AND `id_post`='$post[id]' AND `id_user`='$user[id]' ", $db), 0);
echo "$post2[var] [$zaet чел.]<br />";
if ($prov == 0) {
echo "<a href = '/forum/$forum[id]/$razdel[id]/$them[id]/$post[id]/$post2[id]/golos'>";
echo "<img src = '/forum/img.php?p=" . @intval($zaet / $zavse * 100) . "&k=$zaet&a=$zavse' alt=''/>";
echo "</a>n";
} else {
echo "<img src = '/forum/img.php?p=" . intval($zaet / $zavse * 100) . "&k=$zaet&a=$zavse' alt=''/>";
}
echo "<br />";
}
} else {
echo "<div class = 'status'>";
echo output_text($post['msg']);
echo "</div>";
}
if ($post['ban'] == 1) {
$bannn = mysql_fetch_array(mysql_query("SELECT * FROM `forum_ban` WHERE `id_them` = '$them[id]' AND `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' AND `id_post`='$post[id]' AND `id_user`='$ank[id]' LIMIT 1"));
echo "<font color = 'red'>" . output_text($bannn['msg']) . "</font><br />";
}
if ($post['red'] == 1) {
$redakt = mysql_fetch_array(mysql_query("SELECT * FROM `forum_phis` WHERE `id_them` = '$them[id]' AND `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' AND `id_post`='$post[id]' ORDER BY `id` DESC LIMIT 1"));
$ank5 = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '$redakt[id_user]' LIMIT 1"));
echo "<u>Редактировал последний раз <a href = '/info.php?id=$ank5[id]'> <font color='red'>$ank5[nick]</font></a> в " . vremja($redakt['data']) . "</u><br/>";
}
include H . '/forum/inc/file.php';
echo "</td></tr></table>";
}
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'))) {
if ($user['set_files'] == 1) {
echo "<form class = 'foot' name = 'message' method = 'POST' enctype = 'multipart/form-data' action = '/forum/$forum[id]/$razdel[id]/$them[id]/new?$passgen'>";
} else {
echo "<form class = 'foot' name = 'message' method = 'POST' action = '/forum/$forum[id]/$razdel[id]/$them[id]/new?$passgen'>";
}
if (isset($_POST['msg']) && isset($_POST['file_s'])) {
$msg2 = output_text($_POST['msg'], false, true, false, false, false);
} else {
$msg2 = NULL;
}
echo "Сообщение:<br />";
echo text::auto_bb("message", "msg");
if (IS_WEB){
echo L . "<textarea name="msg" rows='3' style='width:70%'></textarea><br />n";
} else {
echo L . "<textarea name="msg" style='width:70%'></textarea><br />n";
}
if ($user['set_files'] == 1) {
if (isset($_SESSION['file'])) {
echo "Прикрепленные файлы:<br />";
for ($i = 0; $i < count($_SESSION['file']); $i++) {
if (isset($_SESSION['file'][$i]) && is_file($_SESSION['file'][$i]['tmp_name'])) {
echo "<img src = '/style/icons/attach.png' />";
echo $_SESSION['file'][$i]['name'] . '.' . $_SESSION['file'][$i]['ras'] . ' (';
echo size_file($_SESSION['file'][$i]['size']);
echo ") ";
echo "<a href = '/forum/$forum[id]/$razdel[id]/$them[id]/d_file$i' title = 'Удалить'><img src = '/style/icons/cross.png' /></a><br />";
}
}
}
echo "<input name = 'file_f' type = 'file' /><br />";
echo "<input name = 'file_s' value = 'Прикрепить файл' type = 'submit' /><br />";
}
echo "<button class = 'btn'>";
echo "<img src = '/style/icons/tick.png' /> Отправить";
echo "</button></form>";
}
echo "<div class = 'foot'>";
echo "<img src = '/style/icons/information.png' /> <a href = '/info/?act=forum'>Правила форума</a><br />";
echo "<img src = '/style/icons/page_white_word.png' /> <a href = 'txt'>Скачать тему TXT</a><br />";
if (isset($user)) {
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_zakl` WHERE `id_them` = '$them[id]' AND `id_user` = '$user[id]'"), 0) == 0) {
echo "<img src = '/style/icons/page_white_star.png' /> <a href = '/forum/$forum[id]/$razdel[id]/$them[id]/?page=$page&zakl=1'>Добавить в закладки</a><br />";
} else {
mysql_query("UPDATE `forum_zakl` SET `time` = '" . time() . "' WHERE `id_them` = '$them[id]' AND `id_user` = '$user[id]'");
echo "<img src = '/style/icons/page_white_star.png' /> <a href = '/forum/$forum[id]/$razdel[id]/$them[id]/?page=$page&zakl=0'>Удалить из закладок</a><br />";
}
}
echo "</div>";