diff options
author | Drae <paul@starstreak.net> | 2012-07-12 02:36:00 +0100 |
---|---|---|
committer | Drae <paul@starstreak.net> | 2012-07-18 14:32:42 +0100 |
commit | 584d49459d22ebf47239fc97ad8358a5404dacf4 (patch) | |
tree | c4c4933cce8b90665beed1848e8460425a67c9b7 /phpBB/includes/functions.php | |
parent | 27d8aef528460e87efc90bc4fffc82c0d1fa87d9 (diff) | |
download | forums-584d49459d22ebf47239fc97ad8358a5404dacf4.tar forums-584d49459d22ebf47239fc97ad8358a5404dacf4.tar.gz forums-584d49459d22ebf47239fc97ad8358a5404dacf4.tar.bz2 forums-584d49459d22ebf47239fc97ad8358a5404dacf4.tar.xz forums-584d49459d22ebf47239fc97ad8358a5404dacf4.zip |
[feature/pagination-as-list] New parameter for name of start var
Add a new parameter to hold the name of the start variable. This
fulfills ticket PHPBB3-8535.
PHPBB3-10968
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 8c740edbfd..633ac3d307 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1887,6 +1887,7 @@ function tracking_unserialize($string, $max_depth = 3) * @param object $template the template object * @param string $base_url is url prepended to all links generated within the function * @param string $block_var_name is the name assigned to the pagination data block within the template (example: <!-- BEGIN pagination -->) +* @param string $start_name is the name of the parameter containing the first item of the given page (example: start=20) * @param int $num_items the total number of items, posts, etc., used to determine the number of pages to produce * @param int $per_page the number of items, posts, etc. to display per page, used to determine the number of pages to produce * @param int $start_item the item which should be considered currently active, used to determine the page we're on @@ -1894,7 +1895,7 @@ function tracking_unserialize($string, $max_depth = 3) * @param bool $ignore_on_page decides whether we enable an active (unlinked) item, used primarily for embedded lists * @return null */ -function phpbb_generate_template_pagination($template, $base_url, $block_var_name, $num_items, $per_page, $start_item = 1, $reverse_count = false, $ignore_on_page = false) +function phpbb_generate_template_pagination($template, $base_url, $block_var_name, $start_name, $num_items, $per_page, $start_item = 1, $reverse_count = false, $ignore_on_page = false) { // Make sure $per_page is a valid value $per_page = ($per_page <= 0) ? 1 : $per_page; @@ -1938,7 +1939,7 @@ function phpbb_generate_template_pagination($template, $base_url, $block_var_nam { $template->assign_block_vars($block_var_name, array( 'PAGE_NUMBER' => '', - 'PAGE_URL' => $base_url . "{$url_delim}start=" . ($on_page * $per_page), + 'PAGE_URL' => $base_url . $url_delim . $start_name . '=' . ($on_page * $per_page), 'S_IS_CURRENT' => false, 'S_IS_PREV' => false, 'S_IS_NEXT' => true, @@ -1952,7 +1953,7 @@ function phpbb_generate_template_pagination($template, $base_url, $block_var_nam $at_page = 1; do { - $page_url = $base_url . (($at_page == 1) ? '' : $url_delim . 'start=' . (($at_page - 1) * $per_page)); + $page_url = $base_url . (($at_page == 1) ? '' : $url_delim . $start_name . '=' . (($at_page - 1) * $per_page)); // We decide whether to display the ellipsis during the loop. The ellipsis is always // displayed as either the second or penultimate item in the list. So are we at either @@ -1992,7 +1993,7 @@ function phpbb_generate_template_pagination($template, $base_url, $block_var_nam { $template->assign_block_vars($block_var_name, array( 'PAGE_NUMBER' => '', - 'PAGE_URL' => $base_url . "{$url_delim}start=" . (($on_page - 2) * $per_page), + 'PAGE_URL' => $base_url . $url_delim . $start_name . '=' . (($on_page - 2) * $per_page), 'S_IS_CURRENT' => false, 'S_IS_PREV' => true, 'S_IS_NEXT' => false, |