From 1dc84f666f870f37175b59e0b3d54ccc9a135b1f Mon Sep 17 00:00:00 2001 From: belomaxorka Date: Sun, 6 Apr 2025 01:37:25 +0000 Subject: [PATCH 1/4] =?UTF-8?q?Update=20CHANGELOG.md=20=F0=9F=93=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96ffcf03c..e978219d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ - *(nightly builds)* Added cleanup step ([#1851](https://github.com/torrentpier/torrentpier/pull/1851)) - ([299d9a1](https://github.com/torrentpier/torrentpier/commit/299d9a1f6c4f244e435803212e763c252e5bd396)) - *(render_flag)* Hide names for specified (`$nameIgnoreList`) flags ([#1862](https://github.com/torrentpier/torrentpier/pull/1862)) - ([83e42bc](https://github.com/torrentpier/torrentpier/commit/83e42bc5db086f60a6038b3fffca5982ceeced51)) - *(text captcha)* Disabled scatter effect by default - ([3af5202](https://github.com/torrentpier/torrentpier/commit/3af5202f7b2a4ea5d14bbc4808b7a380de2e0dc0)) +- Minor improvements ([#1875](https://github.com/torrentpier/torrentpier/pull/1875)) - ([41a78dd](https://github.com/torrentpier/torrentpier/commit/41a78ddbcbc628f0592c59879df0170bf48664aa)) - Minor improvements ([#1874](https://github.com/torrentpier/torrentpier/pull/1874)) - ([0f1a69e](https://github.com/torrentpier/torrentpier/commit/0f1a69e32d8d5eb5053b021844845911c619d8cd)) - Fetch only necessary sitemap parameters in `admin_sitemap.php` ([#1873](https://github.com/torrentpier/torrentpier/pull/1873)) - ([f9c8160](https://github.com/torrentpier/torrentpier/commit/f9c8160f8e897950a038a74ad7ee30b116f7b2b8)) - Changed placeholder IP address from `7f000001` to `0` ([#1869](https://github.com/torrentpier/torrentpier/pull/1869)) - ([84e2392](https://github.com/torrentpier/torrentpier/commit/84e23928968f943826bdc4390c52365357d56f32)) From c3b40003b778a725e958cebee6446bcfd6a68b10 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 10 Apr 2025 16:19:22 +0700 Subject: [PATCH 2/4] fix(cache): Implicitly marking parameter `$name` as nullable is deprecated (#1877) --- src/Legacy/Cache/APCu.php | 2 +- src/Legacy/Cache/Memcached.php | 2 +- src/Legacy/Cache/Redis.php | 2 +- src/Legacy/Cache/Sqlite.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Legacy/Cache/APCu.php b/src/Legacy/Cache/APCu.php index 6e3b26fec..d7e4eb8ed 100644 --- a/src/Legacy/Cache/APCu.php +++ b/src/Legacy/Cache/APCu.php @@ -116,7 +116,7 @@ class APCu extends Common * @param string|null $name * @return bool */ - public function rm(string $name = null): bool + public function rm(?string $name = null): bool { $targetMethod = is_string($name) ? 'delete' : 'flush'; $name = is_string($name) ? $this->prefix . $name : null; diff --git a/src/Legacy/Cache/Memcached.php b/src/Legacy/Cache/Memcached.php index ddbc1b02c..4c5c5225b 100644 --- a/src/Legacy/Cache/Memcached.php +++ b/src/Legacy/Cache/Memcached.php @@ -172,7 +172,7 @@ class Memcached extends Common * @param string|null $name * @return bool */ - public function rm(string $name = null): bool + public function rm(?string $name = null): bool { if (!$this->connected) { $this->connect(); diff --git a/src/Legacy/Cache/Redis.php b/src/Legacy/Cache/Redis.php index d20c53aa8..08a6a16ab 100644 --- a/src/Legacy/Cache/Redis.php +++ b/src/Legacy/Cache/Redis.php @@ -174,7 +174,7 @@ class Redis extends Common * @param string|null $name * @return bool */ - public function rm(string $name = null): bool + public function rm(?string $name = null): bool { if (!$this->connected) { $this->connect(); diff --git a/src/Legacy/Cache/Sqlite.php b/src/Legacy/Cache/Sqlite.php index b6ba7f347..ae38a7699 100644 --- a/src/Legacy/Cache/Sqlite.php +++ b/src/Legacy/Cache/Sqlite.php @@ -126,7 +126,7 @@ class Sqlite extends Common * @param string|null $name * @return bool */ - public function rm(string $name = null): bool + public function rm(?string $name = null): bool { $targetMethod = is_string($name) ? 'delete' : 'flush'; $name = is_string($name) ? $this->prefix . $name : null; From 1374479fa214e86f1e5fd526ca74d92dfe14a0c4 Mon Sep 17 00:00:00 2001 From: belomaxorka Date: Fri, 11 Apr 2025 01:26:04 +0000 Subject: [PATCH 3/4] =?UTF-8?q?Update=20CHANGELOG.md=20=F0=9F=93=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e978219d8..e5ca65f14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ ### 🐛 Bug Fixes +- *(cache)* Implicitly marking parameter `$name` as nullable is deprecated ([#1877](https://github.com/torrentpier/torrentpier/pull/1877)) - ([c3b4000](https://github.com/torrentpier/torrentpier/commit/c3b40003b778a725e958cebee6446bcfd6a68b10)) - Pagination issue in `Report on action` page ([#1872](https://github.com/torrentpier/torrentpier/pull/1872)) - ([8358aa0](https://github.com/torrentpier/torrentpier/commit/8358aa00de2ec9efd4c51b8bef11bd700a56c19c)) - `tablesorting` issues & incorrect `user_role` for pending users ([#1871](https://github.com/torrentpier/torrentpier/pull/1871)) - ([595adbe](https://github.com/torrentpier/torrentpier/commit/595adbe4da5296b0f3ebde6628e58e878c0fb7d5)) - Fixed TorrentPier build-in emojis showing in ACP ([#1870](https://github.com/torrentpier/torrentpier/pull/1870)) - ([12792e7](https://github.com/torrentpier/torrentpier/commit/12792e74f71a57448277dda46471563a7fea71db)) From e59adce848a9e10ee5775254045cbbd915236b8b Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Wed, 16 Apr 2025 00:31:45 +0700 Subject: [PATCH 4/4] feat: Improvements for `Torrent Files List` functionality (#1878) * feat: Improvements for `Torrent Files List` functionality * Updated * Updated * Update filelist.php * Update filelist.php * Update filelist.php * Updated * Update filelist.php * Update filelist.php * Update filelist.php * Updated * Update filelist.php * Update filelist.php --- filelist.php | 26 +++++++++++++++++++ library/language/source/main.php | 2 ++ styles/templates/default/filelist.tpl | 5 ++++ .../default/viewtopic_attach_guest.tpl | 1 + 4 files changed, 34 insertions(+) diff --git a/filelist.php b/filelist.php index f9792c989..08a2584ba 100644 --- a/filelist.php +++ b/filelist.php @@ -34,6 +34,32 @@ if (!$row = DB()->fetch_row($sql)) { bb_die($lang['INVALID_TOPIC_ID_DB'], 404); } +// Previous/next topic links +$sql = ' + (SELECT topic_id FROM ' . BB_BT_TORRENTS . ' WHERE topic_id < ' . $topic_id . ' ORDER BY topic_id DESC LIMIT 1) + UNION + (SELECT topic_id FROM ' . BB_BT_TORRENTS . ' WHERE topic_id >= ' . $topic_id . ' ORDER BY topic_id ASC LIMIT 2) + ORDER BY topic_id ASC'; + +if (!$topics = DB()->fetch_rowset($sql)) { + bb_die($lang['INVALID_TOPIC_ID_DB'], 404); +} +$topic_ids = array_column($topics, 'topic_id'); + +$current_index = array_search($topic_id, $topic_ids); +if ($current_index === false) { + bb_die($lang['INVALID_TOPIC_ID_DB'], 404); +} + +$prev_topic_id = $topic_ids[$current_index - 1] ?? $topic_id; +$next_topic_id = $topic_ids[$current_index + 1] ?? $topic_id; + +$template->assign_vars([ + 'U_NEXT_TOPIC' => "filelist.php?t=$next_topic_id", + 'U_PREV_TOPIC' => "filelist.php?t=$prev_topic_id", +]); +unset($prev_topic_id, $next_topic_id, $current_index, $topic_ids, $topics); + // Protocol meta $meta_v1 = !empty($row['info_hash']); $meta_v2 = !empty($row['info_hash_v2']); diff --git a/library/language/source/main.php b/library/language/source/main.php index 65fd05fd1..8ccab797c 100644 --- a/library/language/source/main.php +++ b/library/language/source/main.php @@ -1733,6 +1733,8 @@ $lang['EMPTY_ATTACH_ID'] = 'Missing file identifier!'; $lang['TOR_NOT_FOUND'] = 'File is missing on the server!'; $lang['ERROR_BUILD'] = 'The content of this torrent file can not be viewed on the site (it was not possible to build a list of files)'; $lang['TORFILE_INVALID'] = 'Torrent file is corrupt'; +$lang['PREV_RELEASE'] = 'Previous release'; +$lang['NEXT_RELEASE'] = 'Next release'; // Profile $lang['WEBSITE_ERROR'] = 'The "site" may contain only http://sitename'; diff --git a/styles/templates/default/filelist.tpl b/styles/templates/default/filelist.tpl index 9e6bc4eb4..4f7bcc2b9 100644 --- a/styles/templates/default/filelist.tpl +++ b/styles/templates/default/filelist.tpl @@ -6,6 +6,11 @@
+ +

{L_BT_FLIST_ANNOUNCERS_LIST}

diff --git a/styles/templates/default/viewtopic_attach_guest.tpl b/styles/templates/default/viewtopic_attach_guest.tpl index fc83d07eb..f0c24ccc6 100644 --- a/styles/templates/default/viewtopic_attach_guest.tpl +++ b/styles/templates/default/viewtopic_attach_guest.tpl @@ -4,6 +4,7 @@ {L_DOWNLOAD}

{L_DOWNLOAD_INFO}

+ {L_BT_FLIST_LINK_TITLE} · {L_HOW_TO_DOWNLOAD} · {L_WHAT_IS_A_TORRENT} · {L_RATINGS_AND_LIMITATIONS}