diff --git a/CHANGELOG.md b/CHANGELOG.md
index 96ffcf03c..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))
@@ -44,6 +45,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))
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/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;
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 @@
+