return false;
}
- // Generate a random number between 0 and 1. If the
- // number is less than the desired percentages run it.
- $rand = rand( 0, getrandmax() ) / getrandmax();
- return $this->getConfig()->get( 'SearchRunSuggestedQueryPercent' ) > $rand;
+ return $this->getConfig()->get( 'SearchRunSuggestedQuery' );
}
/**
$suggest = Linker::linkKnown(
$this->getPageTitle(),
$textMatches->getSuggestionSnippet() ?: null,
- array(),
+ array( 'id' => 'mw-search-DYM-suggestion' ),
$stParams
);
$rewritten = Linker::linkKnown(
$this->getPageTitle(),
$textMatches->getQueryAfterRewriteSnippet() ?: null,
- array(),
+ array( 'id' => 'mw-search-DYM-rewritten' ),
$stParams
);
$original = Linker::linkKnown(
$this->getPageTitle(),
htmlspecialchars( $term ),
- array(),
+ array( 'id' => 'mw-search-DYM-original' ),
$stParams
);
array( 'data-serp-pos' => $position ) // HTML attributes
);
- //If page content is not readable, just return the title.
- //This is not quite safe, but better than showing excerpts from non-readable pages
- //Note that hiding the entry entirely would screw up paging.
+ // If page content is not readable, just return the title.
+ // This is not quite safe, but better than showing excerpts from non-readable pages
+ // Note that hiding the entry entirely would screw up paging.
if ( !$title->userCan( 'read', $this->getUser() ) ) {
return "<li>{$link}</li>\n";
}