mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 22:03:49 -07:00
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
This commit is contained in:
parent
1374479fa2
commit
e59adce848
4 changed files with 34 additions and 0 deletions
26
filelist.php
26
filelist.php
|
@ -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']);
|
||||||
|
|
|
@ -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';
|
||||||
|
|
|
@ -6,6 +6,11 @@
|
||||||
</ul>
|
</ul>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
|
<div class="nav">
|
||||||
|
<p class="floatR"><a href="{U_PREV_TOPIC}">← {L_PREV_RELEASE}</a> | <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>
|
||||||
|
|
|
@ -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> ·
|
||||||
<a href="{$bb_cfg['how_to_download_url_help']}" class="med"><b>{L_HOW_TO_DOWNLOAD}</b></a> ·
|
<a href="{$bb_cfg['how_to_download_url_help']}" class="med"><b>{L_HOW_TO_DOWNLOAD}</b></a> ·
|
||||||
<a href="{$bb_cfg['what_is_torrent_url_help']}" class="med"><b>{L_WHAT_IS_A_TORRENT}</b></a> ·
|
<a href="{$bb_cfg['what_is_torrent_url_help']}" class="med"><b>{L_WHAT_IS_A_TORRENT}</b></a> ·
|
||||||
<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/>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue