Function constructPageIndex
Constructs a page list.
- builds the page list, e.g. 1 ... 6 7 [8] 9 10 ... 15.
- flexible_start causes it to use "url.page" instead of "url;start=page".
- very importantly, cleans up the start value passed, and forces it to be a multiple of num_per_page.
- checks that start is not more than max_value.
- base_url should be the URL without any start parameter on it.
- uses the compactTopicPagesEnable and compactTopicPagesContiguous settings to decide how to display the menu.
an example is available near the function definition. $pageindex = constructPageIndex($scripturl . '?board=' . $board, $_REQUEST['start'], $num_messages, $maxindex, true);
Package: SMF
Copyright: 2020 Simple Machines and individual contributors
License: BSD
Author: Simple Machines https://www.simplemachines.org
Located at Sources/Subs.php
Copyright: 2020 Simple Machines and individual contributors
License: BSD
Author: Simple Machines https://www.simplemachines.org
Located at Sources/Subs.php
string |
$base_url |
The basic URL to be used for each link. |
integer |
& $start |
$start The start position, by reference. If this is not a multiple of the number of items per page, it is sanitized to be so and the value will persist upon the function's return. |
integer |
$max_value |
The total number of items you are paginating for. |
integer |
$num_per_page |
The number of items to be displayed on a given page. $start will be forced to be a multiple of this value. |
boolean |
$flexible_start = false |
Whether a ;start=x component should be introduced into the URL automatically (see above) |
boolean |
$show_prevnext = true |
Whether the Previous and Next links should be shown (should be on only when navigating the list) |
string
|
The complete HTML of the page index that was requested, formatted by the template. |