Moderator options

This commit is contained in:
lopar 2018-11-01 02:05:05 +02:00
parent ff8e6b818f
commit 6a57db8588

View File

@ -498,7 +498,8 @@ if (isset($_GET['do']) && $isModerator == true) {
</a> </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'] ?>'; }" <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='#'> href='#'>
| <small>Комментарий</small> |
<small>Комментарий</small>
</a> </a>
<?php endif; ?> <?php endif; ?>
</td> </td>
@ -584,10 +585,10 @@ if (isset($_GET['do']) && $isModerator == true) {
if (is_numeric($_GET['conf']) && $row = db::c()->query('SELECT * FROM `forum` WHERE `id` = ?i', $_GET['conf'])->fetch_assoc()) { 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']) || $isAdmin) { if (($row['min_align'] == 0 && $row['max_align'] == 0) || ($user['align'] >= $row['min_align'] && $user['align'] <= $row['max_align']) || $isAdmin) {
$confname = 'Конференция «' . $row['topic'] . '»'; $confname = 'Конференция «' . $row['topic'] . '»';
$pgs = db::c()->query('SELECT count(`id`) FROM `forum` WHERE `parent` = ?i ORDER BY `fix` DESC, `updated` DESC', $_GET['conf'])->fetch_assoc(); $pgs = db::c()->query('SELECT count(`id`) FROM `forum` WHERE `parent` = ?i ORDER BY `fix` DESC, `updated` DESC', $_GET['conf'])->fetch_row();
$pgs = $pgs[0] / 20; $pgs = $pgs[0] / 20;
$pages_str = ''; $pages_str = '';
$page = (int)$_GET['page'] > 0 ? (((int)$_GET['page'] + 1) > $pgs ? ($pgs - 1) : (int)$_GET['page']) : 0; $page = !empty((int)$_GET['page']) ? (((int)$_GET['page'] + 1) > $pgs ? ($pgs - 1) : (int)$_GET['page']) : 0;
$page = ceil($page); $page = ceil($page);
?> ?>
<td rowspan="2" style="padding-left: 10px"> <td rowspan="2" style="padding-left: 10px">
@ -614,47 +615,49 @@ if (isset($_GET['do']) && $isModerator == true) {
<img src="i/ico/news.gif" width="16" height="16"/> Страницы:<?= $pages_str ?> <img src="i/ico/news.gif" width="16" height="16"/> Страницы:<?= $pages_str ?>
</div> </div>
<?php <?php
$data = db::c()->query('SELECT * FROM `forum` WHERE `parent` = "?s" ORDER BY `fix` DESC, `updated` DESC LIMIT ?i,20', $_GET['conf'], ($_GET['page'] * 20)); if (!empty($_GET['conf']) AND !empty($_GET['page'])) {
while ($row = $data->fetch_assoc()) { $data = db::c()->query('SELECT * FROM `forum` WHERE `parent` = "?s" ORDER BY `fix` DESC, `updated` DESC LIMIT ?i,20', $_GET['conf'], ($_GET['page'] * 20));
$logi = ''; while ($row = $data->fetch_assoc()) {
$userlist = ''; $logi = '';
$icons = $row['icon']; $userlist = '';
$data2 = db::c()->query('SELECT `author` FROM (SELECT `author`,`id` FROM `forum` WHERE `parent` = ?i ORDER BY `id` DESC LIMIT 10) AS sTable ORDER BY id DESC', $row['id']); $icons = $row['icon'];
while ($row2 = $data2->fetch_assoc()) { $data2 = db::c()->query('SELECT `author` FROM (SELECT `author`,`id` FROM `forum` WHERE `parent` = ?i ORDER BY `id` DESC LIMIT 10) AS sTable ORDER BY id DESC', $row['id']);
$userlist = strip_tags($row2[0], ""); while ($row2 = $data2->fetch_row()) {
list ($username, $level) = split(" \[", $userlist); $userlist = strip_tags($row2[0], "");
$logi .= $username; list ($username, $level) = split(" \[", $userlist);
} $logi .= $username;
$datacount = db::c()->query('SELECT count(*) AS CountNumber FROM `forum` WHERE `parent` = ?i', $row['id'])->fetch_assoc(); }
$count = $datacount["CountNumber"]; $datacount = db::c()->query('SELECT count(*) AS CountNumber FROM `forum` WHERE `parent` = ?i', $row['id'])->fetch_assoc();
$lasttimedb = db::c()->query('SELECT `date` FROM `forum` WHERE `parent` = ?i ORDER BY `id` DESC', $row['id'])->fetch_assoc(); $count = $datacount["CountNumber"];
$lasttime = $lasttimedb['date']; $lasttimedb = db::c()->query('SELECT `date` FROM `forum` WHERE `parent` = ?i ORDER BY `id` DESC', $row['id'])->fetch_assoc();
echo "<div class=\"mBodyBlock rounded rc6\"> $lasttime = $lasttimedb['date'];
echo "<div class=\"mBodyBlock rounded rc6\">
<p class=pleft>" . ($row['fix'] ? "<IMG src=\"i/ico/fixed.gif\" alt=\"Закреплено\" title=\"Закреплено\" border=0> " : "") . "<a href='?topic=" . $row['id']; <p class=pleft>" . ($row['fix'] ? "<IMG src=\"i/ico/fixed.gif\" alt=\"Закреплено\" title=\"Закреплено\" border=0> " : "") . "<a href='?topic=" . $row['id'];
if (isset($_GET['conf'])) echo "&konftop=" . $_GET['conf']; if (isset($_GET['conf'])) echo "&konftop=" . $_GET['conf'];
$pgs1 = db::c()->query('SELECT count(`id`) FROM `forum` WHERE `parent` = ?i', $row['id'])->fetch_assoc(); $pgs1 = db::c()->query('SELECT count(`id`) FROM `forum` WHERE `parent` = ?i', $row['id'])->fetch_assoc();
$pgs1 = $pgs1[0] / 20; $pgs1 = $pgs1[0] / 20;
$pages_str1 = ''; $pages_str1 = '';
$page1 = (int)$_GET['page'] > 0 ? (((int)$_GET['page'] + 1) > $pgs ? ($pgs - 1) : (int)$_GET['page']) : 0; $page1 = (int)$_GET['page'] > 0 ? (((int)$_GET['page'] + 1) > $pgs ? ($pgs - 1) : (int)$_GET['page']) : 0;
$page1 = ceil($page1); $page1 = ceil($page1);
if ($pgs1 > 1) { if ($pgs1 > 1) {
for ($i = 0; $i < ceil($pgs1); $i++) for ($i = 0; $i < ceil($pgs1); $i++)
if (($i > ($page1 - 5)) && ($i <= ($page1 + 4))) if (($i > ($page1 - 5)) && ($i <= ($page1 + 4)))
$pages_str1 .= ($i == $page1 ? "<b>" . ($i + 1) . "</b>" : "<a href='?topic=" . $row['id'] . "&konftop=" . htmlspecialchars($_GET['conf']) . "&page=" . ($i) . "'>" . ($i + 1) . "</a>"); $pages_str1 .= ($i == $page1 ? "<b>" . ($i + 1) . "</b>" : "<a href='?topic=" . $row['id'] . "&konftop=" . htmlspecialchars($_GET['conf']) . "&page=" . ($i) . "'>" . ($i + 1) . "</a>");
$pages_str1 .= ($page1 < $pgs1 - 5 ? " ..." : ""); $pages_str1 .= ($page1 < $pgs1 - 5 ? " ..." : "");
} }
if ($pgs1 > 1) { if ($pgs1 > 1) {
$pages_str1 = "<nobr><img src=\"i/forum/p.gif\" width=\"10\" height=\"12\" /><small class=pages><span class=pagenum>" . $pages_str1 . "</span></small></nobr>"; $pages_str1 = "<nobr><img src=\"i/forum/p.gif\" width=\"10\" height=\"12\" /><small class=pages><span class=pagenum>" . $pages_str1 . "</span></small></nobr>";
} }
echo "'><IMG height=15 src=\"i/forum/icon{$icons}.gif\" width=15 border=0> {$row['topic']}</a> " . $pages_str1 . "<nobr>&nbsp;{$row['author']}</nobr>"; 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 ($isModerator) echo " <a href='?conf={$_GET['conf']}&dt={$row['id']}'><small>Удалить</small></a>"; if ($isModerator) echo " <a href='?conf={$_GET['conf']}&dt={$row['id']}'><small>Удалить</small></a>";
echo "<br /><span class=date>" . $row['date'] . "</span><span class=dsc> " . strip_tags(substr($row['text'], 0, 250), "") . "</span> echo "<br /><span class=date>" . $row['date'] . "</span><span class=dsc> " . strip_tags(substr($row['text'], 0, 250), "") . "</span>
<br /><small>Ответов: <b>" . $count . "</b> <span title=\"Последний ответ: " . $logi . "\" style=\"border-bottom:1px dashed grey;cursor:help;font-size:10px;\">(" . $lasttime . ")</span></small> <br /><small>Ответов: <b>" . $count . "</b> <span title=\"Последний ответ: " . $logi . "\" style=\"border-bottom:1px dashed grey;cursor:help;font-size:10px;\">(" . $lasttime . ")</span></small>
</p></div>"; </p></div>";
}
} }
if ($pgs > 1) echo "<p><img src=i/ico/news.gif width=\"16\" height=\"16\" /> Страницы:"; if ($pgs > 1) echo "<p><img src=i/ico/news.gif width=\"16\" height=\"16\" /> Страницы:";