From 2cd3ef9e9b25a9166b6c816d622f593a41256898 Mon Sep 17 00:00:00 2001 From: brettp Date: Fri, 5 Feb 2010 03:20:27 +0000 Subject: Fixes #1481: Applie Mike's patch and created function elgg_http_add_url_query_elements() to handle what the pagination view was trying to do. git-svn-id: http://code.elgg.org/elgg/trunk@3903 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/river/item/list.php | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'views/default/river') diff --git a/views/default/river/item/list.php b/views/default/river/item/list.php index f9d8dd283..8fcc84bea 100644 --- a/views/default/river/item/list.php +++ b/views/default/river/item/list.php @@ -26,18 +26,12 @@ if ($vars['pagination'] !== false) { $baseurl = $_SERVER['REQUEST_URI']; - $baseurl = elgg_http_remove_url_query_element($baseurl, 'offset'); $nav = ''; if (sizeof($vars['items']) > $vars['limit']) { $newoffset = $vars['offset'] + $vars['limit']; - $urladdition = 'offset='.$newoffset; - if (substr_count($baseurl,'?')) { - $nexturl = $baseurl . '&' . $urladdition; - } else { - $nexturl=$baseurl . '?' . $urladdition; - } + $nexturl = elgg_http_add_url_query_elements($baseurl, array('offset' => $newoffset)); $nav .= '« ' . elgg_echo('previous') . ' '; } @@ -47,12 +41,7 @@ if ($newoffset < 0) { $newoffset = 0; } - $urladdition = 'offset='.$newoffset; - if (substr_count($baseurl,'?')) { - $prevurl=$baseurl . '&' . $urladdition; - } else { - $prevurl=$baseurl . '?' . $urladdition; - } + $prevurl = elgg_http_add_url_query_elements($baseurl, array('offset' => $newoffset)); $nav .= '' . elgg_echo('next') . ' » '; } -- cgit v1.2.3