From f2d9607438670550661fe423eaf26bc24f22bc9e Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Thu, 22 Jul 2021 18:45:52 +0200 Subject: Merge GET parameters into pagination URL --- core/functions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/functions.php b/core/functions.php index cf35aa9..38af934 100644 --- a/core/functions.php +++ b/core/functions.php @@ -17,10 +17,13 @@ use Parsers\MarkdownParser; # Create generic pagination template #=============================================================================== function createPaginationTemplate($current, $last, string $location): Template { + $params = http_build_query(array_merge($_GET, ['site' => '__SITE__'])); + $params = str_replace('__SITE__', '%d', $params); + $Pagination = TemplateFactory::build('pagination'); $Pagination->set('THIS', $current); $Pagination->set('LAST', $last); - $Pagination->set('HREF', "{$location}?site=%d"); + $Pagination->set('HREF', "{$location}?{$params}"); return $Pagination; } -- cgit v1.2.3