diff --git a/CHANGELOG.md b/CHANGELOG.md index ff847457e..5372853f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ **Merged pull requests:** - Release 2.4.5 🍧️ ([belomaxorka](https://github.com/belomaxorka)) +- [Configurable] Show magnet-links for guests [\#1712](https://github.com/torrentpier/torrentpier/pull/1712) ([belomaxorka](https://github.com/belomaxorka)) - Set `cursor: pointer;` for buttons, inputs (buttons) [\#1710](https://github.com/torrentpier/torrentpier/pull/1710), [\#1711](https://github.com/torrentpier/torrentpier/pull/1711) ([belomaxorka](https://github.com/belomaxorka)) - Minor improvements [\#1705](https://github.com/torrentpier/torrentpier/pull/1705) ([belomaxorka](https://github.com/belomaxorka)) - New Crowdin updates [\#1704](https://github.com/torrentpier/torrentpier/pull/1704), [\#1706](https://github.com/torrentpier/torrentpier/pull/1706) ([Exileum](https://github.com/Exileum)) diff --git a/admin/admin_board.php b/admin/admin_board.php index fdc736d79..19f359a87 100644 --- a/admin/admin_board.php +++ b/admin/admin_board.php @@ -61,6 +61,7 @@ switch ($mode) { 'CONFIG_MODS' => true, 'MAGNET_LINKS_ENABLED' => $new['magnet_links_enabled'], + 'MAGNET_LINKS_FOR_GUESTS' => $new['magnet_links_for_guests'], 'GENDER' => $new['gender'], 'CALLSEED' => $new['callseed'], 'TOR_STATS' => $new['tor_stats'], diff --git a/install/sql/mysql.sql b/install/sql/mysql.sql index 858e4a7c9..5231b54d1 100644 --- a/install/sql/mysql.sql +++ b/install/sql/mysql.sql @@ -583,6 +583,7 @@ VALUES ('allow_autologin', '1'), ('xs_use_cache', '1'), ('cron_check_interval', '180'), ('magnet_links_enabled', '1'), + ('magnet_links_for_guests', '0'), ('gender', '1'), ('callseed', '0'), ('tor_stats', '1'), diff --git a/install/upgrade/legacy-changes.txt b/install/upgrade/legacy-changes.txt index 20779f357..05cdb974b 100644 --- a/install/upgrade/legacy-changes.txt +++ b/install/upgrade/legacy-changes.txt @@ -148,3 +148,6 @@ UPDATE `bb_cron` SET `run_interval` = '00:10:00' WHERE `cron_script` = 'tr_seed_ // 2.4.5-rc.1 INSERT INTO `bb_extensions` (`group_id`, `extension`, `comment`) VALUES ('1', 'avif', ''), ('3', 'm3u', ''); ALTER TABLE `bb_topics` ADD COLUMN `topic_allow_robots` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'; + +// 2.4.5 +INSERT INTO bb_config VALUES ('magnet_links_for_guests', '0'); diff --git a/library/includes/functions.php b/library/includes/functions.php index 49a9ddafa..b34cca375 100644 --- a/library/includes/functions.php +++ b/library/includes/functions.php @@ -1812,7 +1812,7 @@ function create_magnet(string $infohash, string $infohash_v2, string $auth_key, } // Only for registered users - if (IS_GUEST && $bb_cfg['bt_tor_browse_only_reg']) { + if (!$bb_cfg['magnet_links_for_guests'] && IS_GUEST) { return false; } diff --git a/library/language/source/main.php b/library/language/source/main.php index b18f84693..4fb6d622d 100644 --- a/library/language/source/main.php +++ b/library/language/source/main.php @@ -1400,6 +1400,7 @@ $lang['SEEDING'] = 'Seed'; $lang['LEECHING'] = 'Leech'; $lang['IS_REGISTERED'] = 'Registered'; $lang['MAGNET'] = 'Magnet-link'; +$lang['MAGNET_FOR_GUESTS'] = 'Show magnet-link for guests'; $lang['MAGNET_v2'] = 'Magnet-link (BitTorrent v2 supported)'; //torrent status mod diff --git a/styles/templates/admin/admin_board.tpl b/styles/templates/admin/admin_board.tpl index 92188f4dd..5d5e88821 100644 --- a/styles/templates/admin/admin_board.tpl +++ b/styles/templates/admin/admin_board.tpl @@ -171,6 +171,13 @@ +