I Want to add pagination to this
plugin:
NewThread Plugin
its a plugin that displays recent
thread on index, anyone have a
solution? please post it. Thanks
Just to ensure your desire...
Do you wish to list threads including categories and subforums in breadcrumb style like the following?
<a>Category</a> / <a>Forum</a> / <a>Subforum</a> / <a>Thread Title</a>
Idea:
To generate the breadcrumb trails, it may be possible to use the functions given by the board software:
https://crossreference.mybb.de/nav.html?....html#l255
[ExiTuS]
actually such plugins are not meant to show lot of results
!
perhaps you might be interested in using
active threads plugin
@m
does this one (Active thread plugin) have pagination...?
(2020-02-22, 02:57 AM).m. Wrote: [ -> ]actually such plugins are not meant to show lot of results !
perhaps you might be interested in using active threads plugin
does it have pagination... i mean dis active threads plugin?
Just for reference, pagination with items stored in the database works like this:
- Execute a query to determine the total amount of items stored.
$query = $db->simple_select({your_table}, 'COUNT(id) AS totalItems');
$totalItems = $db->fetch_field($query, 'totalItems');
- Calculate the total pages:
$totalPages = ceil($totalItems / $perPage)
- Ensure that the passed page number is in range.
- Calculate the starting point using the current page number and amount per page:
$start = ($pageNumber - 1) * $perPage
- Use this info to determine if pagination is needed:
if ($totalItems > $perPage) {
$pagination = draw_admin_pagination($pageNumber, $perPage, $totalItems, $url);
echo($pagination);
}
- Now query again, this time using the calculated info as parameters:
$query = $db->simple_select({your_table}, '*', '', array("limit" => $perPage, "limit_start" => $start));
Note: You need not gather all of the information in the first query. It can be simplified as seen above, by removing
JOIN
s that are not essential to the process.
(2020-02-25, 06:55 PM)Wildcard Wrote: [ -> ]Just for reference, pagination with items stored in the database works like this:
- Execute a query to determine the total amount of items stored.
$query = $db->simple_select({your_table}, 'COUNT(id) AS totalItems');
$totalItems = $db->fetch_field($query, 'totalItems');
- Calculate the total pages:
$totalPages = ceil($totalItems / $perPage)
- Ensure that the passed page number is in range.
- Calculate the starting point using the current page number and amount per page:
$start = ($pageNumber - 1) * $perPage
- Use this info to determine if pagination is needed:
if ($totalItems > $perPage) {
$pagination = draw_admin_pagination($pageNumber, $perPage, $totalItems, $url);
echo($pagination);
}
- Now query again, this time using the calculated info as parameters:
$query = $db->simple_select({your_table}, '*', '', array("limit" => $perPage, "limit_start" => $start));
Note: You need not gather all of the information in the first query. It can be simplified as seen above, by removing JOIN
s that are not essential to the process.
please can u help fix it am not good at coding