Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -448,6 +448,14 @@ |
449 | 449 | return $top; |
450 | 450 | } |
451 | 451 | |
| 452 | +function wfShowingResultsNum( $offset, $limit, $num ) |
| 453 | +{ |
| 454 | + $top = str_replace( "$1", $limit, wfMsg( "showingresultsnum" ) ); |
| 455 | + $top = str_replace( "$2", $offset+1, $top ); |
| 456 | + $top = str_replace( "$3", $num, $top ); |
| 457 | + return $top; |
| 458 | +} |
| 459 | + |
452 | 460 | function wfViewPrevNext( $offset, $limit, $link, $query = "" ) |
453 | 461 | { |
454 | 462 | global $wgUser; |
Index: trunk/phase3/includes/SearchEngine.php |
— | — | @@ -152,6 +152,7 @@ |
153 | 153 | "AND {$searchnamespaces} {$redircond}" . |
154 | 154 | "LIMIT {$offset}, {$limit}"; |
155 | 155 | $res1 = wfQuery( $sql, $fname ); |
| 156 | + $num = wfNumRows($res1); |
156 | 157 | |
157 | 158 | if ( $wgDisableTextSearch ) { |
158 | 159 | $res2 = 0; |
— | — | @@ -162,9 +163,14 @@ |
163 | 164 | "AND {$searchnamespaces} {$redircond} " . |
164 | 165 | "LIMIT {$offset}, {$limit}"; |
165 | 166 | $res2 = wfQuery( $sql, $fname ); |
| 167 | + $num = $num + wfNumRows($res2); |
166 | 168 | } |
167 | 169 | |
168 | | - $top = wfShowingResults( $offset, $limit ); |
| 170 | + if ( $num == $limit ) { |
| 171 | + $top = wfShowingResults( $offset, $limit); |
| 172 | + } else { |
| 173 | + $top = wfShowingResultsNum( $offset, $limit, $num ); |
| 174 | + } |
169 | 175 | $wgOut->addHTML( "<p>{$top}\n" ); |
170 | 176 | |
171 | 177 | # For powersearch |