Code cleanup

This commit is contained in:
lopar 2018-11-01 00:26:24 +02:00
parent 744be5f52c
commit e01c6f27d7

372
forum.php
View File

@ -11,16 +11,16 @@ if (!isset($_GET['page'])) {
$ps = $_GET['page'];
}
$dostupPal = false;
$dostupSovet = false;
$isModerator = false;
$isAdmin = false;
if (($user['align'] >= 1.7 && $user['align'] < 2) || $user['align'] == 2.4) {
$dostupPal = true;
if (($user['align'] >= 1.7 && $user['align'] < 2)) {
$isModerator = true;
}
if (($user['align'] >= 1.98 && $user['align'] <= 1.99) || $user['admin'] == 1 || $user['align'] == 10) {
$dostupSovet = true;
$dostupPal = true;
if ($user['admin'] == 1) {
$isAdmin = true;
$isModerator = true;
}
$edit = '';
@ -32,83 +32,20 @@ if (isset($_GET['do']) && $_GET['do'] != "search" && $_GET['do'] != "my_topics"
$search .= '<br /><br /><br />';
}
$news_topic = false;
if (isset($_GET['topic']) && is_numeric($_GET['topic']) && $_GET['topic'] == 228043095) {
$news_topic = true;
}
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Форум</title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/forum.css"/>
<link rel="stylesheet" href="css/wysibb/theme/default/wbbtheme.css"/>
<link rel='stylesheet' href="css/contact.css" media='screen'/>
<script type="text/javascript" language="JavaScript" src="js/jquery.min.js"></script>
<script type="text/javascript" language="JavaScript" src="js/jquery.wysibb-1.3.0.js"></script>
<script type="text/javascript" language="JavaScript" src='js/forum.js'></script>
<script type='text/javascript' src='js/jquery.simplemodal.js'></script>
<script type='text/javascript' src='js/contact.js'></script>
</head>
<body>
<h1>Форум</h1>
<a href="/"> на главную</a>
<table width="100%" border="0" bgcolor="#3D3D3B">
<tr valign="top">
<td width="200">
<br/>
<?php
if (!$user['id']) {
echo "<b>Не авторизованы</b><br />";
} else {
echo "Игрок : " . nick::id($user['id'])->full(1) . "<br />";
}
?>
<p><b><span style="color: #8f0000;">Конференции</span></b></p>
<?php
if (isset($_POST['selectt'], $_POST['numt']) && $_POST['selectt'] != '' && $_POST['numt'] != '') {
if (isset($_POST['selectt'], $_POST['numt']) && $_POST['selectt'] != '' && $_POST['numt'] != '') {
$AlignTop = db::c()->query('SELECT `min_align`, `max_align` FROM `forum` WHERE `id` = ?i', $_POST['selectt'])->fetch_assoc();
db::c()->query('UPDATE `forum` SET `parent` = ?i, `min_align` = "?s", `max_align` = "?s" WHERE `id` = ?i', $_POST['selectt'], $AlignTop['min_align'], $AlignTop['max_align'], $_POST['numt']);
}
}
if (!isset($_GET['conf']) && !isset($_GET['topic'])) {
if (!isset($_GET['conf']) && !isset($_GET['topic'])) {
$_GET['conf'] = 1;
}
}
$Movemess = ($dostupPal == true) ? 1 : 0;
$replasepost = '';
$Movemess = ($isModerator == true) ? 1 : 0;
$replasepost = '';
if ((isset($_GET['conf']) && is_numeric($_GET['conf'])) || (isset($_GET['konftop']) && is_numeric($_GET['konftop'])) || $Movemess == 1) {
$data = db::c()->query('SELECT * FROM `forum` WHERE `parent` = 0 AND `type` = 1 ORDER BY `id` ASC');
while ($row = $data->fetch_assoc()) {
if ($row['id'] == 228043095) {
$news_topic = true;
}
if (($row['min_align'] == 0 && $row['max_align'] == 0) || ($user['align'] >= $row['min_align'] && $user['align'] <= $row['max_align']) || $user['align'] == '1.99' || $user['admin'] == '1' || $user['align'] == '10') {
$replasepost .= "<option value='" . $row['id'] . "'>" . $row['topic'] . "</option>";
$min = $row['min_align'] == 0;
$max = $row['max_align'] == 0;
if (!isset($user['id']) || (($user['align'] < $row['min_align']) || ($user['align'] > $row['max_align']) && !$min && !$max) && $user['align'] != '2.99') {
echo '<nobr><b>&nbsp;&nbsp; <img src="i/static/img/ic_acc1.gif" width="10" height="10" title="Только для чтения" />';
} else {
echo '<nobr><b>&nbsp;&nbsp; <img src="i/static/img/ic_acc4.gif" width="10" height="10" title="Разрешено добавлять ответы и создавать топики" />&nbsp;';
}
echo '<a href="?conf=' . $row['id'] . '">' . $row['topic'] . '</a><br /></b></nobr>';
}
}
}
?>
</td>
<td rowspan="2" style="padding-left: 10px;">
<?php
function parse_bb_code($text)
{
function parse_bb_code($text)
{
$bbCodes = array(
// Стандартные BB коды
'/\[(\/?)(b|i|u|s)\s*\]/' => "<$1$2>",
@ -257,10 +194,10 @@ if (isset($_GET['topic']) && is_numeric($_GET['topic']) && $_GET['topic'] == 228
$text = close_dangling_tags($text);
return $text;
}
}
function close_dangling_tags($html)
{
function close_dangling_tags($html)
{
preg_match_all("#<([a-z]+)( .*)?(?!/)>#iU", $html, $result);
$openedtags = $result[1];
preg_match_all("#</([a-z]+)>#iU", $html, $result);
@ -280,9 +217,9 @@ if (isset($_GET['topic']) && is_numeric($_GET['topic']) && $_GET['topic'] == 228
}
}
return $html;
}
}
if (isset($_POST['add']) && isset($user['id'])) {
if (isset($_POST['add']) && isset($user['id'])) {
$icon = htmlentities($_POST['icon'], ENT_NOQUOTES, 'utf8');
$text2 = htmlspecialchars($_POST['title'], ENT_NOQUOTES, 'utf8');
@ -291,15 +228,18 @@ if (isset($_GET['topic']) && is_numeric($_GET['topic']) && $_GET['topic'] == 228
$minmax = db::c()->query('SELECT `min_align`, `max_align` FROM `forum` WHERE `id` = ?i', $_GET['conf'])->fetch_assoc();
$min_align = $minmax['min_align'];
$max_align = $minmax['max_align'];
if (!isset($_POST['text']) || !isset($_POST['title']) || $_POST['title'] == "" || $_POST['title'] == " " || $_POST['text'] == "" || $_POST['text'] == " ") {
rtrim($_POST['title']);
rtrim($_POST['text']);
if (empty($_POST['text']) || empty($_POST['title'])) {
$error = "Заголовок или текст не могут быть пустыми!";
} elseif (($minmax['min_align'] == 0 && $minmax['max_align'] == 0) || ($user['align'] >= $minmax['min_align'] && $user['align'] <= $minmax['max_align']) || $dostupSovet) {
} elseif (($minmax['min_align'] == 0 && $minmax['max_align'] == 0) || ($user['align'] >= $minmax['min_align'] && $user['align'] <= $minmax['max_align']) || $isAdmin) {
if ($user['invis'] == 1) {
$userPost = '<b>Невидимка</b>';
} else {
$userPost = nick::id($user['id'])->full(1);
}
if ($dostupPal == false) $text1 = strip_tags($text1, '<b><i><u><code><a><br><img><div>');
if ($isModerator == false) $text1 = strip_tags($text1, '<b><i><u><code><a><br><img><div>');
db::c()->query('INSERT INTO `forum` (`type`, `topic`, `text`, `parent`, `author`, `date`, `min_align`, `max_align`, `icon`) VALUES (2,"?s","?s",?i,"?s","?s","?s","?s","?s")', $text2, $text1, $_GET['conf'], $userPost, date('d.m.y H:i:s'), $min_align, $max_align, $icon);
$topic_id = db::c()->getLastInsertId();
@ -310,9 +250,9 @@ if (isset($_GET['topic']) && is_numeric($_GET['topic']) && $_GET['topic'] == 228
$error = "Вы не можете писать в этой конференции!";
}
unset($_POST['add']);
}
}
if (isset($_POST['add2']) && isset($user['id'])) {
if (isset($_POST['add2']) && isset($user['id'])) {
$text2 = htmlspecialchars($_POST['title'], ENT_NOQUOTES, 'utf8');
$text1 = parse_bb_code(preg_replace("/\n/", "<br />", $_POST['text']));
@ -320,20 +260,21 @@ if (isset($_GET['topic']) && is_numeric($_GET['topic']) && $_GET['topic'] == 228
$min_align = $minmax['min_align'];
$max_align = $minmax['max_align'];
if (!isset($_POST['text']) || $_POST['text'] == "" || $_POST['text'] == " ") {
rtrim($_POST['text']);
if (empty($_POST['text'])) {
$error = "Текст не может быть пустыми";
} elseif (!is_numeric($_GET['topic'])) {
$error = "Не надо так делать";
}
if (($minmax['min_align'] == 0 && $minmax['max_align'] == 0) || ($user['align'] >= $minmax['min_align'] && $user['align'] <= $minmax['max_align']) && $minmax['close'] == "0" || $dostupSovet) {
if (($minmax['min_align'] == 0 && $minmax['max_align'] == 0) || ($user['align'] >= $minmax['min_align'] && $user['align'] <= $minmax['max_align']) && $minmax['close'] == "0" || $isAdmin) {
if ($user['invis'] == 1) {
$userPost = '<b>Невидимка</b>';
} else {
$userPost = nick::id($user['id'])->full(1);
}
if ($dostupPal == false) {
if ($isModerator == false) {
$text1 = strip_tags($text1, '<b><i><u><code><a><br><img><div>');
}
@ -352,25 +293,25 @@ if (isset($_GET['topic']) && is_numeric($_GET['topic']) && $_GET['topic'] == 228
$error = "Вы не можете писать в этой конференции!";
}
unset($_POST['add2']);
}
}
if (isset($_GET['dp']) && $dostupPal == true) {
if (isset($_GET['dp']) && $isModerator == true) {
if ($_GET['dp'] > 100) {
db::c()->query('DELETE FROM `forum` WHERE `id` = ?i OR `parent` = ?i', $_GET['dp'], $_GET['dp']);
echo "<script>window.location='?topic=" . $_GET['topic'] . "&page=" . $_GET['page'] . "'</script>";
exit();
}
}
}
if (isset($_GET['dt']) && $dostupPal == true) {
if (isset($_GET['dt']) && $isModerator == true) {
if ($_GET['dt'] > 100) {
db::c()->query('DELETE FROM `forum` WHERE `id` = ?i OR `parent` = ?i', $_GET['dt'], $_GET['dt']);
echo "<script>window.location='?conf=" . $_GET['conf'] . "&rnd'</script>";
exit();
}
}
}
if (isset($_GET['com']) && isset($_GET['cpr']) && $dostupPal == true) {
if (isset($_GET['com']) && isset($_GET['cpr']) && $isModerator == true) {
if ($user['invis'] == 1) {
$addText = "<br /><b>Невидимка</b>: " . $_GET['cpr'];
} else {
@ -379,9 +320,9 @@ if (isset($_GET['topic']) && is_numeric($_GET['topic']) && $_GET['topic'] == 228
db::c()->query('UPDATE `forum` SET `text` = CONCAT(`text`,"?s") WHERE `id` = ?i', $addText, $_GET['com']);
echo "<script>window.location='?topic=" . $_GET['topic'] . "&rnd'</script>";
exit();
}
}
if (isset($_GET['do']) && $dostupPal == true) {
if (isset($_GET['do']) && $isModerator == true) {
if ($_GET['do'] == "open") {
db::c()->query('UPDATE `forum` SET `close` = 0 WHERE `id` = "?s"', $_GET['topic']);
echo "<script>window.location='?topic=" . $_GET['topic'] . "&rnd'</script>";
@ -389,7 +330,7 @@ if (isset($_GET['topic']) && is_numeric($_GET['topic']) && $_GET['topic'] == 228
}
if ($_GET['do'] == "close") {
$closeComment = "Обсуждение закрыл " . ($user['admin'] == 1) ? "<b>Администратор</b>" : nick::id($user['id'])->full(1);
$closeComment = "Обсуждение закрыл " . ($isAdmin) ? "<b>Администратор</b>" : nick::id($user['id'])->full(1);
db::c()->query('UPDATE `forum` SET `close` = 1, `closepal` = "?s" WHERE `id` = "?s"', $closeComment, $_GET['topic']);
echo "<script>window.location='?topic=" . $_GET['topic'] . "&rnd'</script>";
exit();
@ -406,19 +347,63 @@ if (isset($_GET['topic']) && is_numeric($_GET['topic']) && $_GET['topic'] == 228
echo "<script>window.location='?topic=" . $_GET['topic'] . "&rnd'</script>";
exit();
}
}
}
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Форум</title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/forum.css"/>
<link rel="stylesheet" href="css/wysibb/theme/default/wbbtheme.css"/>
<link rel='stylesheet' href="css/contact.css" media='screen'/>
<script type="text/javascript" language="JavaScript" src="js/jquery.min.js"></script>
<script type="text/javascript" language="JavaScript" src="js/jquery.wysibb-1.3.0.js"></script>
<script type="text/javascript" language="JavaScript" src='js/forum.js'></script>
<script type='text/javascript' src='js/jquery.simplemodal.js'></script>
<script type='text/javascript' src='js/contact.js'></script>
</head>
<body>
<h1>Форум</h1>
<a href="/"> на главную</a>
<table width="100%" border="0">
<tr valign="top">
<td width="200">
<br/>
<?php if (isset($user['id'])) echo "Игрок : " . nick::id($user['id'])->full(1) . "<br />"; ?>
<h4>Конференции</h4>
<?php
if ((isset($_GET['conf']) && is_numeric($_GET['conf'])) || (isset($_GET['konftop']) && is_numeric($_GET['konftop'])) || $Movemess == 1) {
$data = db::c()->query('SELECT * FROM `forum` WHERE `parent` = 0 AND `type` = 1 ORDER BY `id` ASC');
while ($row = $data->fetch_assoc()) {
if (($row['min_align'] == 0 && $row['max_align'] == 0) || ($user['align'] >= $row['min_align'] && $user['align'] <= $row['max_align']) || $isAdmin) {
$replasepost .= "<option value='" . $row['id'] . "'>" . $row['topic'] . "</option>";
$min = $row['min_align'] == 0;
$max = $row['max_align'] == 0;
if (!isset($user['id']) || (($user['align'] < $row['min_align']) || ($user['align'] > $row['max_align']) && !$min && !$max)) {
echo '<nobr><b>&nbsp;&nbsp;📕';
} else {
echo '<nobr><b>&nbsp;&nbsp;📖&nbsp;';
}
echo '<a href="?conf=' . $row['id'] . '">' . $row['topic'] . '</a><br /></b></nobr>';
}
}
}
?>
</td>
<td rowspan="2" style="padding-left: 10px;">
<?php
if (!isset($_GET['conf'])) {
$row = db::c()->query('SELECT * FROM `forum` WHERE `id` = "?s"', $_GET['topic'])->fetch_assoc();
if (($row['min_align'] == 0 && $row['max_align'] == 0) || ($user['align'] >= $row['min_align'] && $user['align'] <= $row['max_align']) || $user['admin'] == "1") {
if (($row['min_align'] == 0 && $row['max_align'] == 0) || ($user['align'] >= $row['min_align'] && $user['align'] <= $row['max_align']) || $isAdmin) {
$top = $row['parent'];
$parentCat = db::c()->query('SELECT * FROM `forum` WHERE `id` = ?i', $top)->fetch_assoc();
$icons = $row['icon'];
?>
<div align="center"><br/>
<h3 style="display:inline;text-align:center;border-bottom:dotted 1px #000;">
<a href="forum.php?conf=<?= $top ?>">Конференция "<?= $parentCat['topic'] ?>"</a>
</h3>
<h3><a href="forum.php?conf=<?= $top ?>">Конференция "<?= $parentCat['topic'] ?>"</a></h3>
<? if (isset($error)) err($error); ?>
</div>
<?
@ -437,16 +422,20 @@ if (isset($_GET['topic']) && is_numeric($_GET['topic']) && $_GET['topic'] == 228
$fix = "<a href='?topic={$_GET['topic']}&do=fix'>Прикрепить</a>";
}
if ($dostupPal == true) {
echo '<br />
if ($isModerator == true) {
?>
<br>
<div align="right">
<small>
<img src="i/close2.gif" />' . $close . ' | <img src="i/ico/fixed.gif" width="12" />' . $fix . '
<img src="i/close2.gif"><?= $close ?> | <img src="i/ico/fixed.gif"><?= $fix ?>
</small>
<br /><br />
';
echo "<select id='seltopic" . $_GET['topic'] . "'>" . $replasepost . "</select> <input type='button' value='Переместить' onClick=\"replasetopic(" . $_GET['konftop'] . ", " . $_GET['topic'] . ")\"></div>";
if (isset($_POST['selectt'], $_POST['numt']) && $_POST['selectt'] != '' && $_POST['numt'] != '') {
<br><br>
<select id="seltopic<?= $_GET['topic'] ?>"><?= $replasepost ?></select>
<input type="button" value="Переместить"
onClick="replasetopic(<?= $_GET['konftop'] ?>, <?= $_GET['topic'] ?>)">
</div>
<?php
if (!empty($_POST['selectt']) AND !empty($_POST['numt'])) {
$error = "<h3>Тема перемещена.</h3><a href='forum.php?topic=" . $_POST['numt'] . "&konftop=" . $_POST['selectt'] . "'>forum.php?topic=" . $_POST['numt'] . "&konftop=" . $_POST['selectt'] . "</a>";
}
}
@ -470,13 +459,11 @@ if (isset($_GET['topic']) && is_numeric($_GET['topic']) && $_GET['topic'] == 228
$pages_str = $FirstPage . $pages_str . $LastPage;
echo $pages_str;
if ($dostupSovet == true) $edit = "<a href=\"javascript:void(0);\" class='contact' id=\"{$row['id']}\"><img src=\"i/forum/edit.png\" /></a>";
?>
<div class="rc6 mBodyBlock" id="leaf<?= $row['id'] ?>">
<span class="topicTitle">
<img height=15 src="i/forum/icon<?= $icons ?>.gif" width=15 border=0/><a
href='?'><?= $row['topic'] ?></a>
<img height=15 src="i/forum/icon<?= $icons ?>.gif" width=15 border=0/>
<a href='?'><?= $row['topic'] ?></a>
</span>
<div class="auth_str">
"<?= $row['author'] ?>"
@ -484,59 +471,64 @@ if (isset($_GET['topic']) && is_numeric($_GET['topic']) && $_GET['topic'] == 228
<a href='#' class='cite' onclick="add_cites(<?= $row['id'] ?>);" title="Цитата">
<img src="i/forum/icon13.gif"/>
</a>
<?= $edit ?>
<?php if ($isAdmin): ?>
<a href="javascript:void(0);" class="contact" id="<?= $row['id'] ?>"><img
src="i/forum/edit.png"></a>
<?php endif; ?>
<?php if ($isModerator AND isset($_GET['conf']) AND isset($_GET['page'])): ?>
<a href="?topic=<?= $_GET['topic'] ?>&konftop=<?= htmlspecialchars($_GET['conf']) ?>&page=<?= $_GET['page'] ?>&dp=<?= $row['id'] ?>">
<img src="i/clear.gif">
</a>
<a onclick="var obj; if (obj = prompt('Введите комментарий','')) { window.location='forum.php?topic=<?= $_GET['topic'] ?>&konftop=<?= htmlspecialchars($_GET['conf']) ?>&page=<?= $_GET['page'] ?>&cpr='+obj+'&com=<?= $row['id'] ?>'; }"
href='#'>
<img src="i/forum/icon4.gif" title="Комментарий">
</a>
<?php endif; ?>
<br>
<br>
</div>
<span><?= $row['text'] ?></span>
</div>
<?php
if ($dostupPal == true && $news_topic == false AND isset($_GET['conf']) AND isset($_GET['page'])) {
echo " <a href='?topic=" . $_GET['topic'] . "&konftop=" . htmlspecialchars($_GET['conf']) . "&page=" . $_GET['page'] . "&dp=" . $row['id'] . "'><img src='i/clear.gif'></a>";
echo " <a onclick='var obj; if (obj = prompt(\"Введите комментарий\",\"\")) { window.location=\"forum.php?topic=" . $_GET['topic'] . "&konftop=" . htmlspecialchars($_GET['conf']) . "&page=" . $_GET['page'] . "&cpr=\"+obj+\"&com=" . $row['id'] . "\"; }' href='#'><img src=\"http://capitalcity.old-dark.rui/forum/icon4.gif\" title=\"Комментарий\" /></a>";
}
echo "<br /><br /></div>";
echo " <span>" . $row['text'] . "</span></div></div>";
$sort_type = 'ASC';
if (isset($_GET['topic']) && is_numeric($_GET['topic']) && $_GET['topic'] == 228043095) {
$sort_type = 'DESC';
}
if (empty($_GET['page'])) $_GET['page'] = "";
#$data = mysql_query("SELECT * FROM `forum` WHERE `parent` = '" . mysql_real_escape_string($_GET['topic']) . "' ORDER by `id` {$sort_type} LIMIT " . (int)($_GET['page'] * 20) . ",20");
$data = db::c()->query('SELECT * FROM `forum` WHERE `parent` = "?s" ORDER BY "?s" LIMIT ?i,20', $_GET['topic'], $sort_type, ($_GET['page'] * 20));
while ($row = $data->fetch_assoc()) {
echo "<div class=\"rc6 mBodyBlock\" id=\"leaf{$row['id']}\"><div ><div class=\"mesTopBar\">
<table width=\"100%\" >
$data = db::c()->query('SELECT * FROM `forum` WHERE `parent` = "?s" ORDER BY `id` ASC LIMIT ?i,20', $_GET['topic'], ($_GET['page'] * 20));
while ($row = $data->fetch_assoc()): ?>
<div class="rc6 mBodyBlock" id="leaf<?= $row['id'] ?>">
<div class="mesTopBar">
<table width="100%">
<tr>
<td>
" . $row['author'] . " <span class=\"date\">(" . $row['date'] . ")</span>
";
if ($dostupSovet == true) {
$edit = "<a href=\"javascript:void(0);\" class='contact' id=\"{$row['id']}\"><img src=\"i/forum/edit.png\" /></a>";
}
if ($dostupPal == true && $news_topic == false) {
echo " <a href='?topic={$_GET['topic']}&konftop=" . htmlspecialchars($_GET['conf']) . "&page=" . $_GET['page'] . "&dp={$row['id']}'><img src='i/clear.gif'></a>";
echo " <a onclick='var obj; if (obj = prompt(\"Введите комментарий\",\"\")) { window.location=\"forum.php?topic=" . $_GET['topic'] . "&konftop=" . htmlspecialchars($_GET['conf']) . "&page=" . $_GET['page'] . "&cpr=\"+obj+\"&com=" . $row['id'] . "\"; }' href='#'><img src=\"http://capitalcity.old-dark.rui/forum/icon4.gif\" title=\"Комментарий\" /></a>";
}
echo " </td>
<td align='right'>
<a href='javascript:void(0);' class='quote_btn' onclick='return add_cites(\"{$row['id']}\");' alt=\"Цитата\" title=\"Цитата\">
<img src=\"i/forum/icon13.gif\" />
<?= $row['author'] ?> <span class="date">(<?= $row['date'] ?>)</span>
<?php if ($isModerator): ?>
<a href="?topic=<?= $_GET['topic'] ?>&konftop=<?= htmlspecialchars($_GET['conf']) ?>&page=<?= $_GET['page'] ?>&dp=<?= $row['id'] ?>">
<img src="i/clear.gif">
</a>
$edit
<a onclick="var obj; if (obj = prompt('Введите комментарий','')) { window.location='forum.php?topic=<?= $_GET['topic'] ?>&konftop=<?= htmlspecialchars($_GET['conf']) ?>&page=<?= $_GET['page'] ?>&cpr='+obj+'&com=<?= $row['id'] ?>'; }"
href='#'>
<img src="i/forum/icon4.gif" title="Комментарий">
</a>
<?php endif; ?>
</td>
<td align="right">
<a href="javascript:void(0);" class="quote_btn"
onclick="return add_cites(<?= $row['id'] ?>);" alt="Цитата"
title="Цитата">
<img src="i/forum/icon13.gif">
</a>
<?php if ($isAdmin): ?>
<a href="javascript:void(0);" class="contact"
id="<?= $row['id'] ?>"><img
src="i/forum/edit.png"></a>
<?php endif; ?>
</td>
</tr>
</table></div>
";
echo " <span>" . ($row['text']) . "</span>
</table>
</div>
<span><?= $row['text'] ?></span>
</div>
";
}
<?php
endwhile;
if ($pgs > 1) {
echo "<img src=i/ico/news.gif width=\"16\" height=\"16\" /> Страницы : ";
}
@ -544,10 +536,10 @@ if (isset($_GET['topic']) && is_numeric($_GET['topic']) && $_GET['topic'] == 228
$closed = '';
$closepal = '';
if (($closed == 1 && $_GET['topic'] != 228043095)) {
if ($closed == 1) {
echo "<br /><div align=center>" . $closepal . "</div><br /><br />";
} else {
if (isset($user['baned']) AND $user['baned'] == 1) {
if (!empty($user['block'])) {
$error = "<br /><br /><b>Заблокированным персонажам запрещено писать на форуме!</b><br /><br />";
} elseif ($user['level'] < 2) {
$error = "<br /><br /><b>Персонажам до 2-го уровня запрещено писать на форуме!</b><br /><br />";
@ -559,11 +551,8 @@ if (isset($_GET['topic']) && is_numeric($_GET['topic']) && $_GET['topic'] == 228
<form method=POST
action="forum.php?topic=<?= $_GET['topic'] ?>&konftop=<?= $_GET['conf'] ?>&page=<?= $_GET['page'] ?>"
name="F1">
<table width="100%">
<tr>
<td align="center"><br/>
<table bgcolor="F6E5B1" cellspacing="0" cellpadding="5"
style="border: 1px outset;">
<table bgcolor="F6E5B1" cellpadding="5" style="border: 1px outset;">
<tr>
<td colspan="2">
<h4 id="response">Оставить комментарий</h4>
@ -571,9 +560,6 @@ if (isset($_GET['topic']) && is_numeric($_GET['topic']) && $_GET['topic'] == 228
</tr>
<tr>
<td colspan="2">
<table width="100%">
<tr>
<td align="center">
<textarea class="inup" id="answer" rows="12" name="text"
cols="84" wrap="virtual"
onselect="storeCaret(this);"
@ -582,20 +568,14 @@ if (isset($_GET['topic']) && is_numeric($_GET['topic']) && $_GET['topic'] == 228
onchange="storeCaret(this);"></textarea>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="right"><input type="submit" class="btn"
value="Добавить" name="add2">
<div class="page" id="<?= $ps; ?>"
style="display: none;"></div>
</td>
</tr>
</table>
<td align="right">
<input type="submit" class="btn" value="Добавить" name="add2">
<div class="page" id="<?= $ps; ?>" style="display: none;"></div>
</td>
</tr>
</table>
<input type="hidden" value="index" name="n"/>
<input type="hidden" value="73991290635595" name="id"/>
<input type="hidden" value="add_com" name="act"/>
@ -605,17 +585,13 @@ if (isset($_GET['topic']) && is_numeric($_GET['topic']) && $_GET['topic'] == 228
value="9c84c2b3d7e44a2b82928fd840ec97d7"/>
</form>
<?
} else {
echo "<br /><br />";
}
}
} else {
echo "Тема удалена с форума, либо её не существует<br />";
}
} else echo "Тема удалена с форума, либо её не существует.<br>";
}
} else {
if (is_numeric($_GET['conf']) && $row = db::c()->query('SELECT * FROM `forum` WHERE `id` = ?i', $_GET['conf'])->fetch_assoc()) {
if (($row['min_align'] == 0 && $row['max_align'] == 0) || ($user['align'] >= $row['min_align'] && $user['align'] <= $row['max_align']) || $dostupSovet) {
if (($row['min_align'] == 0 && $row['max_align'] == 0) || ($user['align'] >= $row['min_align'] && $user['align'] <= $row['max_align']) || $isAdmin) {
?>
<td rowspan="2" style="padding-left: 10px">
@ -663,7 +639,6 @@ if (isset($_GET['topic']) && is_numeric($_GET['topic']) && $_GET['topic'] == 228
</tr>
</table>
<?php
#$data = mysql_query("SELECT * FROM `forum` WHERE `parent` = '" . mysql_real_escape_string($_GET['conf']) . "' ORDER BY `fix` DESC, `updated` DESC LIMIT " . (INT)($_GET['page'] * 20) . ",20;");
$data = db::c()->query('SELECT * FROM `forum` WHERE `parent` = "?s" ORDER BY `fix` DESC, `updated` DESC LIMIT ?i,20', $_GET['conf'], ($_GET['page'] * 20));
while ($row = $data->fetch_assoc()) {
$logi = '';
@ -704,7 +679,7 @@ if (isset($_GET['topic']) && is_numeric($_GET['topic']) && $_GET['topic'] == 228
echo "'><IMG height=15 src=\"i/forum/icon{$icons}.gif\" width=15 border=0> {$row['topic']}</a> " . $pages_str1 . "<nobr>&nbsp;{$row['author']}</nobr>";
if ($dostupPal == true && $row['id'] != 228043095) {
if ($isModerator == true && $row['id'] != 228043095) {
echo " <a href='?conf={$_GET['conf']}&dt={$row['id']}'><img src='i/clear.gif'></a>";
}
@ -717,15 +692,13 @@ if (isset($_GET['topic']) && is_numeric($_GET['topic']) && $_GET['topic'] == 228
}
echo $pages_str . "</p>";
if ($user['baned'] == 1) {
$error = "<br /><br /><b>Заблокированным персонажам запрещено писать на форуме!</b><br /><br />";
if (!empty($user['block'])) {
$error = "Вы заблокированы!";
} elseif ($user['level'] < 2) {
$error = "<br /><br /><b>Персонажам до 4-го уровня запрещено писать на форуме!</b><br /><br />";
$error = "Персонажам до 2-го уровня запрещено писать на форуме!";
} elseif (isset($sleep['id'])) {
$error = "<br /><br /><b>Персонажам с заклинанием форумного молчания запрещено писать на форуме!</b><br /><br />";
} elseif ($user['level'] > 1 && !isset($sleep['id'])) {
$error = "Вы молчите!";
} else {
?>
<a name="answer"></a>
<br/>
@ -778,24 +751,21 @@ if (isset($_GET['topic']) && is_numeric($_GET['topic']) && $_GET['topic'] == 228
</table>
</form>
<?
} else {
echo "<br /><br />";
}
}
} else echo ' <div style="width: 300px; margin: auto; font-weight: bold;">Ничего не найдено!</div> ';
}
?>
<!-- End of text -->
</td>
</tr>
</table>
<?php if ($dostupPal == true) { ?>
<form name='repltopic' method='post' action="">
<?php if ($isModerator == true): ?>
<form name='repltopic' method='post'>
<input type='hidden' id='selectt' name='selectt'/>
<input type='hidden' id='numt' name='numt'/>
</form>
<? } ?>
<? endif; ?>
</body>
</html>