Pagination with rel="next" and rel="prev" support ()

* Minor improvements

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2024-07-21 19:59:08 +07:00 committed by GitHub
commit a10ec4c394
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 15 additions and 3 deletions

View file

@ -13,6 +13,7 @@
- Fixed broken "Disable Board" function [\#1529](https://github.com/torrentpier/torrentpier/pull/1529) ([belomaxorka](https://github.com/belomaxorka))
- Fixed seed bonus accrual [\#1518](https://github.com/torrentpier/torrentpier/pull/1518) ([belomaxorka](https://github.com/belomaxorka))
- [BETA] Added emojis support 😄😁 [\#1514](https://github.com/torrentpier/torrentpier/pull/1514) ([belomaxorka](https://github.com/belomaxorka))
- Pagination with `rel="next"` and `rel="prev"` support [\#1551](https://github.com/torrentpier/torrentpier/pull/1551) ([belomaxorka](https://github.com/belomaxorka))
- Datastore improvements [\#1538](https://github.com/torrentpier/torrentpier/pull/1538) ([belomaxorka](https://github.com/belomaxorka))
- Resize user/group avatar image if too large 🌆 [\#1512](https://github.com/torrentpier/torrentpier/pull/1512) ([belomaxorka](https://github.com/belomaxorka))
- Increased PASSWORD_MAX_LENGTH [\#1510](https://github.com/torrentpier/torrentpier/pull/1510) ([belomaxorka](https://github.com/belomaxorka))

View file

@ -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 . "&amp;start=" . (($on_page - 2) * $per_page) . '">' . $lang['PREVIOUS_PAGE'] . '</a>&nbsp;&nbsp;' . $page_string;
$meta_prev_link = FULL_URL . $base_url . "&amp;start=" . (($on_page - 2) * $per_page);
}
if ($on_page < $total_pages) {
$page_string .= '&nbsp;&nbsp;<a href="' . $base_url . "&amp;start=" . ($on_page * $per_page) . '">' . $lang['NEXT_PAGE'] . '</a>';
$meta_next_link = FULL_URL . $base_url . "&amp;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;

View file

@ -11,6 +11,12 @@
<meta property="twitter:image" content="{SITE_URL}styles/images/logo/logo.png">
<meta property="og:title" content="<!-- IF PAGE_TITLE -->{PAGE_TITLE} :: {SITENAME}<!-- ELSE -->{SITENAME}<!-- ENDIF -->">
<meta property="twitter:title" content="<!-- IF PAGE_TITLE -->{PAGE_TITLE} :: {SITENAME}<!-- ELSE -->{SITENAME}<!-- ENDIF -->">
<!-- IF META_PREV_PAGE -->
<link rel="prev" href="{META_PREV_PAGE}">
<!-- ENDIF / META_PREV_PAGE -->
<!-- IF META_NEXT_PAGE -->
<link rel="next" href="{META_NEXT_PAGE}">
<!-- ENDIF / META_NEXT_PAGE -->
{META}
<link rel="stylesheet" href="{STYLESHEET}?v={$bb_cfg['css_ver']}" type="text/css">
<link rel="shortcut icon" href="{SITE_URL}favicon.png" type="image/x-icon">

View file

@ -77,7 +77,7 @@
<table cellpadding="2" cellspacing="0" width="100%">
<tr>
<td width="100%">
<h1 class="maintitle">{PAGE_TITLE}</h1>
<h1 class="pagetitle">{PAGE_TITLE}</h1>
<div id="forums_top_links" class="nav">
<a href="{U_INDEX}">{T_INDEX}</a>&nbsp;<em>&middot;</em>
<span id="show-edit-btn"><a href="#">{L_EDIT_MY_MESSAGE_LIST}</a></span>

View file

@ -262,7 +262,7 @@ td.topic_id { cursor: pointer; }
<tr>
<td valign="bottom">
<h1 class="maintitle" style="margin-bottom: 0 !important;"><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h1>
<p class="maintitle" style="font-size: 17px !important;">{FORUM_DESC}</p>
<p class="pagetitle" style="font-size: 17px;">{FORUM_DESC}</p>
<p class="small" id="moderators"><a style="text-decoration: none;" href="#">{L_MODERATORS}</a></p>
<script type="text/javascript">