r4744 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r4743‎ | r4744 | r4745 >
Date:08:22, 14 August 2004
Author:vibber
Status:old
Tags:
Comment:
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
Modified paths:
  • /trunk/phase3/includes/SpecialAllpages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialAllpages.php
@@ -77,6 +77,13 @@
7878 $count = $dbr->selectField( 'cur', 'COUNT(*)', $where, $fname );
7979 $sections = ceil( $count / $indexMaxperpage );
8080
 81+ if ( $sections < 3 ) {
 82+ # If there are only two or less sections, don't even display them.
 83+ # Instead, display the first section directly.
 84+ indexShowChunk( '', $namespace );
 85+ return;
 86+ }
 87+
8188 # We want to display $toplevelMaxperpage lines starting at $offset.
8289 # NOTICE: $offset starts at 0
8390 $offset = intval ( $wgRequest->getVal( 'offset' ) );

Follow-up revisions

RevisionCommit summaryAuthorDate
r4745Go direct to the page list if there are only one or two pages' worth of title...vibber08:29, 14 August 2004

Status & tagging log