r6790 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r6789‎ | r6790 | r6791 >
Date:09:47, 23 December 2004
Author:kateturner
Status:old
Tags:
Comment:
don't show next> on last page; don't show pagination if only one page of results
Modified paths:
  • /trunk/extensions/LuceneSearch.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LuceneSearch.php
@@ -163,15 +163,17 @@
164164 $first = max($whichchunk - 11, 0);
165165 $last = min($numchunks, $whichchunk + 11);
166166 //$wgOut->addWikiText("whichchunk=$whichchunk numchunks=$numchunks first=$first last=$last num=".count($chunks)." limit=$limit offset=$offset results=".count($results)."\n\n");
167 - for($i = $first; $i < $last; $i++) {
168 - if ($i === $whichchunk)
169 - $prevnext .= "<strong>".($i+1)."</strong> ";
170 - else
171 - $prevnext .= "<a href=\"".
172 - $this->makelink($q, $limit*$i,
173 - $limit)."\">".($i+1)."</a> ";
 167+ if ($last - $first > 1) {
 168+ for($i = $first; $i < $last; $i++) {
 169+ if ($i === $whichchunk)
 170+ $prevnext .= "<strong>".($i+1)."</strong> ";
 171+ else
 172+ $prevnext .= "<a href=\"".
 173+ $this->makelink($q, $limit*$i,
 174+ $limit)."\">".($i+1)."</a> ";
 175+ }
174176 }
175 - if ($whichchuck < $numchunks)
 177+ if ($whichchuck < $last-1)
176178 $prevnext .= "<a href=\"".
177179 $this->makelink($q, $offset + $limit, $limit)."\">".
178180 wfMsg("searchnext")."</a> ";

Status & tagging log