This commit is contained in:
Roman Kelesidis 2025-08-06 21:30:33 +07:00 committed by GitHub
commit 422cf63dba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 22 additions and 2 deletions

View file

@ -235,6 +235,7 @@ if ($log_rowset) {
case $log_type['mod_post_pin']:
case $log_type['mod_post_unpin']:
case $log_type['mod_topic_split']:
case $log_type['mod_topic_attach_updated']:
// topic_title
if (!empty($row['log_topic_title'])) {
$topic_title = $row['log_topic_title'];

View file

@ -2825,6 +2825,7 @@ $lang['LOG_ACTION']['LOG_TYPE'] = [
'mod_topic_tor_unregister' => 'Topic:<br /> <b>torrent unregistered</b>',
'mod_topic_tor_register' => 'Topic:<br /> <b>torrent registered</b>',
'mod_topic_tor_delete' => 'Topic:<br /> <b>torrent deleted</b>',
'mod_topic_attach_updated' => 'Topic:<br /> <b>attachment updated</b>',
'mod_topic_renamed' => 'Topic:<br /> <b>renamed</b>',
'mod_post_delete' => 'Post:<br /> <b>deleted</b>',
'mod_post_pin' => 'Post:<br /> <b>pinned</b>',

View file

@ -372,6 +372,16 @@ if (($delete || $mode == 'delete') && !$confirm) {
if (!$error_msg) {
\TorrentPier\Legacy\Post::user_notification($mode, $post_data, $post_info['topic_title'], $forum_id, $topic_id, $notify_user);
if (defined('ATTACHMENT_UPDATED') && ATTACHMENT_UPDATED['status']) {
global $log_action;
$log_action->mod('mod_topic_attach_updated', [
'forum_id' => $forum_id,
'topic_id' => $topic_id,
'topic_title' => $post_info['topic_title'],
'log_msg' => sprintf('Attachment type: %s', ATTACHMENT_UPDATED['attachment_type'])
]);
}
}
if ($mode == 'newtopic' || $mode == 'reply') {

View file

@ -475,18 +475,25 @@ class Attach
// Delete the Old Attachment
unlink_attach($row['physical_filename']);
$attachment_type = $lang['ATTACHMENT'];
if ((int)$row['thumbnail'] === 1) {
unlink_attach($row['physical_filename'], MODE_THUMBNAIL);
$attachment_type = $lang['ATTACHMENT_THUMBNAIL'];
}
// todo: log action - torrent updated
//bt
if ($this->attachment_extension_list[$actual_element] === TORRENT_EXT && $attachments[$actual_element]['tracker_status']) {
Torrent::tracker_unregister($attachment_id);
$attachment_type = $lang['TORRENT'];
}
//bt end
\define('ATTACHMENT_UPDATED', [
'status' => true,
'attachment_type' => $attachment_type
]);
// Make sure it is displayed
$this->attachment_list[$actual_element] = $this->attach_filename;
$this->attachment_comment_list[$actual_element] = $comment;

View file

@ -35,6 +35,7 @@ class LogAction
'mod_topic_tor_unregister' => 17,
'mod_topic_tor_register' => 18,
'mod_topic_tor_delete' => 19,
'mod_topic_attach_updated' => 20,
];
public $log_type_select = [];
public $log_disabled = false;