手册:$wgNamespacesToBeSearchedDefault

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Manual:$wgNamespacesToBeSearchedDefault and the translation is 21% complete.
Other languages:
English • ‎español • ‎français • ‎magyar • ‎polski • ‎português • ‎português do Brasil • ‎русский • ‎中文 • ‎日本語
名字空间: $wgNamespacesToBeSearchedDefault
Which namespaces should be searched?
引进版本:pre 1.1.0
移除版本:仍在使用
允许的值:参见下方
默认值:参见下方

Details

The variable holds an array of namespaces, indicating which namespaces are enabled for searching by default. The array is indexed by the namespace constant. Namespaces not added will not be searched by default.

Default value

MediaWiki版本: 1.5
$wgNamespacesToBeSearchedDefault = [
	NS_MAIN => true,
];
MediaWiki版本: 1.4
$wgNamespacesToBeSearchedDefault = array( -1 => 0, 0 => 1, 1 => 0,
  2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 0, 10 => 0, 11 => 0 );
MediaWiki版本: 1.3
$wgNamespacesToBeSearchedDefault = array( -1 => 0, 0 => 1, 1 => 0,
  2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 1, 10 => 0, 11 => 1 );
MediaWiki版本: 1.1 – 1.2
$wgNamespacesToBeSearchedDefault = array( -1 => 0, 0 => 1, 1 => 0,
  2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0 );

Adding namespaces

To add other namespaces you just add this to your "LocalSettings.php" file, e. g. for the project namespace:

$wgNamespacesToBeSearchedDefault[NS_PROJECT] = true;

Effect of adding/removing namespace

MediaWiki版本: 1.16

In MediaWiki 1.16 and later, adding or removing namespace will apply to all users.

MediaWiki版本: 1.15

In MediaWiki 1.15 and prior, adding or removing namespace will only affects anonymous users and accounts created after the change.