mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-23 06:35:45 -07:00
Update filelist.php
This commit is contained in:
parent
fc0dc988ac
commit
90eae65a58
1 changed files with 5 additions and 2 deletions
|
@ -35,13 +35,15 @@ if (!$row = DB()->fetch_row($sql)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Previous/next topic links
|
// Previous/next topic links
|
||||||
$topics_sql = '
|
$sql = '
|
||||||
(SELECT topic_id FROM ' . BB_BT_TORRENTS . ' WHERE topic_id < ' . $topic_id . ' ORDER BY topic_id DESC LIMIT 1)
|
(SELECT topic_id FROM ' . BB_BT_TORRENTS . ' WHERE topic_id < ' . $topic_id . ' ORDER BY topic_id DESC LIMIT 1)
|
||||||
UNION
|
UNION
|
||||||
(SELECT topic_id FROM ' . BB_BT_TORRENTS . ' WHERE topic_id >= ' . $topic_id . ' ORDER BY topic_id ASC LIMIT 2)
|
(SELECT topic_id FROM ' . BB_BT_TORRENTS . ' WHERE topic_id >= ' . $topic_id . ' ORDER BY topic_id ASC LIMIT 2)
|
||||||
ORDER BY topic_id ASC';
|
ORDER BY topic_id ASC';
|
||||||
|
|
||||||
$topics = DB()->fetch_rowset($topics_sql);
|
if (!$topics = DB()->fetch_rowset($sql)) {
|
||||||
|
bb_die($lang['INVALID_TOPIC_ID_DB'], 404);
|
||||||
|
}
|
||||||
$topic_ids = array_column($topics, 'topic_id');
|
$topic_ids = array_column($topics, 'topic_id');
|
||||||
|
|
||||||
$current_index = array_search($topic_id, $topic_ids);
|
$current_index = array_search($topic_id, $topic_ids);
|
||||||
|
@ -61,6 +63,7 @@ $template->assign_vars([
|
||||||
'U_NEXT_TOPIC' => "filelist.php?t=$next_topic_id",
|
'U_NEXT_TOPIC' => "filelist.php?t=$next_topic_id",
|
||||||
'U_PREV_TOPIC' => "filelist.php?t=$prev_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']);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue