[art-web] [pagination] don't keep copying the GET parameters



commit df1a3bff1efe089dee7809bbca515302b4646a08
Author: Thomas Wood <thos gnome org>
Date:   Sat Nov 28 11:36:35 2009 +0000

    [pagination] don't keep copying the GET parameters
    
    If the parameters need to be persistant, then they need to be stored in a
    cookie.

 lib/pagination.php |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/lib/pagination.php b/lib/pagination.php
index f96c8df..9211643 100644
--- a/lib/pagination.php
+++ b/lib/pagination.php
@@ -47,12 +47,10 @@ class Paginator
     $cur_page = ceil ($this->start / $this->limit);
 
     $prev_page = $cur_page - 1;
-    $get_params = '';
-    foreach ($_GET as $key => $value) {if ($key != 'page') $get_params .= "&$key=$value";}
     if ($cur_page > 1)
     {
-      print ("<a href=\"?page=1$get_params\">First</a> &middot; ");
-      print ("<a href=\"?page=$prev_page$get_params\">Previous</a>");
+      print ("<a href=\"?page=1\">First</a> &middot; ");
+      print ("<a href=\"?page=$prev_page\">Previous</a>");
     }
     else
     {
@@ -71,15 +69,15 @@ class Paginator
       if ($i == $cur_page)
         print (" &middot; $i ");
       else
-        print (" &middot; <a href=\"?page=$i$get_params\">$i</a>");
+        print (" &middot; <a href=\"?page=$i\">$i</a>");
     }
 
 
     $next_page = $cur_page + 1;
     if ($cur_page < $num_pages)
     {
-      print (" &middot; <a href=\"?page=${next_page}$get_params\">Next</a>");
-      print (" &middot; <a href=\"?page=${num_pages}$get_params\">Last</a>");
+      print (" &middot; <a href=\"?page=${next_page}\">Next</a>");
+      print (" &middot; <a href=\"?page=${num_pages}\">Last</a>");
     }
     else
     {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]