Go direct to the page list if there are only one or two pages' worth of
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 14 Aug 2004 08:22:38 +0000 (08:22 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 14 Aug 2004 08:22:38 +0000 (08:22 +0000)
titles to list. (Timwi's patch plus style tweak.)

Bug 18: Improve Allpages display on small wikis
http://bugzilla.wikipedia.org/show_bug.cgi?id=18

includes/SpecialAllpages.php

index 74b9054..e2a2893 100644 (file)
@@ -77,6 +77,13 @@ function indexShowToplevel ( $namespace = 0 )
        $count = $dbr->selectField( 'cur', 'COUNT(*)', $where, $fname );
        $sections = ceil( $count / $indexMaxperpage );
 
+       if ( $sections < 3 ) {
+               # If there are only two or less sections, don't even display them.
+               # Instead, display the first section directly.
+               indexShowChunk( '', $namespace );
+               return;
+       }
+
        # We want to display $toplevelMaxperpage lines starting at $offset.
        # NOTICE: $offset starts at 0
        $offset = intval ( $wgRequest->getVal( 'offset' ) );