return $top;
}
+function wfShowingResultsNum( $offset, $limit, $num )
+{
+ $top = str_replace( "$1", $limit, wfMsg( "showingresultsnum" ) );
+ $top = str_replace( "$2", $offset+1, $top );
+ $top = str_replace( "$3", $num, $top );
+ return $top;
+}
+
function wfViewPrevNext( $offset, $limit, $link, $query = "" )
{
global $wgUser;
"AND {$searchnamespaces} {$redircond}" .
"LIMIT {$offset}, {$limit}";
$res1 = wfQuery( $sql, $fname );
+ $num = wfNumRows($res1);
if ( $wgDisableTextSearch ) {
$res2 = 0;
"AND {$searchnamespaces} {$redircond} " .
"LIMIT {$offset}, {$limit}";
$res2 = wfQuery( $sql, $fname );
+ $num = $num + wfNumRows($res2);
}
- $top = wfShowingResults( $offset, $limit );
+ if ( $num == $limit ) {
+ $top = wfShowingResults( $offset, $limit);
+ } else {
+ $top = wfShowingResultsNum( $offset, $limit, $num );
+ }
$wgOut->addHTML( "<p>{$top}\n" );
# For powersearch