Manual:$wgNamespacesToBeSearchedDefault
Namespaces: $wgNamespacesToBeSearchedDefault | |
---|---|
Which namespaces should be searched? |
|
Introduced in version: | pre 1.1.0 |
Removed in version: | still in use |
Allowed values: | (see below) |
Default value: | (see below) |
Other settings: Alphabetical | By Function
Contents |
Details [edit]
The variable holds an array of namespaces, indicating which namespaces are enabled for searching by default. The array is indexed by the namespace ID, and each index holds either false (don't search) or true (search this namespace).
Default value (1.5.0 and above) [edit]
#Set default searching $wgNamespacesToBeSearchedDefault = array( NS_MAIN => true, NS_TALK => false, NS_USER => false, NS_USER_TALK => false, NS_PROJECT => false, NS_PROJECT_TALK => false, NS_IMAGE => false, NS_IMAGE_TALK => false, NS_MEDIAWIKI => false, NS_MEDIAWIKI_TALK => false, NS_TEMPLATE => false, NS_TEMPLATE_TALK => false, NS_HELP => false, NS_HELP_TALK => false, NS_CATEGORY => false, NS_CATEGORY_TALK => false );
Change "false" to "true" to set the namespaces new users will search.
Changing options for existing users [edit]
MediaWiki version: | ≤ 1.15 |
In MediaWiki 1.16 and later, you do not have to change options for existing users.
userOptions.php MediaWiki maintenance script [edit]
Use the userOptions.php script provided with MediaWiki to change the default namespaces for existing users (or see how many are differing from your new defaults). For example, to search user pages (Ns2):
php userOptions.php --nowarn searchNs2 --old 0 --new 1
If you just did create new namespaces, the searchNsX fields are not yet defined. Use the following syntax instead:
php userOptions.php --nowarn searchNs2 --old "" --new 1
For other namespaces, just replace # (# = number of the namespace) in searchNs# with the namespace number like one of those listed on the Manual:Namespace page.
# php userOptions.php This script pass through all users and change one of their options. The new option is NOT validated. Usage: php userOptions.php --list php userOptions.php <user option> --usage php userOptions.php [options]Â <user option> --old <old value> --new <new value> Switchs: --list : list available user options and their default value --usage <option name> : report statistics about an option --old <old value> : the value to look for --new <new value> : new value to update users with Options: --nowarn: hides the 5 seconds warning --quiet : do not print what is happening --dry : do not save user settings back to database
Old versions [edit]
The variable holds an array of namespaces, numbered from -1 (Special:) and not including -2 (direct-linked media), indicating which namespaces are enabled for searching by default. The array is indexed by the numeric namespace ID, and each index holds either 0 (don't search) or 1 (search this namespace).
Default value (prior to 1.5.0) [edit]
The NS_ constants weren't used (possibly because they weren't defined) so numeric values were used instead:
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 )
Default value (prior to 1.4.5) [edit]
Prior to 1.4.5, namespaces 9 and 11 were also searched.
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 )
Another method [edit]
This is an example of what to edit if nothing else works.
DefaultSettings.php
:
$wgDefaultUserOptions = array( 'quickbar' => 1, 'underline' => 2, 'cols' => 80, 'rows' => 25, 'searchlimit' => 20, 'contextlines' => 5, 'contextchars' => 50, 'skin' => false, 'math' => 1, 'rcdays' => 7, 'rclimit' => 50, 'wllimit' => 250, 'highlightbroken' => 1, 'stubthreshold' => 0, 'previewontop' => 1, 'editsection' => 1, 'editsectiononrightclick' => 0, 'showtoc' => 1, 'showtoolbar' => 1, 'date' => 'default', 'imagesize' => 2, 'thumbsize' => 2, 'rememberpassword' => 0, 'enotifwatchlistpages' => 0, 'enotifusertalkpages' => 1, 'enotifminoredits' => 0, 'enotifrevealaddr' => 0, 'shownumberswatching' => 1, 'fancysig' => 0, 'externaleditor' => 0, 'externaldiff' => 0, 'showjumplinks' => 1, 'numberheadings' => 0, 'uselivepreview' => 0, 'watchlistdays' => 3.0, 'searchNs0' => 1, 'searchNs130' => 1, 'searchNs190' => 1, 'searchNs210' => 1, 'searchNs230' => 1, 'searchNs250' => 1, 'searchNs270' => 1, 'searchNs290' => 1, 'searchNs310' => 1, 'searchNs330' => 1, 'searchNs350' => 1, 'searchNs370' => 1, 'searchNs390' => 1, 'searchNs410' => 1, 'searchNs430' => 1, 'searchNs450' => 1, );
Language: | English • français • 日本語 • русский |
---|