diff --git a/library/ajax/change_tor_status.php b/library/ajax/change_tor_status.php index 2a9e9d3de..48ce9d7a7 100644 --- a/library/ajax/change_tor_status.php +++ b/library/ajax/change_tor_status.php @@ -68,7 +68,7 @@ switch ($mode) { if (!IS_ADMIN) { $this->verify_mod_rights($tor['forum_id']); } - DB()->query("UPDATE " . BB_TOPICS . " SET topic_status = " . TOPIC_UNLOCKED . " WHERE topic_id = {$tor['topic_id']}"); + DB()->query("UPDATE " . BB_TOPICS . " SET topic_status = " . TOPIC_UNLOCKED . " WHERE topic_id = {$tor['topic_id']} LIMIT 1"); } else { $this->verify_mod_rights($tor['forum_id']); } diff --git a/library/ajax/posts.php b/library/ajax/posts.php index 15612e9c4..b48f5d51d 100644 --- a/library/ajax/posts.php +++ b/library/ajax/posts.php @@ -110,7 +110,7 @@ switch ($this->request['type']) { $message = htmlCHR($message, false, ENT_NOQUOTES); $this->response['message_html'] = bbcode2html($message); - $this->response['res_id'] = @$this->request['res_id']; + $this->response['res_id'] = $this->request['res_id']; break; case 'edit': diff --git a/library/ajax/topic_tpl.php b/library/ajax/topic_tpl.php index d923345d3..3b0649130 100644 --- a/library/ajax/topic_tpl.php +++ b/library/ajax/topic_tpl.php @@ -128,7 +128,7 @@ switch ($mode) { $this->ajax_die($msg); } $sql = "UPDATE " . BB_TOPIC_TPL . " SET " . DB()->build_array('UPDATE', $sql_args) . " WHERE tpl_id = $tpl_id"; - if (!@DB()->query($sql)) { + if (!DB()->query($sql)) { $sql_error = DB()->sql_error(); } $this->response['tpl_id'] = $tpl_id; @@ -140,7 +140,7 @@ switch ($mode) { // создание нового шаблона case 'new': $sql = "INSERT INTO " . BB_TOPIC_TPL . DB()->build_array('INSERT', $sql_args); - if (!@DB()->query($sql)) { + if (!DB()->query($sql)) { $sql_error = DB()->sql_error(); } break; @@ -154,7 +154,7 @@ switch ($mode) { $this->ajax_die("нет такого форума [id: $forum_id]"); } $sql = "DELETE FROM " . BB_TOPIC_TPL . " WHERE tpl_id = $tpl_id LIMIT 1"; - if (!@DB()->query($sql)) { + if (!DB()->query($sql)) { $sql_error = DB()->sql_error(); } DB()->query("UPDATE " . BB_FORUMS . " SET forum_tpl_id = 0 WHERE forum_id = $forum_id LIMIT 1"); diff --git a/library/ajax/view_post.php b/library/ajax/view_post.php index 496a26252..163d15b83 100644 --- a/library/ajax/view_post.php +++ b/library/ajax/view_post.php @@ -13,10 +13,10 @@ if (!defined('IN_AJAX')) { global $user, $lang; -$post_id = (int)@$this->request['post_id']; -$topic_id = (int)@$this->request['topic_id']; +$post_id = isset($this->request['post_id']) ? (int)$this->request['post_id'] : null; +$topic_id = (int)$this->request['topic_id']; -if (!$post_id) { +if (is_null($post_id)) { $post_id = DB()->fetch_row("SELECT topic_first_post_id FROM " . BB_TOPICS . " WHERE topic_id = $topic_id", 'topic_first_post_id'); } diff --git a/src/Legacy/Post.php b/src/Legacy/Post.php index 4f2725c78..98bda572b 100644 --- a/src/Legacy/Post.php +++ b/src/Legacy/Post.php @@ -172,7 +172,7 @@ class Post if ($update_post_time && $mode == 'editpost' && $post_data['last_post'] && !$post_data['first_post']) { $edited_sql .= ", post_time = $current_time "; //lpt - DB()->sql_query("UPDATE " . BB_TOPICS . " SET topic_last_post_time = $current_time WHERE topic_id = $topic_id"); + DB()->sql_query("UPDATE " . BB_TOPICS . " SET topic_last_post_time = $current_time WHERE topic_id = $topic_id LIMIT 1"); } $sql = ($mode != "editpost") ? "INSERT INTO " . BB_POSTS . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, poster_rg_id, attach_rg_sig) VALUES ($topic_id, $forum_id, " . $userdata['user_id'] . ", '$post_username', $current_time, '" . USER_IP . "', $poster_rg_id, $attach_rg_sig)" : "UPDATE " . BB_POSTS . " SET post_username = '$post_username'" . $edited_sql . ", poster_rg_id = $poster_rg_id, attach_rg_sig = $attach_rg_sig WHERE post_id = $post_id"; diff --git a/styles/templates/default/index.tpl b/styles/templates/default/index.tpl index 090a27a26..58f4f0872 100644 --- a/styles/templates/default/index.tpl +++ b/styles/templates/default/index.tpl @@ -1,7 +1,7 @@
- +
@@ -41,7 +41,7 @@
- + diff --git a/styles/templates/default/tpl_config.php b/styles/templates/default/tpl_config.php index 2df77c957..5ec08fead 100644 --- a/styles/templates/default/tpl_config.php +++ b/styles/templates/default/tpl_config.php @@ -150,7 +150,6 @@ if (!empty($page_cfg['load_tpl_vars']) and $vars = array_flip($page_cfg['load_tp 'EMAIL_URL' => BB_ROOT . 'profile.php?mode=email&u=', 'FORUM_URL' => BB_ROOT . FORUM_URL, - 'ICQ_URL' => 'http://www.icq.com/people/', 'PM_URL' => BB_ROOT . PM_URL, 'PROFILE_URL' => BB_ROOT . PROFILE_URL ]); diff --git a/viewforum.php b/viewforum.php index 19bd53d4c..7dc2be57a 100644 --- a/viewforum.php +++ b/viewforum.php @@ -143,6 +143,7 @@ if (!$forum_data['forum_parent'] && isset($forums['f'][$forum_id]['subforums']) WHERE f.forum_parent = $forum_id $only_new_sql $ignore_forum_sql + GROUP BY f.forum_id ORDER BY f.forum_order "; @@ -181,6 +182,7 @@ if (!$forum_data['forum_parent'] && isset($forums['f'][$forum_id]['subforums']) $template->assign_block_vars('f', [ 'FORUM_FOLDER_IMG' => $folder_image, + 'FORUM_ID' => $sf_forum_id, 'FORUM_NAME' => $fname_html, 'FORUM_DESC' => $forums['f'][$sf_forum_id]['forum_desc'], 'U_VIEWFORUM' => FORUM_URL . $sf_forum_id,