Make paging links on category pages known. This allows more comfortable browsing...
[lhc/web/wiklou.git] / includes / CategoryPage.php
index 35a8326..f431045 100644 (file)
@@ -263,17 +263,11 @@ class CategoryViewer {
                                $this->addPage( $title, $x->cl_sortkey, $x->page_len, $x->page_is_redirect );
                        }
                }
-               $dbr->freeResult( $res );
        }
 
        function getCategoryTop() {
-               $r = '';
-               if( $this->until != '' ) {
-                       $r .= $this->pagingLinks( $this->title, $this->nextPage, $this->until, $this->limit );
-               } elseif( $this->nextPage != '' || $this->from != '' ) {
-                       $r .= $this->pagingLinks( $this->title, $this->from, $this->nextPage, $this->limit );
-               }
-               return $r == ''
+               $r = $this->getCategoryBottom();
+               return $r === ''
                        ? $r
                        : "<br style=\"clear:both;\"/>\n" . $r;
        }
@@ -464,22 +458,24 @@ class CategoryViewer {
 
                $prevLink = wfMsgExt( 'prevn', array( 'escape', 'parsemag' ), $limitText );
                if( $first != '' ) {
-                       $query['until'] = $first;
-                       $prevLink = $sk->link(
+                       $prevQuery = $query;
+                       $prevQuery['until'] = $first;
+                       $prevLink = $sk->linkKnown(
                                $title,
                                $prevLink,
                                array(),
-                               $query
+                               $prevQuery
                        );
                }
                $nextLink = wfMsgExt( 'nextn', array( 'escape', 'parsemag' ), $limitText );
                if( $last != '' ) {
-                       $query['from'] = $last;
-                       $nextLink = $sk->link(
+                       $lastQuery = $query;
+                       $lastQuery['from'] = $last;
+                       $nextLink = $sk->linkKnown(
                                $title,
                                $nextLink,
                                array(),
-                               $query
+                               $lastQuery
                        );
                }