From 3afe4f6f4777a147788e740aec382b2af3fd994e Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Mon, 2 Dec 2024 18:18:36 +0700 Subject: [PATCH] Update change_torrent.php --- library/ajax/change_torrent.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/library/ajax/change_torrent.php b/library/ajax/change_torrent.php index 28f39ce9..25520ff8 100644 --- a/library/ajax/change_torrent.php +++ b/library/ajax/change_torrent.php @@ -2,7 +2,7 @@ if (!defined('IN_AJAX')) die(basename(__FILE__)); -global $userdata, $bb_cfg, $lang; +global $userdata, $bb_cfg, $lang, $log_action; if (!isset($this->request['attach_id'])) { @@ -18,7 +18,7 @@ $type = (string) $this->request['type']; $torrent = DB()->fetch_row(" SELECT a.post_id, d.physical_filename, d.extension, d.tracker_status, - t.topic_first_post_id, + t.topic_first_post_id, t.topic_title, p.poster_id, p.topic_id, p.forum_id, f.allow_reg_tracker FROM @@ -62,16 +62,26 @@ switch ($type) if ($type == 'set_silver') { $tor_type = TOR_TYPE_SILVER; + $tor_type_lang = $lang['SILVER']; } elseif ($type == 'set_gold') { $tor_type = TOR_TYPE_GOLD; + $tor_type_lang = $lang['GOLD']; } else { $tor_type = 0; + $tor_type_lang = "{$lang['UNSET_GOLD_TORRENT']} / {$lang['UNSET_SILVER_TORRENT']}"; } change_tor_type($attach_id, $tor_type); + // Log action + $log_action->mod('mod_topic_change_tor_type', array( + 'forum_id' => $torrent['forum_id'], + 'topic_id' => $torrent['topic_id'], + 'topic_title' => $torrent['topic_title'], + 'log_msg' => sprintf($lang['TOR_TYPE_LOG_ACTION'], $tor_type_lang), + )); $title = $lang['CHANGE_TOR_TYPE']; $url = make_url(TOPIC_URL . $torrent['topic_id']); break; @@ -100,4 +110,4 @@ switch ($type) } $this->response['url'] = $url; -$this->response['title'] = $title; \ No newline at end of file +$this->response['title'] = $title;