mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 22:03:49 -07:00
feat(log action): Show torrent delete
action (#2061)
* feat(log action): Show `torrent delete` action * Update Torrent.php * Update admin_log.php
This commit is contained in:
parent
66c01a591f
commit
f80cad0c6f
4 changed files with 11 additions and 1 deletions
|
@ -229,6 +229,7 @@ if ($log_rowset) {
|
||||||
case $log_type['mod_topic_change_tor_type']:
|
case $log_type['mod_topic_change_tor_type']:
|
||||||
case $log_type['mod_topic_tor_unregister']:
|
case $log_type['mod_topic_tor_unregister']:
|
||||||
case $log_type['mod_topic_tor_register']:
|
case $log_type['mod_topic_tor_register']:
|
||||||
|
case $log_type['mod_topic_tor_delete']:
|
||||||
case $log_type['mod_topic_renamed']:
|
case $log_type['mod_topic_renamed']:
|
||||||
case $log_type['mod_post_delete']:
|
case $log_type['mod_post_delete']:
|
||||||
case $log_type['mod_post_pin']:
|
case $log_type['mod_post_pin']:
|
||||||
|
|
|
@ -2824,6 +2824,7 @@ $lang['LOG_ACTION']['LOG_TYPE'] = [
|
||||||
'mod_topic_change_tor_type' => 'Topic:<br /> <b>changed torrent type</b>',
|
'mod_topic_change_tor_type' => 'Topic:<br /> <b>changed torrent type</b>',
|
||||||
'mod_topic_tor_unregister' => 'Topic:<br /> <b>torrent unregistered</b>',
|
'mod_topic_tor_unregister' => 'Topic:<br /> <b>torrent unregistered</b>',
|
||||||
'mod_topic_tor_register' => 'Topic:<br /> <b>torrent registered</b>',
|
'mod_topic_tor_register' => 'Topic:<br /> <b>torrent registered</b>',
|
||||||
|
'mod_topic_tor_delete' => 'Topic:<br /> <b>torrent deleted</b>',
|
||||||
'mod_topic_renamed' => 'Topic:<br /> <b>renamed</b>',
|
'mod_topic_renamed' => 'Topic:<br /> <b>renamed</b>',
|
||||||
'mod_post_delete' => 'Post:<br /> <b>deleted</b>',
|
'mod_post_delete' => 'Post:<br /> <b>deleted</b>',
|
||||||
'mod_post_pin' => 'Post:<br /> <b>pinned</b>',
|
'mod_post_pin' => 'Post:<br /> <b>pinned</b>',
|
||||||
|
|
|
@ -34,6 +34,7 @@ class LogAction
|
||||||
'mod_topic_change_tor_type' => 16,
|
'mod_topic_change_tor_type' => 16,
|
||||||
'mod_topic_tor_unregister' => 17,
|
'mod_topic_tor_unregister' => 17,
|
||||||
'mod_topic_tor_register' => 18,
|
'mod_topic_tor_register' => 18,
|
||||||
|
'mod_topic_tor_delete' => 19,
|
||||||
];
|
];
|
||||||
public $log_type_select = [];
|
public $log_type_select = [];
|
||||||
public $log_disabled = false;
|
public $log_disabled = false;
|
||||||
|
|
|
@ -181,7 +181,7 @@ class Torrent
|
||||||
*/
|
*/
|
||||||
public static function delete_torrent($attach_id, $mode = '')
|
public static function delete_torrent($attach_id, $mode = '')
|
||||||
{
|
{
|
||||||
global $lang, $reg_mode, $topic_id;
|
global $lang, $reg_mode, $topic_id, $log_action;
|
||||||
|
|
||||||
$attach_id = (int)$attach_id;
|
$attach_id = (int)$attach_id;
|
||||||
$reg_mode = $mode;
|
$reg_mode = $mode;
|
||||||
|
@ -201,6 +201,13 @@ class Torrent
|
||||||
self::torrent_auth_check($forum_id, $poster_id);
|
self::torrent_auth_check($forum_id, $poster_id);
|
||||||
self::tracker_unregister($attach_id);
|
self::tracker_unregister($attach_id);
|
||||||
delete_attachment(0, $attach_id);
|
delete_attachment(0, $attach_id);
|
||||||
|
|
||||||
|
// Log action
|
||||||
|
$log_action->mod('mod_topic_tor_delete', [
|
||||||
|
'forum_id' => $torrent['forum_id'],
|
||||||
|
'topic_id' => $torrent['topic_id'],
|
||||||
|
'topic_title' => $torrent['topic_title'],
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue