diff --git a/forum.php b/forum.php index d8bbc00..d808f6f 100644 --- a/forum.php +++ b/forum.php @@ -498,7 +498,8 @@ if (isset($_GET['do']) && $isModerator == true) { - | Комментарий + | + Комментарий @@ -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); ?>
" . ($row['fix'] ? " " : "") . "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 ? "" . ($i + 1) . "" : "" . ($i + 1) . "");
- $pages_str1 .= ($page1 < $pgs1 - 5 ? " ..." : "");
- }
- if ($pgs1 > 1) {
- $pages_str1 = "
" . $row['date'] . " " . strip_tags(substr($row['text'], 0, 250), "") . "
+ echo "
" . $row['date'] . " " . strip_tags(substr($row['text'], 0, 250), "") . "
Ответов: " . $count . " (" . $lasttime . ")
Страницы:";