mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-15 19:17:33 -07:00
Some code quality improvements (#1148)
This commit is contained in:
parent
ed3e28827b
commit
491c03c243
8 changed files with 13 additions and 12 deletions
|
@ -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']);
|
||||
}
|
||||
|
|
|
@ -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':
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue