Merge branch 'master' into misc-Minor-improvements

This commit is contained in:
Roman Kelesidis 2025-04-16 00:33:42 +07:00 committed by GitHub
commit 8065f0818c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 40 additions and 4 deletions

View file

@ -12,6 +12,7 @@
### 🐛 Bug Fixes ### 🐛 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)) - 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)) - `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)) - 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)) - *(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)) - *(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)) - *(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)) - 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)) - 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)) - Changed placeholder IP address from `7f000001` to `0` ([#1869](https://github.com/torrentpier/torrentpier/pull/1869)) - ([84e2392](https://github.com/torrentpier/torrentpier/commit/84e23928968f943826bdc4390c52365357d56f32))

View file

@ -34,6 +34,32 @@ if (!$row = DB()->fetch_row($sql)) {
bb_die($lang['INVALID_TOPIC_ID_DB'], 404); 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 // Protocol meta
$meta_v1 = !empty($row['info_hash']); $meta_v1 = !empty($row['info_hash']);
$meta_v2 = !empty($row['info_hash_v2']); $meta_v2 = !empty($row['info_hash_v2']);

View file

@ -1733,6 +1733,8 @@ $lang['EMPTY_ATTACH_ID'] = 'Missing file identifier!';
$lang['TOR_NOT_FOUND'] = 'File is missing on the server!'; $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['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['TORFILE_INVALID'] = 'Torrent file is corrupt';
$lang['PREV_RELEASE'] = 'Previous release';
$lang['NEXT_RELEASE'] = 'Next release';
// Profile // Profile
$lang['WEBSITE_ERROR'] = 'The "site" may contain only http://sitename'; $lang['WEBSITE_ERROR'] = 'The "site" may contain only http://sitename';

View file

@ -116,7 +116,7 @@ class APCu extends Common
* @param string|null $name * @param string|null $name
* @return bool * @return bool
*/ */
public function rm(string $name = null): bool public function rm(?string $name = null): bool
{ {
$targetMethod = is_string($name) ? 'delete' : 'flush'; $targetMethod = is_string($name) ? 'delete' : 'flush';
$name = is_string($name) ? $this->prefix . $name : null; $name = is_string($name) ? $this->prefix . $name : null;

View file

@ -172,7 +172,7 @@ class Memcached extends Common
* @param string|null $name * @param string|null $name
* @return bool * @return bool
*/ */
public function rm(string $name = null): bool public function rm(?string $name = null): bool
{ {
if (!$this->connected) { if (!$this->connected) {
$this->connect(); $this->connect();

View file

@ -174,7 +174,7 @@ class Redis extends Common
* @param string|null $name * @param string|null $name
* @return bool * @return bool
*/ */
public function rm(string $name = null): bool public function rm(?string $name = null): bool
{ {
if (!$this->connected) { if (!$this->connected) {
$this->connect(); $this->connect();

View file

@ -126,7 +126,7 @@ class Sqlite extends Common
* @param string|null $name * @param string|null $name
* @return bool * @return bool
*/ */
public function rm(string $name = null): bool public function rm(?string $name = null): bool
{ {
$targetMethod = is_string($name) ? 'delete' : 'flush'; $targetMethod = is_string($name) ? 'delete' : 'flush';
$name = is_string($name) ? $this->prefix . $name : null; $name = is_string($name) ? $this->prefix . $name : null;

View file

@ -6,6 +6,11 @@
</ul> </ul>
<br/> <br/>
<div class="nav">
<p class="floatR"><a href="{U_PREV_TOPIC}">← {L_PREV_RELEASE}</a>&nbsp;|&nbsp;<a href="{U_NEXT_TOPIC}">{L_NEXT_RELEASE} →</a></p>
<div class="clear"></div>
</div>
<h1 class="pagetitle">{L_BT_FLIST_ANNOUNCERS_LIST}</h1> <h1 class="pagetitle">{L_BT_FLIST_ANNOUNCERS_LIST}</h1>
<table class="forumline"> <table class="forumline">
<thead> <thead>

View file

@ -4,6 +4,7 @@
<legend>{L_DOWNLOAD}</legend> <legend>{L_DOWNLOAD}</legend>
<h1 class="attach_link"><a href="{U_REGISTER}" style="color: brown;">{L_DOWNLOAD_INFO}</a></h1> <h1 class="attach_link"><a href="{U_REGISTER}" style="color: brown;">{L_DOWNLOAD_INFO}</a></h1>
<p id="guest-dl-tip" class="attach_comment med"> <p id="guest-dl-tip" class="attach_comment med">
<a href="{#FILELIST_URL#}{TOPIC_ID}" class="med"><b>{L_BT_FLIST_LINK_TITLE}</b></a> &middot;
<a href="{$bb_cfg['how_to_download_url_help']}" class="med"><b>{L_HOW_TO_DOWNLOAD}</b></a> &middot; <a href="{$bb_cfg['how_to_download_url_help']}" class="med"><b>{L_HOW_TO_DOWNLOAD}</b></a> &middot;
<a href="{$bb_cfg['what_is_torrent_url_help']}" class="med"><b>{L_WHAT_IS_A_TORRENT}</b></a> &middot; <a href="{$bb_cfg['what_is_torrent_url_help']}" class="med"><b>{L_WHAT_IS_A_TORRENT}</b></a> &middot;
<a href="{$bb_cfg['ratio_url_help']}" class="med"><b>{L_RATINGS_AND_LIMITATIONS}</b></a><br/> <a href="{$bb_cfg['ratio_url_help']}" class="med"><b>{L_RATINGS_AND_LIMITATIONS}</b></a><br/>