Manual:$wgDefaultUserOptions

From MediaWiki.org

Jump to: navigation, search
Users: $wgDefaultUserOptions
Settings added to this array will override the default user preferences used by anonymous visitors and newly created accounts.
Introduced in version: 1.4.0
Removed in version: still in use
Allowed Values: See below.
Default Value: See below.

Other settings: Alphabetical | By Function


Contents

[edit] Details

Settings in this array will override the default user preferences for anonymous visitors and newly created accounts. When a new account is created the default settings in use at the time are stored along with the account details, so any subsequent changes to the default values will not affect existing users.

[edit] Available preferences

The following user preferences are available for customisation:

Name Description
User Profile
fancysig  
rememberpassword Whether to remember the user's password between sessions.
enotifwatchlistpages Only used if $wgEnotifWatchlist is set.
enotifusertalkpages Only used if $wgEnotifUserTalk is set.
enotifminoredits Only used if $wgEnotifWatchlist and $wgEnotifUserTalk are set.
enotifrevealaddr Only used if $wgEnotifRevealEditorAddress and either $wgEnotifWatchlist or $wgEnotifUserTalk are set.
Quickbar
quickbar Quickbar location (only applies if using Cologne Blue or Classic skins). Options are: 0 - None, 1 - Fixed left, 2 - Fixed right, 3 - Floating left, 4 - Floating right.
Skin
skin Which skin to use. May be false to indicate that the site default (as defined in $wgDefaultSkin) should be used.
Math
math How to render in-line maths (contents of <math></math> tags). Only applies if $wgUseTeX is set. Options are: 0 - Always render PNG, 1 - HTML if very simple or else PNG, 2 - HTML if possible or else PNG, 3 - Leave it as TeX (for text browsers), 4 - Recommended for modern browsers, 5 - MathML if possible (experimental)
Files
imagesize Size to limit images on description pages to. Values correspond to the entries in $wgImageLimits. By default, 2 is 800*600.
thumbsize Thumbnail size - Values Correspond to the entries in $wgThumbLimits. By default, 2 is 180px.
Date and Time
date Date format. 0 = No preference.
timecorrection Timezone offset
Editing
rows Edit box size (rows)
cols Edit box size (columns)
editsection Enable section editing via [edit] links
editsectiononrightclick Enable section editing by right clicking on section titles (JavaScript)
editondblclick Edit pages on double click (JavaScript)
editwidth Edit box has full width
showtoolbar Show edit toolbar (requires javascript)
previewonfirst Show preview on first edit
previewontop Show preview before edit box
minordefault Mark all edits minor by default
externaleditor Use external editor by default
externaldiff Use external diff by default
uselivepreview Only used if $wgLivePreview is true.
forceeditsummary Prompt user when entering a blank edit summary
Recent changes
rcdays Days to show in recent changes
rclimit Titles in recent changes
hideminor Hide minor edits in recent changes
shownumberswatching Show the number users, who are watching this page (on recent changes, watch list and artice pages). Only used if $wgRCShowWatchingUsers is set.
usenewrc Enhanced recent changes - javascript collapsable tree
Watchlist
watchlistdays Number of days to show in watchlist
extendwatchlist Expand watchlist to show all applicable changes
wllimit Number of edits to show in expanded watchlist (if 'extendwatchlist' == 1)
watchlisthideown Hide the user's own edits from the watchlist
watchlisthidebots Hide bot edits from the watchlist
watchlisthideminor Hide minor edits from the watchlist
watchcreations Add pages the user creates to their watchlist
watchdefault Add pages the user edits to their watchlist
watchmoves Add pages the user moves to their watchlist
watchdeletion Add pages the user deletes to their watchlist
Search
searchlimit Hits per page
contextlines Lines per hit
contextchars Context per line
ajaxsearch Enables AJAX Search (Options are 1 for true and 0 for false)
Misc
stubthreshold Threshold for stub display
underline Whether to underline links. Options are: 0 - never, 1 - always, 2 - browser default
highlightbroken Format broken links as red-underlined links (alternative: with a questionmark as the link, like this?).
justify Justify paragraphs
numberheadings Option "Auto-numbering Headings", 1 turns on the numbering of all headings within articles
showtoc Boolean. 1 is show the TOC, 0 is hide it.
nocache Disable page caching
showjumplinks Enable "jump to" accessibility links
diffonly Don't show page content below diffs

Notes:

  • New settings are added to MediaWiki periodically. Some of these settings have been added since $wgDefaultUserOptions was introduced in v1.4.0. Currently there is no documentation about when settings were added.
  • It is possible for extensions and language files to add extra toggles to the 'misc' tab. Languages that use this feature should have the setting described here. Extensions should add the information to their extension page.

[edit] Default values

Each language sets its own default values for the user preferences in its language file. For example languages that read right-to-left will probably set the quickbar to appear on the right, instead of on the left. The values added to $wgDefaultUserOptions are overrides, i.e. if the value exists here then it will take precedence, but settings may be omitted from the array in which case the language's default value will be used.

In versions of MediaWiki prior to 1.8.0 the default value of this setting was simply an empty array, with the current language providing the default values.

From version 1.8.0 onwards, only the language-specific settings were overridden in the language file, so most settings are now explicitly set in DefaultSettings.php

The following code gives the default values as set in MediaWiki 1.8.0 - they may have been different in earlier versions, and would certainly have differed between languages.

$wgDefaultUserOptions = array( 
        'quickbar'                     => 1,
        'underline'                    => 2,
        'cols'                         => 80,
        'rows'                         => 25,
        'searchlimit'                  => 20,
        'contextlines'                 => 5,
        'contextchars'                 => 50,
        'skin'                         => false,   // use the value set in $wgDefaultSkin
        '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,
);


[edit] Example

To disable section editing links by default (for new and anonymous users), set the following in LocalSettings.php:

$wgDefaultUserOptions['editsection'] = 0;

[edit] See also

Personal tools