From 20c3c7f7d88f3e856248c7574409b27234ab0926 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 14 Aug 2004 08:22:38 +0000 Subject: [PATCH] Go direct to the page list if there are only one or two pages' worth of 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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/includes/SpecialAllpages.php b/includes/SpecialAllpages.php index 74b9054bee..e2a2893597 100644 --- a/includes/SpecialAllpages.php +++ b/includes/SpecialAllpages.php @@ -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' ) ); -- 2.20.1