From 6e90830eb786a34189290ef11620ecfbaa8663a7 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Wed, 30 Jul 2025 10:44:52 +0300 Subject: [PATCH] feat: Added check for frozen torrent in `playback_m3u.php` --- playback_m3u.php | 9 ++++++++- styles/templates/default/viewtopic_attach.tpl | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/playback_m3u.php b/playback_m3u.php index 3bf98fbd6..6714745af 100644 --- a/playback_m3u.php +++ b/playback_m3u.php @@ -34,7 +34,7 @@ if (!$topic_id) { } // Getting torrent info from database -$sql = 'SELECT attach_id, forum_id, info_hash, info_hash_v2 +$sql = 'SELECT attach_id, forum_id, info_hash, info_hash_v2, tor_status, poster_id FROM ' . BB_BT_TORRENTS . ' WHERE topic_id = ' . $topic_id . ' LIMIT 1'; @@ -58,6 +58,13 @@ if (!$is_auth['auth_download']) { bb_die($lang['SORRY_AUTH_VIEW_ATTACH']); } +// Check for frozen torrent +$releaser = $userdata['user_id'] == $row['poster_id']; +$tor_status = $row['tor_status']; +if (!IS_AM && isset($bb_cfg['tor_frozen'][$tor_status]) && !(isset($bb_cfg['tor_frozen_author_download'][$tor_status]) && $releaser)) { + bb_die($lang['TOR_STATUS_FORBIDDEN'] . $lang['TOR_STATUS_NAME'][$tor_status]); +} + // Parse M3U file $m3uParser = new M3uParser\M3uParser(); $m3uParser->addDefaultTags(); diff --git a/styles/templates/default/viewtopic_attach.tpl b/styles/templates/default/viewtopic_attach.tpl index 14c28862f..81df0305b 100644 --- a/styles/templates/default/viewtopic_attach.tpl +++ b/styles/templates/default/viewtopic_attach.tpl @@ -173,12 +173,14 @@

{postrow.attach.tor_reged.FILESIZE}

+

{L_PLAYBACK_M3U}

{L_PLAYBACK_M3U}
+