Moderator options
This commit is contained in:
parent
ff8e6b818f
commit
6a57db8588
77
forum.php
77
forum.php
@ -498,7 +498,8 @@ if (isset($_GET['do']) && $isModerator == true) {
|
||||
</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='#'>
|
||||
| <small>Комментарий</small>
|
||||
|
|
||||
<small>Комментарий</small>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</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 (($row['min_align'] == 0 && $row['max_align'] == 0) || ($user['align'] >= $row['min_align'] && $user['align'] <= $row['max_align']) || $isAdmin) {
|
||||
$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;
|
||||
$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);
|
||||
?>
|
||||
<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 ?>
|
||||
</div>
|
||||
<?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));
|
||||
while ($row = $data->fetch_assoc()) {
|
||||
$logi = '';
|
||||
$userlist = '';
|
||||
$icons = $row['icon'];
|
||||
$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']);
|
||||
while ($row2 = $data2->fetch_assoc()) {
|
||||
$userlist = strip_tags($row2[0], "");
|
||||
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"];
|
||||
$lasttimedb = db::c()->query('SELECT `date` FROM `forum` WHERE `parent` = ?i ORDER BY `id` DESC', $row['id'])->fetch_assoc();
|
||||
$lasttime = $lasttimedb['date'];
|
||||
echo "<div class=\"mBodyBlock rounded rc6\">
|
||||
if (!empty($_GET['conf']) AND !empty($_GET['page'])) {
|
||||
$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 = '';
|
||||
$userlist = '';
|
||||
$icons = $row['icon'];
|
||||
$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']);
|
||||
while ($row2 = $data2->fetch_row()) {
|
||||
$userlist = strip_tags($row2[0], "");
|
||||
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"];
|
||||
$lasttimedb = db::c()->query('SELECT `date` FROM `forum` WHERE `parent` = ?i ORDER BY `id` DESC', $row['id'])->fetch_assoc();
|
||||
$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'];
|
||||
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 = $pgs1[0] / 20;
|
||||
$pages_str1 = '';
|
||||
$page1 = (int)$_GET['page'] > 0 ? (((int)$_GET['page'] + 1) > $pgs ? ($pgs - 1) : (int)$_GET['page']) : 0;
|
||||
$page1 = ceil($page1);
|
||||
if ($pgs1 > 1) {
|
||||
for ($i = 0; $i < ceil($pgs1); $i++)
|
||||
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 .= ($page1 < $pgs1 - 5 ? " ..." : "");
|
||||
}
|
||||
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>";
|
||||
}
|
||||
$pgs1 = db::c()->query('SELECT count(`id`) FROM `forum` WHERE `parent` = ?i', $row['id'])->fetch_assoc();
|
||||
$pgs1 = $pgs1[0] / 20;
|
||||
$pages_str1 = '';
|
||||
$page1 = (int)$_GET['page'] > 0 ? (((int)$_GET['page'] + 1) > $pgs ? ($pgs - 1) : (int)$_GET['page']) : 0;
|
||||
$page1 = ceil($page1);
|
||||
if ($pgs1 > 1) {
|
||||
for ($i = 0; $i < ceil($pgs1); $i++)
|
||||
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 .= ($page1 < $pgs1 - 5 ? " ..." : "");
|
||||
}
|
||||
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>";
|
||||
}
|
||||
|
||||
echo "'><IMG height=15 src=\"i/forum/icon{$icons}.gif\" width=15 border=0> {$row['topic']}</a> " . $pages_str1 . "<nobr> {$row['author']}</nobr>";
|
||||
echo "'><IMG height=15 src=\"i/forum/icon{$icons}.gif\" width=15 border=0> {$row['topic']}</a> " . $pages_str1 . "<nobr> {$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>
|
||||
</p></div>";
|
||||
}
|
||||
}
|
||||
if ($pgs > 1) echo "<p><img src=i/ico/news.gif width=\"16\" height=\"16\" /> Страницы:";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user