mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 10:37:30 -07:00
Pagination with rel="next"
and rel="prev"
support (#1551)
* Minor improvements * Update CHANGELOG.md
This commit is contained in:
parent
6a4dd64874
commit
a10ec4c394
5 changed files with 15 additions and 3 deletions
|
@ -1278,10 +1278,12 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add
|
|||
if ($add_prevnext_text) {
|
||||
if ($on_page > 1) {
|
||||
$page_string = ' <a href="' . $base_url . "&start=" . (($on_page - 2) * $per_page) . '">' . $lang['PREVIOUS_PAGE'] . '</a> ' . $page_string;
|
||||
$meta_prev_link = FULL_URL . $base_url . "&start=" . (($on_page - 2) * $per_page);
|
||||
}
|
||||
|
||||
if ($on_page < $total_pages) {
|
||||
$page_string .= ' <a href="' . $base_url . "&start=" . ($on_page * $per_page) . '">' . $lang['NEXT_PAGE'] . '</a>';
|
||||
$meta_next_link = FULL_URL . $base_url . "&start=" . ($on_page * $per_page);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1295,7 +1297,10 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add
|
|||
'PAGINATION' => $pagination,
|
||||
'PAGE_NUMBER' => sprintf($lang['PAGE_OF'], (floor($start_item / $per_page) + 1), ceil($num_items / $per_page)),
|
||||
'PG_BASE_URL' => $base_url,
|
||||
'PG_PER_PAGE' => $per_page
|
||||
'PG_PER_PAGE' => $per_page,
|
||||
// Assign meta
|
||||
'META_PREV_PAGE' => $meta_prev_link ?? '',
|
||||
'META_NEXT_PAGE' => $meta_next_link ?? '',
|
||||
]);
|
||||
|
||||
return $pagination;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue