r19785 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r19784‎ | r19785 | r19786 >
Date:10:11, 5 February 2007
Author:erik
Status:old
Tags:
Comment:
hack for default search prefix
Modified paths:
  • /branches/wikidata/includes/DefaultSettings.php (modified) (history)
  • /branches/wikidata/includes/SearchEngine.php (modified) (history)

Diff [purge]

Index: branches/wikidata/includes/SearchEngine.php
@@ -49,7 +49,7 @@
5050 * @private
5151 */
5252 function getNearMatch( $searchterm ) {
53 - global $wgContLang;
 53+ global $wgContLang,$wgDefaultGoPrefix;
5454
5555 $allSearchTerms = array($searchterm);
5656
@@ -68,6 +68,10 @@
6969 return $title;
7070 }
7171
 72+ if(!empty($wgDefaultGoPrefix) && $title->getNamespace == NS_MAIN ) {
 73+ $term=$wgDefaultGoPrefix.$term;
 74+ }
 75+
7276 # Now try all lower case (i.e. first letter capitalized)
7377 #
7478 $title = Title::newFromText( $wgContLang->lc( $term ) );
Index: branches/wikidata/includes/DefaultSettings.php
@@ -2476,5 +2476,11 @@
24772477 *
24782478 */
24792479 $wgCustomHandlerPath = array('*'=>"{$IP}/extensions/");
 2480+
 2481+/*
 2482+ * Prefix to be added before "Go" searches, e.g. point to a different
 2483+ * namespace.
 2484+ */
 2485+$wgDefaultGoPrefix='';
24802486
24812487 ?>