MediaWiki FAQ: Difference between revisions

Content deleted Content added
rvt to last by PiRSquared17, this page was merged 7 years ago and clearly links to new target
Tag: Replaced
 
(608 intermediate revisions by more than 100 users not shown)
Line 1:
{{MovedToMediaWiki|Manual:FAQ}}
<small>''Other languages:'' {{H-langs:FAQ}}</small>
 
[[Category:FAQs]]
== '''In General''' ==
 
=== Why should I use MediaWiki? ===
 
Maybe you shouldn't. MediaWiki is a wiki engine, and is not suited for all purposes. Some things are better served by a dedicated content/document management system, for instance. You should refer to the [[MediaWiki feature list|feature list]], and our list of [[sites using MediaWiki]]. [[MediaWiki reviews|Reviews]] of the software are also available.
 
Since MediaWiki is written chiefly to run large open-content sites like [[Wikipedia]], you may find that it's more complicated than you need, or that its feature set doesn't match up well with your requirements. There are many great wiki packages out there; don't be afraid to try some others!
 
The biggest advantage to using mediawiki is that as one of the most popular wikis people are more likely to be familiar with it than with other wiki software and you don't have to worry about your site outgrowing it.
 
=== Are "Wikimedia" and "MediaWiki" the same thing? ===
 
No. [[Wikimedia]] is the name of a group of [[w:wiki|wiki]]-based open-content projects managed by the non-profit ''Wikimedia Foundation''. [[MediaWiki]] is the software developed to meet the needs of these projects.
 
For further clarification, see our article on the [[names]].
 
=== I tried that but it didn't work ===
:''I had a problem, I came to this page and it told me how to fix it. But it didn't work, the problem is still there!''
 
Nine times out of ten this is because you didn't [[#How do I purge cached pages?|clear your cache]]. The simple test for this is to request a page that hasn't been requested before. Select the part of the URL in the address bar that contains the page title (e.g. Main_Page). Twiddle your fingers on the keyboard for a while, hit enter. Check if the problem is on that page too.
 
MediaWiki uses both a server-side cache and a client-side cache, so clearing your browser cache is often not enough. See the [[#How do I purge cached pages?|relevant entry below]] for more details.
 
Here are some other things to check:
* Were you editing the right file? Try inserting some garbage into the file you edited, does it break anything?
** A great debugging tool in this case is to create a file called phpinfo.php, containing only <tt><?php phpinfo() ?></tt> . Upload it into your web directory and invoke it with your browser. Check the document root and the path to php.ini.
* Were you editing the right part of the file? Did you create a duplicate entry in php.ini? Add new settings to the end of LocalSettings.php (but before the <tt>?></tt>), not to the beginning.
* If you created a .htaccess, are you sure AllowOverrides is on? Ask your hosting provider.
 
If none of these things work, see the two entries below on how to get more help.
 
=== Where should I post my bug report/feature request? ===
 
Please post all bug reports and feature requests at http://bugzilla.wikimedia.org. Please search through existing entries beforehand, to check that the problem isn't fixed in a newer release version of the software, and to ensure we don't have duplicate entries.
 
=== I have a question not answered in this FAQ. Where should I ask it? ===
You can either
#Email the '''mediawiki-l''' [[mailing list]], or
#Ask in [irc://irc.freenode.net/mediawiki our IRC channel]
 
== Installation ==
''See also'':
*How do I set up [[interwiki links]]?
*How do I enable [[uploading files]]?
*How do I [[enable TeX]] (aka '<i>math support</i>')?
*How do I [[make non-ugly URLs]]?
*How do I [[update from an earlier version]]?
*How do I [[change the name of the wiki]]?
*How do I [[require users log in to edit]]?
 
=== How do I install MediaWiki? What are the system requirements? ===
See [[Help:Installation]]
 
=== Is it possible to install more than one wiki (MediaWiki) on a server? How? ===
 
Yes, MediaWiki can be installed multiple times in different directories using either the same database with a different set of table prefixes (configurable upon install) or using different databases altogether.
 
Additionally, you may want to make some settings common for all the installations, and have a central place where changes to these can be made. Since the configuration file (<code>LocalSettings.php</code>) is executed as PHP code, this can be done with PHP's inclusion mechanism - for instance, by adding the line <code>include_once("../CommonSettings.php")</code> in each <code>LocalSettings.php</code>, and placing settings which apply to all wikis in <code>../CommonSettings.php</code>.
 
If you have a large number of wikis on one host, you may not want to keep a separate copy of the source code for every one. Instead, extract the source somewhere, and for each wiki installation, symlink the entire MediaWiki directory with the sole exception of the LocalSettings.php file. This can be accomplished with the lndir command (available on some Linux installations) or an equivalent tool.
 
You can then either use a separate LocalSettings.php for each wiki, or (easier to maintain) determine the settings based on the URL. See also [http://wp.wikidev.net/Wiki_farm Wiki farm].
 
If you want your login to be persistent across Wiki's running on the same server, simply add the following line to your <tt>LocalSettings.php</tt> after <tt>$wgSiteName = ...</tt> :
ini_set("session.name", "{$wgSitename}Session" );
(Though you can expect some trouble if <tt>$wgSiteName</tt> contains spaces. In that case replace <tt>{$wgSiteName}</tt> with an explicit space-removed version). <code>$wgSecretKey</code> (or depricated <code>$wgProxyKey</code>) must be the same across your wikis for persistent logins to work.
 
=== Can I import from other types of wiki? ===
 
There is some documentation about importing in the UPGRADE file distributed with MediaWiki.
 
To follow on from those, this is how at least one individual imported pages from usemod to MediaWiki:
 
Because MediaWiki does not automatically link to [[CamelCase]] style links, you will need to add brackets <nowiki> [[ ]] </nowiki> to all your links. You can do this with the following:
 
First, obtain ImportStage1.txt (or whatever you want to call it) from the importUseModWiki.php script ( use > to pipe the output to a file )
 
Second, do
 
<pre>
sed '/Importing/!s/\ [A-Z]\w*[a-z]\w*[A-Z]\w*[a-zA-Z]/\ \[\[&\]\] /g'
ImportStage1.txt > ImportStage2.txt
</pre>
 
This should create proper links in place of your CamelCase links.
 
'''This doesn't''' work so well for SubPage links - someone care to fix?
 
Then,
 
<pre>
sed 's/upload\:\w*\.\w*/http\:\/\/aberwiki\.org\/uploads\/& /g'
ImportStage2.txt > ImportStage3.txt
</pre>
 
This fixes your upload links. Change the replace text so it fills in your url such as <nowiki>http://www.yourwiki.org/uploads/filename</nowiki>
 
You are now ready to import ImportStage3.txt into your database with a command such as
 
<pre>
mysql -u<mysqluser> -p<yourpass> <db name> < ImportStage3.txt
</pre>
 
'''Note:''' If your <code>importUseModWiki.php</code> outputs an XML file instead of SQL statements, this probably means you have a rather new version of MediaWiki. In such a case, you case import the XML file -- see [[Importing a Wikipedia database dump into MediaWiki]], towards the bottom of the page ('Import XML'). Don't forget to rebuild all the tables -- that page also explains how to do that.
 
=== Is it possible to define a database prefix? ===
 
It is not possible in versions 1.3.x and prior.
 
In versions 1.4 and later it is possible to configure a database prefix during the install process.
It is a good practice to add an _ after the prefix otherwise all the tables will look really clumsy.
 
=== Why is the Help: namespace empty? ===
 
We don't currently have a clean, generic, '''internationalized''' set of help pages. Would you like to write one? However, you will find some useful pages in the [[MediaWiki User's Guide]]. They are of course open content under the GNU FDL.
 
=== I've changed $wgLanguageCode to something else, but nothing happens - what gives? ===
 
MediaWiki will look for interface text in a special namespace, ''MediaWiki''. These messages can be viewed through [[Special:Allmessages]]. Changes to $wgLanguageCode post-install will not be reflected in the interface using the default configuration.
 
To permit the changes to take effect, either:
 
* Run the ''rebuildMessages.php'' script from the command line in ''/maintenance'' folder
::<code>php rebuildMessages.php --rebuild</code>
OR
* Set '''$wgUseDatabaseMessages = false;''' in [[LocalSettings.php]]
 
'''Note:''' ''Using the second option will disable the MediaWiki namespace for the purposes of customising the interface, including items such as the sidebar.''
 
==== What if I can't run rebuildMessages.php from the command line ? ====
 
If you don't have access to a shell/command line (usually the case with third party hosting services) then you may find you can use Martin Geisler's '''phpShell''' software to achieve the desired result (unless SAFE MODE is ''not'' set for php).
 
For more information, visit http://mgeisler.net/php-shell.
 
=== The install stops with no messages or I get a blank page! ===
 
Installation problems are sometimes weird and hard to diagnose. If possible, check PHP's error log (you may have to configure PHP to enable error logging) and report any error messages you have and the ''complete'' output from the installation script to [[mediawiki-l]], we'll see if we can hash it out.
 
If you can track down the problem specifically, please report it directly to http://bugzilla.wikipedia.org/
 
'''Known issues'''
*Version 1.3.3: you'll get a blank page after submitting configuration info on your config/index.php script if you don't make the config directory writeable.
*Version 1.3.x: [[bugzilla:736]]
 
=== I want my wiki to appear in a frame as part of my site, but it keeps popping out of the frame ===
 
MediaWiki contains protection against abusive use of frame sets. Unfortunately this will trap your intentional frames as well -- to remove this, edit <tt>stylesheets/wikibits.js</tt> and remove these lines:
 
(Please note that if the <tt>wikibits.js</tt> file isn't in <tt>stylesheets/wikibits.js</tt> it '''may''' be <tt>skins/common/wikibits.js</tt>)
 
// Un-trap us from framesets
if( window.top != window ) window.top.___location = window.___location;
 
=== How do I change messages of the user interface? ===
 
The user interface text is put into pages in the special [[Help:MediaWiki namespace|MediaWiki namespace]]. When logged in as a sysop, you can edit those pages to immediately change the output of the wiki.
 
Some configuration changes (like changing <code>$wgSitename</code> to set the wiki's name) don't affect the pages which were generated at install time. You can edit them directly, or use the "<tt>rebuildMessages.php</tt>" script in the maintenance directory (it must be run from the command line and you must set up an <tt>AdminSettings.php</tt> file). See [[MediaWiki localisation]].
 
=== Why doesn't my wiki work on Sourceforge? ===
 
See [[Running MediaWiki on Sourceforge.net]].
 
=== How do I install Imagemagick for Thumbnails on Windows? ===
 
With the following installed on the server, it should work:
 
* [http://sourceforge.net/project/showfiles.php?group_id=61776&package_id=89552&release_id=336219 xampp-win32-1.4.14-installer]
* mediawiki-1.5beta3
* [http://www.imagemagick.org/script/binary-releases.php ImageMagick-5.5.7-Q16-windows-dll.exe] (seems not to work with current distribution | Neither for me. php_imagick.dll seems to be looking for a function in CORE_RL_magick.dll that is found instead in CORE_RL_Magick++_.dll.)
 
* php.ini
extension=php_imagick.dll
 
* Localsettings.php
$wgEnableUploads = true;
$wgUseImageResize = true;
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "convert"; #<-- this should point on the right path
 
If its in the windows path variable, you can use "convert" only
 
 
'''Using [http://sourceforge.net/project/showfiles.php?group_id=24099 ImageMagick-6.2.5-Q16-windows-dll]:'''
 
* Install ImageMagick. Make sure the installation directory does not contain any blank spaces.
 
* LocalSettings.php
$wgEnableUploads = true;
$wgUseImageResize = true;
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "convert"; # <-- this should point on the right path
 
* You '''don't''' have to add php_imagick.dll to your php.ini
 
* If you are running php in safe mode, add the ImageMagick installation directory to your php.ini: e.g safe_mode_exec_dir=C:/Programs/ImageMagick.
 
*Also you will have to change permissions for %systemroot%/system32/cmd.exe. Grant read and execute rights to IUSR_XXX and IWAM_XXX.
 
=== The index redirects to localhost or 127.0.0.1 or just times out ===
 
When constructing full URLs and HTTP redirects, MediaWiki uses the hostname provided by the web server. Under Apache this will usually be specified by the ServerName directive if not autodetected from the system.
 
If that is set wrong, you should do one of the following:
* Set the ServerName directive in Apache to the proper hostname
* Override $wgServer in LocalSettings.php with the URL protocol and hostname (eg 'http://example.com')
 
== Usage ==
 
=== How do I create a new page? ===
 
# Go to the page you want the new page to be linked ''from''.
# Click on the ''edit'' tab to edit the page. Add a link to the page you wish to create.
# The way to create a link is to place the new page's title in brackets. <nowiki>[[Page title]]</nowiki>
# Save the page. Your link will show up as a red link which, when clicked, will bring you to an edit page for your new page.
# Edit and save your new page.
 
You can also create pages with a hand-edited URL, but we generally discourage this practice since it creates "orphans", that is, pages with no links to them. Such pages are hard to find.
 
If you want to show a link to the edit page when searches fail, see [[#How do I show a link to create a page when searches fail?]]. If you want MediaWiki to go directly to the edit page when you type the name of a new page into the search box and click "go", set <tt>$wgGoToEdit = true</tt> in your LocalSettings.php.
 
===How do I rename a page and all (some) of the links to it?===
 
Pages may be renamed by any logged-in user, in the standard configuration. Using the "move" tab (in monobook skin) a user may enter a new name for a page. A radio-box will allow the talk page to be moved simultaneously to the new talk page. This will also create a redirect to the new name at the old page name.
 
It's important to check the <nowiki>[[Special:Whatlinkshere]]</nowiki> at the new page name to check for broken redirects and links. Any link which has more than one redirect will "break", leaving the browser looking at the wrong page.
 
===How do I add a table of contents?===
A TOC is added automatically as soon as you have more than three headers. To add one with fewer than four headers, type <nowiki>__FORCETOC__</nowiki> anywhere on the page or <nowiki>__TOC__</nowiki> at the position where you want to have the TOC.
 
To remove a table of contents from a page, add <nowiki> __NOTOC__</nowiki> to anywhere on the page. The __ character before the commands is two _ characters together
See [[Help:Section]] for more information.
 
=== MediaWiki is slow, how can I make it faster? ===
 
* First you should try a PHP cache engine such as [http://eaccelerator.net/ eAccelerator] or [http://pecl.php.net/package/APC APC]. It will save the parsed PHP scripts and enhance performance a lot (this is something you should use anyway on any PHP installation with non-trivial traffic). [http://www.zend.com/store/products/zend-platform/ Zend Platform] also contains a bytecode cache, however its "dynamic content caching" is not supported in MediaWiki at the current time.
* Use [[Squid]] or MediaWiki's native file cache ($wgUseFileCache = true) to cache whole pages
* [[Memcached]] will provide some performance benefit, especially for heavily viewed sites. See also the [http://www.mediawiki.org/wiki/Help:Configuration_settings#Cache cache] section of the configuration settings.
* See the [http://www.mediawiki.org/wiki/Help:Configuration_settings#Reduction Reduction] section of the configuration setting.
* See the [http://www.mediawiki.org/wiki/Help:%24wgUseDatabaseMessages $wgUseDatabaseMessages] setting.
* Switching the MySQL table type to MyISAM may be faster for single-user wikis on lower-end computers. See also: [http://dev.mysql.com/tech-resources/articles/storage-engine/part_3.html MySQL Storage Comparison].
* For a heavy concurrent write load, InnoDB is essential. Set <tt>$wgAntiLockFlags = ALF_NO_LINK_LOCK | ALF_NO_BLOCK_LOCK</tt> to reduce lock contention, at the expense of introducing occasional inconsistencies. Use memcached not the default MySQL-based object cache.
 
=== Can I print out my entire MediaWiki site? ===
 
The short answer to this is no, there is no single function to print the whole site. Each page (using the monobook skin) is formatted for printing, but to print the whole site you need to go to each page and print it separately.
 
However, if you're building, for example, a documentation and support site you can also build a monolithic page which includes (transcludes) all the pages of your document. Create the page using:
<pre>
= Big Headings =
{{:Page title1}}
{{:Page title2}}
 
and so on...
</pre>
This will automatically generate an index for your document as well!
 
=== What is the print-friendly url? ===
 
Normally the print stylesheet is attached so it is automatically used when printing -- just printing or print-previewing a wiki page will demonstrate this.
 
You can force a print friendly view. For example:
 
http://en.wikipedia.org/w/wiki.phtml?printable=yes&title=Main_Page
 
===Can I use commons.wikimedia.org in my installed version of mediawiki ?===
 
No, remote loading is discouraged. If you're really keen, you can set up a mirror of it and use that.
 
=== How do I run a bot? ===
You might want to use [[using the python wikipediabot|the python wikipediabot]].
 
=== How do I purge cached pages? ===
# You can use ?action=purge on individual pages to update their cache dates.
# There is a global $wgCacheEpoch variable which can be set in LocalSettings.php to invalidate all prior cache entries (see DefaultSettings.php)
# If you want to purge all pages in the parser cache, truncate ''objectcache'' table from the wiki database. You may use this command: <pre>TRUNCATE TABLE objectcache;</pre>
# A shell script such as this may be used
<pre>
#! /bin/bash
# mwpurgecache - invalidate mediawiki cache
 
set -e
 
PROG=$(basename $0)
VER=0.1
 
function version() {
echo "$PROG $VER - invalidate mediawiki cache
Copyright (c) 2005 Claudio Jolowicz <claudio@jolowicz.com>
 
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This programs comes with
ABSOLUTELY NO WARRANTEE.
"
}
 
function usage() {
version
echo "Syntax: $PROG [options] [--] [pages]
 
Options:
 
-H, --host host name (default: localhost)
-w, --wiki WIKI server path to wiki (default: /wiki/)
-u, --user USER username for HTTP authentication
-p, --passwd PASS password for HTTP authentication
-d, --dryrun show commands without executing them
-q, --quiet quiet (no output)
-v, --verbose be verbose (print server response)
-h, --help display this message
-V, --version display version information
 
Options and arguments must be separated by whitespace. WIKI must
match wgArticlePath, such that \$wgArticlePath = \"WIKI/\$1\". WIKI
must not contain regex special characters.
 
This script requests all wiki pages listed on the command line by
HTTP, prefixed by the wiki path, appending \`?action=purge' to the
URL. If no pages are specified, it retrieves the list of all pages
from Special:Allpages.
 
Examples:
 
\$ $PROG Main_page Help:Contents
\$ $PROG -H wiki.my.org -w /mediawiki -u joe -p banana
\$ $PROG -H wiki.my.org --dryrun | wc -l
"
}
 
## The '-e#' is a noop option to avoid `Unsupported scheme' errors.
user='-e#'
passwd='-e#'
run=
verbose=-nv
quiet='-e#'
 
opt_host=http://localhost
opt_wiki=/wiki/
opt_user=
opt_passwd=
opt_dryrun=false
opt_quiet=false
opt_verbose=false
while [ "$1" ]
do
case "$1" in
-H|--host) opt_host="$2"; shift;;
-w|--wiki) opt_wiki="$2"; shift;;
-u|--user) opt_user="$2"; shift;;
-p|--passwd) opt_passwd="$2"; shift;;
-d|--dryrun) opt_dryrun=true;;
-q|--quiet) opt_quiet=true;;
-v|--verbose) opt_verbose=true;;
-h|--help) usage; exit 0;;
-V|--version) version; exit 0;;
--) shift; break;;
-*) usage 2>&1; exit 1;;
*) break;;
esac
shift
done
opt_host=${opt_host%/}
opt_wiki=/${opt_wiki#/}
opt_wiki=${opt_wiki%/}/
[ x"$opt_user" = x"" ] || user="--http-user=${opt_user}"
[ x"$opt_passwd" = x"" ] || passwd="--http-passwd=${opt_passwd}"
$opt_dryrun && run=echo
$opt_verbose && verbose="--server-response"
$opt_quiet && quiet="-q"
(
if [ $# -eq 0 ]; then
wget -qO- "$user" "$passwd" "${opt_host}${opt_wiki}Special:Allpages" |
sed -re '/start content/,/end content/p' -e 's/href="([^"]+)"/\nGREPME:\1\n/g' |
sed -nre 's/^GREPME:(.*)$/\1/p' |
grep "^${opt_wiki}"
else
for page; do echo "${opt_wiki}${page}"; done
fi
) |
while read page
do
$run wget -O/dev/null "$user" "$passwd" "$quiet" "$verbose" "${opt_host}${page}?action=purge"
done
 
exit 0
</pre>
 
=== How do I organize pages into subdirectories like /wiki/subdir/PageName ? ===
 
See [[Help:Link#Subpage_feature]].
 
=== How do I make interlanguage links work, like they do on Wikipedia? ===
 
The interlanguage link feature on Wikipedia presents links in the sidebar when the user types text such as <nowiki>[[fr:Accueil]]</nowiki>. This feature is strongly biased towards a multi-wiki setup, with one language per wiki. It's not recommended for the case where multiple languages are contained on the same wiki.
 
If you're still sure you want to use it, here's how it works: a link such as <nowiki>[[</nowiki>''xx'':Pagename]] will be considered an interlanguage link if the following three conditions are satisfied:
 
# <tt>$wgInterwikiMagic</tt> is enabled (which it is by default)
# ''xx'' is listed as a language code in <tt>languages/Names.php</tt> (which most ISO 639-2 codes are)
# ''xx'' is listed as an interwiki prefix in the <tt>interwiki</tt> table of the wiki database.
 
To add an interwiki prefix, edit the interwiki table using your favourite MySQL administration tool, or run a query such as:
 
:<tt>INSERT INTO interwiki (iw_prefix,iw_url) VALUES ('xx', 'http://xx.mysite.com/wiki/$1');</tt>
 
If you want to have multiple languages on the same wiki, it's better to use templates and subpages, like we do on meta. See [[m:Wikimedia Foundation]] for an example of this.
 
=== Search returns no results for some words! ===
 
MySQL's fulltext search engine has a default set of stop words which it ignores, and a minimum word length set to 4 characters by default.
 
To change this you must reconfigure MySQL, see: http://dev.mysql.com/doc/mysql/en/fulltext-fine-tuning.html
 
However, this talks about MySQL generically, and not with regard to using it with MediaWiki.
 
So ... if you took all the defaults for your installation of the OS, MySQL and MetaWiki and have only a small database (i.e. just installed), here's how to go about getting three letter searches:
 
*Firstly, if you already have a big wiki, the change can take a long time. The MySQL reference above has someone who did this for a 4Gb database and it took 10 days! So be careful. Now let's have a go.
 
*The parameter to reset is inside MySQL, and as noted above is discussed on the MySQL web site. Go there for more details if you're into MySQL.
*Find the config file for My SQL - this is normally '''my.cnf''', located in '''/etc'''
*Edit '''my.cnf''' and add the relevent parameter in this file (<code>ft_min_word_len=3</code>). This is normally set to 4 for performance reasons - 4 is the default and not in the '''my.cnf''' file when installed. Make sure this is put under the <code>[mysqld]</code> section of '''my.cnf'''
*Restart MySql, using the Service Controller or stop and restart '''mysqld''' from the command line
*Go into MySql (<code>mysql</code> at the command line)
*Issue the MySql command that you need to look at the wiki database (<code>use wikidb;</code>) - '''note that this may be different if you changed the default wiki database install schema with something like <code>my_wikidb</code>'''
*Rebuild the search indexes by asking to repair the '''searchindex''' table. The command line to type is: <code>repair table searchindex quick;</code> an example is as follows showing what you should see:
 
<pre>
mysql> repair table searchindex quick;
+--------------------+--------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+--------------------+--------+----------+----------+
| wikidb.searchindex | repair | status | OK |
+--------------------+--------+----------+----------+
1 row in set (0.08 sec)</code>
mysql>
</pre>
 
*Retest from your wiki server that you can see [[en:TLA|TLAs]] now - make sure you do have one in your wiki to find though otherwise you won't find it!
*The above was performed on a Fedora Core 4 OS, server was a Compaq ML570. It should work ok for other distributions.
 
=== How can I recover the searchindex table? ===
 
First try REPAIR TABLE. See [http://dev.mysql.com/doc/refman/5.1/en/repair.html How to Repair Tables] in the MySQL manual for more information.
 
If your searchindex table is broken beyond repair, you can run maintenance/rebuildtextindex.php from the command line to recreate it. Sorry, there's no web-based version of this at the current time.
 
=== Can I insert data/template data from another wiki in realtime into my wiki page as my wiki page displays? ===
 
If I want to put info in my wiki from Wikipedia (eg a template such as below) without copying all the data, eg. templates, variables, images etc. etc. to my wiki can I just 'link' to the other wiki (eg. Wikipedia) in real time as my page loads?
 
:This feature is in development. Check back when 1.6 comes out. -- [[User:Tim Starling|Tim Starling]] 07:27, 1 February 2006 (UTC)
 
 
== Configuration ==
 
=== I access the wiki pages on my system by writing ''http://localhost/directorypath''. But, if I try writing ''http://systemname/directorypath'', it throws an error that page not found. ===
 
"Localhost" means the machine you are on; it is not a real name, it's like a pronoun. You need to check two things: does your server have a name? and does the world know this name?
 
To find the first, in Linux, go to a sytem prompt and type the command "hostname". This will return the server's full name. If it doesn't have a name, you can set it (if you are logged in as root) with the command "hostname -v ''servername''. And second, is the server know by this name on the network ? Check with your system/network administrator to find out if the server is registered in the DNS (Domain Naming Sytem) for this ___domain. You can test this by using PING from a command line - if you can ping the server by IP address but not by name, then it is not in the DNS.
 
If both of those are correct, then ...
 
Maybe there is something wrong with your Apache virtual hosts? See the Apache documentation for details.
 
=== How do I change the look and feel of MediaWiki for my own site? ===
 
See [[MediaWiki look and feel]] for a detailed explanation..
 
=== I have lost my skin after upgrading! ===
 
Clear your '''browser''' cache and reload the page.
 
=== How can I disable/enable tabs at top (monobook), add history navigation to article pages, or otherwise move around functional components from page to page? ===
 
Under 1.5, to disable all view top tabs, create a new skin according to the instructions in [[MediaWiki look and feel#Skin]] and name this MonoBookNoViews. Set this as the default theme. Logged in users will need to change their default theme to see the tabs to edit pages, however.
 
You will need to remove the section of code in the MonoBookNoViews.php file which generates the views (top tabs).
 
Search for this code:
<pre>
<div id="column-one">
<div id="p-cactions" class="portlet">
<h5><?php $this->msg('views') ?></h5>
<ul>
<?php foreach($this->data['content_actions'] as $key => $action) {
?><li id="ca-<?php echo htmlspecialchars($key) ?>"
<?php if($action['class'])
{ ?>class="<?php echo htmlspecialchars($action['class']) ?>"<?php } ?>
><a href="<?php echo htmlspecialchars($action['href']) ?>"><?php
echo htmlspecialchars($action['text']) ?></a></li><?php
} ?>
</ul>
</div>
<div class="portlet" id="p-personal">
</pre>
 
Replace it with this:
<pre>
<div id="column-one">
<div class="portlet" id="p-personal">
</pre>
 
To remove the "Edit" links in the content sections, modify monobooknoviews/main.css.
 
Replace this line:
<pre>
* html div.editsection { font-size: smaller; }
</pre>
 
With this line:
<pre>
* html div.editsection { display: none !important; }
</pre>
 
=== How do I change the default skin for users that are not logged in? ===
Set <code>$wgDefaultSkin = 'monobook';</code> in <tt>LocalSettings.php</tt> (see example). Make sure that the quoted skin is in lowercase in the <tt>LocalSettings.php</tt> file (ie: 'monobook', not 'MonoBook') regardless of how the skin name is actually capitalized.
 
=== I've changed settings in LocalSettings.php, such as $wgSitename, but they don't show up in my browser. Why not?===
(Note: As always, first ensure that you're not viewing a cached page - perform a "hard refresh", clear the browser cache, or view a page that didn't exist before the change.)
 
There was a bug in versions of MediaWiki prior to 1.3.6 where variables, such as $wgSitename, were interpolated into user interface messages ''at install'', rather than when the message was requested ([[Bugzilla:296]]). The result was that any later changes to these variables would have no effect on these messages, since the software simply saw them as plain text; all UI messages can be reset to their defaults (with the new variable values) by running the <tt>maintenance/rebuildMessages.php</tt> script. If you upgrade to the latest version of MediaWiki first, these will include dynamic references to the variables (e.g. <nowiki>{{SITENAME}}</nowiki>) and should therefore reflect future configuration changes.
 
Some language files incorrectly set $wgSitename to a local transliteration of "Wikipedia". If this happens, you need to edit the language file, at <tt>languages/Language'''??'''.php</tt>. Search for the $wgSitename and remove the lines where it is set. If you find a problem like this in the most recent version of MediaWiki, you should report it at [http://bugzilla.wikimedia.org bugzilla].
 
===Does MediaWiki automatically capitalize the first letter of $wgSitename?===
 
Yes. This behaviour can be changed using the <span class="plainlinks">[http://www.mediawiki.org/wiki/Help:$wgCapitalLinks $wgCapitalLinks]</span> configuration setting.
 
=== How do I change which page is the "Main Page"? ===
Visit the "MediaWiki:Mainpage" page, enter the name of the new default page, and save changes. MediaWiki should recognize the setting and use the new default page.
 
=== How can I change what the <title> of each page is? Where do I make changes?===
Most of the text that you want to change, can be found in the namespace of MediaWiki.
 
In order to change titles, texts, announcements and the such, go to Special:Allmessages, where you will see the text associated with the pages you wish to change. (As far as I can tell, you need to log in as an administrator (like the one you made when you installed) to edit the protected entries in the MediaWiki namespace.)
 
If you want to change the title in your browser, you need to edit [[MediaWiki:pagetitle]]. Go there and edit it just like you would any other page in your Wiki.
 
In recent versions of MediaWiki, [[MediaWiki:pagetitle]] is <nowiki>$1 - {{SITENAME}}</nowiki> by default. If <nowiki>{{SITENAME}}</nowiki> is producing the wrong text for you, you need to set $wgSitename in your LocalSettings.php.
 
If $wgSitename is correct in LocalSettings.php but <nowiki>{{SITENAME}}</nowiki> is still wrong, it may be that you're using a user-contributed language file which incorrectly sets $wgSitename to a transliteration of "Wikipedia". Edit the language file to correct this. For example, the hebrew language file is at <tt>languages/LanguageHe.php</tt> in your wiki directory.
 
Don't forget to clear your browser cache after you fix it.
 
===How do I enable uploads?===
If you get the following message:
 
Sorry, uploading is disabled.
 
See [http://www.mediawiki.org/wiki/Configuring_file_uploads http://www.mediawiki.org/wiki/Configuring_file_uploads]. For more information and trouble shooting, see [[Uploading files]].
 
===When I try to upload files in Mediawiki 1.5 I always get a "The file is corrupt or has an incorrect extension. Please check the file and upload again." error.===
 
With 1.5, first check whether the [[mediawiki temp dir]] exists and has the right permissions. In general, check your php- and mediawiki-logs for any obvious errors.
 
After, try in the maintenance directory to rebuildImages and then, display the pages with a trailing ?action=purge.
 
This may happen if MediaWiki fails to determine the correct [[:en:MIME-Type|MIME-Type]] for the file you are uploading. For images, this should always work if your PHP has the GD extension enabled. For other files, the file_info or mimemagic extensions can be used (make sure they are configured correctly if present). Alternatively, use an external program for mime detection, by settings <tt>wgMimeDetectorCommand</tt> to the desired command.
 
Under linux, you can use the following in LocalSettings.php:
$wgMimeDetectorCommand= "file -bi"; #use external mime detector (linux)
to your LocalSettings.php file solves this problem in some cases.
 
If all else fails, you should be able to solve this by adding
$wgVerifyMimeType = false;
to your LocalSettings.php file. Note that this will turn off most sanity checks on the file - ''this is a security hazard''.
 
The <tt>file</tt> command did not work for me under Fedora Core 4. It turns out that SELinux was preventing the php script from running <tt>file</tt> on uploaded files. I had to disable SELinux for httpd [http://fedora.redhat.com/docs/selinux-apache-fc3] to get uploading and mime typing to work correctly. 16:02, 25 February 2006 (UTC)
 
===When I try to upload bigger files in Mediawiki 1.5 I always get "Internal error! couldn't move "/tmp/somefile" to "/wikidir/images/temp/filename"===
 
On top of the screen you should see a PHP-error aswell saying something like this:
<nowiki>Warning: move_uploaded_file():
Unable to access /temp/somefile in /wikidir/includes/SpecialUpload.php on line 370</nowiki>
 
The most common reason for this is that upload_max_filesize in php.ini is set to the default of 8MB, and you want to upload a file that is larger. See [http://www.php.net/manual/en/features.file-upload.common-pitfalls.php this section of the PHP manual] for more PHP-related problems. Be careful that you're editing the right php.ini -- PHP is well known for its decoy configuration files. Create a .php file with nothing but <tt><?php phpinfo() ?></tt> to inspect your configuration settings.
 
One user has reported that setting <tt>$wgUploadSizeWarning</tt> to a large number in LocalSettings.php fixed this problem for them.
 
(traslate this, please. I speak Spanish): En una Wiki corriendo sobre Windows corregí este error dando permisos de lectura/escritura al directorio donde está instalado el php (c:\php) y al directorio en donde está la wiki. O sea que es un problema de permisos de las carpetas compartidas.
 
=== How do I use templates? ===
See [[Help:Templates]].
 
=== How do I set the timezone for my MediaWiki? ===
There are two timezone-related settings: $wgLocaltimezone and $wgLocalTZoffset. Set both in LocalSettings.php. $wgLocaltimezone is used for formatting the timezone in signatures, and should be set to the locale name, for example "Europe/Berlin". $wgLocalTZoffset sets the default user preference to the specified number of hours, and is used for timestamps seen in recent changes and history views.
 
=== How do I make my base URLs shorter? ===
See [[eliminating index.php from the url]] for details. You may need access to server files like <tt>httpd.conf</tt>.
 
=== How do I activate HTML-Tags, e.g. "<input>" or "<form>" ? ===
It seems to be possible to activate HTML-Tags like "<input>" or "<form>" (Have a look at [http://wikimediafoundation.org/w/index.php?title=Template:DonateEUR&diff=548&oldid=533], and note the PayPal Buttons working). How does it work ?
:#if you need those HTML-tags for one action only (e.g. this PayPal-Button), but don't want HTML to be activated generally, [[Write_your_own_MediaWiki_extension|write your own MediaWiki_Extension]] which outputs your HTML-needs.
:#the more "dirty"-way is to add '''$wgRawHtml = true;''' to your LocalSettings.php. If you do so, HTML-tags are activated on '''every page'''.
 
==== How do i make '''$wgRawHtml = true;''' work only with sysop user and not with other users?====
 
==== How do I make it so only admins can add full html codes to articles? ====
 
You can't. Due to the way a wiki works, it's all or nothing.
 
===How do I make external links pop up in new browser windows?===
[[Opening external links in a new window]]
 
=== How do I make image pages display the image? ===
 
I installed Mediawiki and image pages display only one line of text pointing to the image itself. I want the actual image to be displayed on the image page like on Wikipedia. How do I do it?
 
:Are you sure the image is not already on the page? Maybe the uploaded images are not getting the right permissions. You could check this in your webserver error log. I'm sorry but wouldn't know how to fix this if it were the case. --Bjørn
 
:I've seen this on a fresh MediaWiki 1.5.5/PHP: 5.0.2 (apache2handler/MySQL: 4.0.21-nton on Apache 2/Windows 2003 and have this exact problem. The Image pages are fine, images upload OK, and images display in the browser. But embedding the image on a page via the Image: tag doesn't work; only a wiki link to the Image page is displayed. Perhaps this was done as part of a WMF file exploit workaround? -- Troy Thompson
 
:We have the same Problem after Upgrade from 1.4.4 -- [[User:212.204.104.82|212.204.104.82]]
 
: can someone please answer this?? I can't get one single image to display on my mediawiki site and I have no idea why it isn't working. I just installed the newest version and I'm a brand new user.
 
This problem is often caused by a missing MIME type in image fields. Try running the ''maintenance/rebuildImages.php'' maintenance script from the command line. [[User:Robchurch|Rob Church]] <sup>''[[User_talk:Robchurch|Talk]]''</sup> 17:10, 8 February 2006 (UTC)
 
I have run rebuildImages.php many times. The major and minor mimes are setup correctly (jpeg and png). Still the images do not appear. Am I missing something else?
Praseed
 
: I'm not sure if this will help any of you, but if you're using a subdomain with hotlink protection, add your subdomain to the list of allowed linkers. After days of installing and reinstalling MediaWiki, then trying another one, I finally realized that it was the subdomain issue.
 
=== How do I enable the "Printable version" option when using MonoBook skin? ===
 
=== How do I disable external links from showing in the printable version of a page? ===
 
=== How do I change default user preferences? ===
 
The following applies to MediaWiki 1.4 and later.
 
The MediaWiki default user preferences are in the language file, i.e. <tt>languages/Language.php</tt> if you're using English. Don't edit that file, just use it for reference, like you do with DefaultSettings.php.
 
Say if you want to change the default number of search results on a page. Language.php says:
 
/* private */ $wgDefaultUserOptionsEn = array(
...
'searchlimit' => 20,
...
)
 
To change it to 50, put this in your LocalSettings.php:
 
$wgDefaultUserOptions = array( 'searchlimit' => 50 );
 
Note that you are setting $wgDefaultUserOptions, which contains the site overrides, not $wgDefaultUserOptionsEn, which contains the software defaults. Any settings in $wgDefaultUserOptions will override those set in the language file.
 
This override mechanism was introduced in MediaWiki 1.4, before then, you had to change the language file. Because this was very inconvenient, two special-case overrides were introduced before the current general override system was developed.
 
To change the default skin, in any version of MediaWiki, set $wgDefaultSkin in LocalSettings.php to the lowercase name of the skin.
 
To change the default namespaces to be searched, in any version of MediaWiki, set $wgNamespacesToBeSearchedDefault in LocalSettings.php to an array mapping namespace indexes to boolean values. For example, to search the main namespace and the category namespace, use:
 
$wgNamespacesToBeSearchedDefault = array(
NS_MAIN => true,
NS_CATEGORY => true,
);
 
In some cases, after you change a default user preference, you may also want to change the user preferences of all existing user accounts. This requires some database hacking. To continue the previous two examples, to change the number of search results, run the following query:
 
UPDATE user SET user_options = REPLACE(user_options, 'searchlimit=20', 'searchlimit=50');
 
To search categories by default, use:
 
UPDATE user SET user_options = REPLACE(user_options, 'searchNs14=0', 'searchNs14=1');
 
14 is the index of the category namespace. See [[Help:Namespace]] for a list.
 
 
=== Is there a way to easily install all Help Documentation after a mediawiki installation? ===
 
No. Also see [http://mail.wikipedia.org/pipermail/mediawiki-l/2006-January/thread.html#9616 Populating the help namespace on the Mediawiki-l list archived].
 
==More complex customization==
 
=== Simple Category Automation ===
 
We all like to keep our wikis tidy. This is a little system that shows every user what to copy and paste into their pages to include it in the right category.
# Create a new template by visiting <nowiki>http://www.yourdomain.com/wiki/Template:Putincategory</nowiki>
# Paste the following into it and save:
<nowiki>[[Image:catalert.png]] '''Please copy and paste the following into the end
of your article to include it in this category:'''
<nowiki>[[Category:</nowiki></nowiki><nowiki>{{PAGENAME}}</nowiki><nowiki><nowiki>]]</nowiki></nowiki>
# Upload the alert image [[Image:catalert.png]] to your wiki.
# On every category page, simply paste the following:
<nowiki>{{Template:Putincategory}}</nowiki>
 
=== How do I add the sandbox functionality to my installation of the wiki? ===
 
In wiki terms, a ''sandbox'' is simply a "play pen"; a page which users can mess about in. This is an ordinary page created in the normal manner, and can be located wherever you like. There is no special sandbox functionality built into MediaWiki.
 
Users often inquire about the Wikipedia sandboxes, which seem to be self-emptying. This is not quite correct; there are a number of volunteers who run bots to clean these up and return them to a certain state at regular time intervals.
 
=== How do I change the logo? ===
 
In your LocalSettings.php add:
 
$wgLogo = '/path/to/your/logo.png';
 
Default is <code>{$wgUploadPath}/wiki.png</code>. Default for version 1.5 is <code>$wgStylePath/common/images/wiki.png</code>
 
Default logo size is 135px by 135px
 
See also [[Customization#How_do_I_customize_the_logo_in_the_top_left_corner.3F]].
 
=== How do I show a link to create a page when searches fail? ===
 
Place wikitext similar to the following in [[MediaWiki:Nogomatch]]:
 
<nowiki>There is no page called $1. You can [[$1|create this page]].</nowiki>
 
This will create a regular "redlink" in the search results page, leading to the edit page. Your users can then create the page as usual.
 
=== How do I change the icon (favicon) in browser's address-line? ===
 
If you want to another favicon. You can change it in '''<tt>/includes/Skin.php</tt>''' file. Change the line from <tt>'href' => '/favicon.ico'</tt> to <tt>'href' => '/path/to/your/favicon.ico'</tt>.
 
The wiki will output a <link> which references the traditional /favicon.ico, at the root URL path of your site. (Some browsers will look there even without the <link>, others require it.)
 
===Is it somehow possible to use a "file" URI-qualifier for local intranets e.g. [file://localhost/C: C-Drive]?===
 
Maybe. You can make MediaWiki support it by adding the "file" protocol to the list of URL handlers. Right now you have to directly edit includes/Parser.php:
 
/* private */ function replaceExternalLinks( $text ) {
$fname = 'Parser::replaceExternalLinks';
wfProfileIn( $fname );
$text = $this->subReplaceExternalLinks( $text, 'http', true );
$text = $this->subReplaceExternalLinks( $text, 'https', true );
$text = $this->subReplaceExternalLinks( $text, 'ftp', false );
$text = $this->subReplaceExternalLinks( $text, 'irc', false );
$text = $this->subReplaceExternalLinks( $text, 'gopher', false );
$text = $this->subReplaceExternalLinks( $text, 'news', false );
$text = $this->subReplaceExternalLinks( $text, 'mailto', false );
<b style="color:red">$text = $this->subReplaceExternalLinks( $text, 'file', false );</b>
wfProfileOut( $fname );
return $text;
}
 
From version 1.4 on, in '''Parser.php''' change the line
 
define( 'URL_PROTOCOLS', 'http|https|ftp|irc|gopher|news|mailto' );
 
to
 
define( 'URL_PROTOCOLS', 'http|https|ftp|irc|gopher|news|mailto|file' );
 
From version 1.5rc4 you need to add the following line to LocalSettings.php
 
<nowiki>$wgUrlProtocols = 'file:\/\/|http:\/\/|https:\/\/|ftp:\/\/|irc:\/\/|gopher:\/\/|news:|mailto:';</nowiki>
 
: Doesn't seem to work [[User:217.91.16.195|217.91.16.195]] 14:29, 14 September 2005 (UTC)
 
'''However''', many browsers will ignore these URLs, so that even though you can create the link, clicking on it will have no effect.
This is because URLs of this type pose an inherent security risk [http://www.mozilla.org/releases/mozilla1.7rc1/known-issues.html#psm].
 
:List of browsers supporting or not supporting the file:/// link from pages delivered from a remote server, which is common to wiki pages:
 
{| border=1
! Browser !! Supports file: links?
|-
|Internet Explorer 6.0 (Windows XP SP1 or SP2)|| no
|-
|Internet Explorer 6.0 (Windows XP Professional Version 2002 SP1)|| yes
|-
|Internet Explorer 6.0 (Windows 2000 SP 4) || yes
|-
|Internet Explorer 5.5 (Windows 2000 SP 4) || yes
|-
|Netscape 7.0 (Windows XP SP1 or SP2) || no
|-
|Opera Version 7.54 Final (Linux) || no
|-
|Opera Version 8 (Windows) || no (2)
|-
|Mozilla 1.7 (Linux) || no /yes (1)
|-
|Firefox 1.0.x (Windows) || no / yes (1)
|-
|Firefox 1.5.x (Windows) || no / yes (4)
|-
|Konqueror (Linux) || yes (3)
|}
 
Was listed as [[bugzilla:614]] (RESOLVED WONTFIX).
 
(1) Enable <tt>user_pref("security.checkloaduri", false);</tt>, see below. Drag of link and drop into ___location bar does not work, in difference to ''Copy link'' / ''Paste link''.
 
(2) Drag of link and drop into ___location bar works fine.
 
(3) Konqueror displays a warning if a remote (eg. http) URL points to a local (file, telnet, irc, whatever), and allows the user to cancel. ((Wikipedia User JensBenecke))
 
(4) Enable in the user.js (is not diplayed in about:config) <tt>user_pref("capability.policy.policynames", "localfilelinks");</tt>, <tt>user_pref("capability.policy.localfilelinks.checkloaduri.enabled", "allAccess");</tt> and the sites name for the access <tt>user_pref("capability.policy.localfilelinks.sites", "http://www.example.com");</tt>. The attribute of ''capability.policy.localfilelinks.sites'' can contain several web pages separated with blanks.
: [http://kb.mozillazine.org/Links_to_local_pages_don%27t_work Links to local pages don't work - MozillaZine Knowledge Base]
 
: A note: According to the [http://www.instiki.org/show/FAQ Instiki FAQ] loading of local file links from http links can be enabled on Mozilla and Firefox by putting <tt>user_pref("security.checkloaduri", false);</tt> into the file <tt>user.js</tt>.
::It should also be possible to set this with the "about:config" interface (just type <tt>about:config</tt> in the address bar, typing <tt>security.ch</tt> into the filter input line then narrows down the displayed options to this one). I'm not sure which version of Mozilla introduced this (I just learned about this interface today).
::However note that this setting is global, i.e. it will affect all sites you browse; while I don't know exactly what the security risk of this is, the fact that the setting is in the security section (and the note "If you don’t give a wit about the security of your local files" on the Instiki FAQ) strongly implies this is a security risk. --[[User:132.199.100.181|132.199.100.181]] 08:08, 29 Oct 2004 (UTC)
 
:::Perhaps if this is set, a malicious website could load a file:/// url into a frame, and read the contents with javascript? Could be a security risk if the right file was opened. --[[User:134.148.20.33|134.148.20.33]] 08:43, 10 May 2005 (UTC)
 
--[[User:194.95.179.181|194.95.179.181]] 13:32, 22 September 2005 (UTC) :
:in addition to version 1.5:<br/>
:may help using links with this format:
<pre>[[file:///%5C%5NAME-OF-COMP-OR-IP-ADR%5SUBDIR%5C20M%F6LLER%5Cfilename.html filename.html]]</pre>
: instead of
<pre>
[[file:///\\NAME-OF-COMP-OR-IP-ADR\SUBDIR\20 MöLLER\filename.html filename]]</pre>
 
:replace Backslash with %5c, space with %20, ö with %F6 etc.<br/>
: This works with MediaWiki 1.5, Explorer 6.0.2800 and Firefox 1.0.6
 
 
:Also in version 1.5 I found I could change the code to accept links like:
[file:\\machine\directory\my.file text]
:..by adding <tt>file:\\\\</tt> to the <tt>define( 'HTTP_PROTOCOLS',</tt> line in parser.php and the <tt>$wgUrlProtocols</tt> variable in DefaultSettings.php, instead of <tt>file:\/\/</tt>. I am not sure if I could get away with changing just one file. This is for MediaWiki running on Windows with Apache. -[[User:Sprintstar|Sprintstar]] 12:40, 1 November 2005 (UTC)
 
There is an extension for this, but I can't manage to get it work. Here it is : http://meta.wikimedia.org/wiki/User:EdmundMielach/FileProtocolLinks --[[User:212.23.162.37|212.23.162.37]] 14:30, 7 February 2006 (UTC)
 
=== How do I add my own dynamic content to MediaWiki?===
Write an extension that implements a special page. See [[Writing a new special page]].
 
===How can I insert one of my PHP functions underneath the "Search" box?===
 
[http://www.dankohn.com/archives/000338.html Dan Kohn has a neat tutorial]
 
===How do I completely lock my database?===
 
Set <code>$wgReadOnlyFile</code> in <tt>LocalSettings.php</tt> to the name of a file, then put the reason for the lock inside the file. The contents of the file will be displayed to anyone trying to edit the wiki.
 
Note that readonlyfile is not guaranteed to be absolutely safe; if you need to guarantee that MediaWiki will never write to the data, you need to do this on the database itself (e.g. revoke UPDATE,INSERT,DELETE from the wiki user, or put MySQL into read-only mode).
 
Since 1.5 you can set $wgReadOnly to a string describing the reason for locking the database, instead of creating a file.
 
:''Please provide examples of where a release or development branch of MediaWiki seems to ignore the $wgReadOnly or $wgReadOnlyFile directives? [[User:Robchurch|Rob Church]] <sup>''[[User_talk:Robchurch|Talk]]''</sup> 17:17, 8 February 2006 (UTC)''
 
 
:''"revoke UPDATE,INSERT,DELETE from the wiki user". -- This does not work. Even main page reading generates such a query (MediaWiki 1.5.6):''<br />
:/* MediaWikiBagOStuff:_doquery */ DELETE FROM `objectcache` WHERE keyname=... --[[User:83.237.101.217|83.237.101.217]] 21:32, 11 February 2006 (UTC)
 
=== How do I move the ___location of the search box? ===
 
This is for the Monobook theme on version 1.5 only and involves modifying the Monobook.php file - you can see the effect [http://www.promixing.com here].
 
* Find and select the following code in '''Monobook.php''':
 
<pre>
<div id="p-search" class="portlet">
<h5><label for="searchInput"><?php $this->msg('search') ?></label></h5>
<div class="pBody">
<form name="searchform" action="<?php $this->text('searchaction') ?>" id="searchform">
<input id="searchInput" name="search" type="text"
<?php if($this->haveMsg('accesskey-search')) {
?>accesskey="<?php $this->msg('accesskey-search') ?>"<?php }
if( isset( $this->data['search'] ) ) {
?> value="<?php $this->text('search') ?>"<?php } ?> />
<input type='submit' name="go" class="searchButton" id="searchGoButton"
value="<?php $this->msg('go') ?>"
/>&nbsp;<input type='submit' name="fulltext"
class="searchButton"
value="<?php $this->msg('search') ?>" />
</form>
</div>
</div>
</pre>
 
* Move it either up or down in the page code, depending on where you want it positioned.
 
* A good place to put the search box is just below the logo. To do this, move or copy the above code directly '''below''' where you find the following:
<pre>
<div class="portlet" id="p-logo">
<a style="background-image: url(<?php $this->text('logopath') ?>);"
href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>"
title="<?php $this->msg('mainpage') ?>"></a>
</div>
</pre>
 
=== How do I put an alphabetical list of links on the top of the category page? ===
 
First, you'll need to edit <var>/wiki/includes/CategoryPage.php</var> and
find the instance method '''shortList''' of class '''CategoryPage'''.
The first line of the function looks like :
<nowiki>$r = "<h3>{$articles_start_char[0]}</h3>\n";</nowiki>
Replace it, adding an '''id''' attribute. The method becomes :
<pre>
function shortList( $articles, $articles_start_char )
{
// !PATCH-ALPHA-CATEGORIES : CategoryPage::shortList
$r = "&lt;h3
id=\"{$articles_start_char[0]}\"
>".$articles_start_char[0]."&lt;/h3>\n";
</pre>
A more professional design could produce :
<pre>
function shortList( $articles, $articles_start_char )
{
// !PATCH-ALPHA-CATEGORIES : CategoryPage::shortList
// !PATCH-ALPHA-CATEGORIES : // !SEE-ALSO $wgAlphaCategoriesPrefix in DefaultSettings.php
global $wgAlphaCategoriesPrefix ;
$wgAlphaCategoriesPrefix = isSet($wgAlphaCategoriesPrefix) ? $wgAlphaCategoriesPrefix : '' ;
$szId = ($wgAlphaCategoriesPrefix === false) ? ''
: ($wgAlphaCategoriesPrefix." id=\"{$articles_start_char[0]}\" ") ;
$r = "&lt;h3 $szId >".$articles_start_char[0]."&lt;/h3>\n";
</pre>
A few lines after, replace, in the same way, the following line:
<nowiki>$r .= "</ul><h3>{$articles_start_char[$index]}</h3>\n<ul>";</nowiki>
With :
<pre>
// !PATCH-ALPHA-CATEGORIES : CategoryPage::shortList
$r .= "&lt;/ul>&lt;h3
id=\"{$articles_start_char[$index]}\"
>{$articles_start_char[$index]}&lt;/h3>\n&lt;ul>";
</pre>
Or, in a more professional design :
<pre>
// !PATCH-ALPHA-CATEGORIES : CategoryPage::shortList
$szId = ($wgAlphaCategoriesPrefix === false) ? ''
: ($wgAlphaCategoriesPrefix." id=\"{$articles_start_char[$index]}\" ") ;
$r .= "&lt;/ul>&lt;h3 $szId >{$articles_start_char[$index]}&lt;/h3>\n&lt;ul>";
</pre>
Then, edit a Category page. Insert a line that looks like
<nowiki>{{A-Z-title|Ma belle liste alphabétique}}</nowiki>
Of course, '''A-Z-title''' is just an example. You may use another template name.
 
Then, because '''A-Z-title''' is not yet defined, click on the link, edit, and enter a content
such as :
<nowiki>=={{{1}}}==
<center>[[#A|A]] [[#B|B]] [[#C|C]] [[#D|D]] [[#E|E]] [[#F|F]] [[#G|G]]
[[#H|H]] [[#I|I]] [[#J|J]] [[#K|K]] [[#L|L]] [[#M|M]] [[#N|N]]
[[#O|O]] [[#P|P]] [[#Q|Q]] [[#R|R]] [[#S|S]] [[#T|T]] [[#U|U]]
[[#V|V]] [[#W|W]] [[#X|X]] [[#Y|Y]] [[#Z|Z]]</center></nowiki>
After reloading the Category page, your page will include something like :
 
'''Ma belle liste alphabétique'''
 
<center>{{A-Z}}</center>
 
Later on, each time you want to add an alphabetic index to a Category page, simply reuse your '''A-Z-title''' :
<nowiki>{{A-Z-title|Ma très belle liste alphabétique}}</nowiki>
 
Four related templates are available in this [[Template_talk:A-Z|discussion page]].
<nowiki>{{A-Z}}</nowiki>
<nowiki>{{A-Z-title|Ma belle liste}}</nowiki>
<nowiki>{{A-Z-prefix|cp_}}</nowiki>
<nowiki>{{A-Z-title-prefix|Ma belle liste|cp_}}</nowiki>
 
In a professional design, you should add in the <var>/wiki/includes/DefaultSettings.php</var>
something like :
<pre>
// !PATCH-ALPHA-CATEGORIES : // !SEE-ALSO CategoryPage::shortList in CategoryPage.php
/*
* $wgAlphaCategoriesPrefix = false ; // disable feature
* $wgAlphaCategoriesPrefix = '' ; // default
* $wgAlphaCategoriesPrefix = 'myprefix_' ; // customized prefix
*/
$wgAlphaCategoriesPrefix = '' ;
</pre>
In this case, you may eventually add, in your <var>/wiki/LocalSettings.php</var> something like
$wgAlphaCategoriesPrefix = 'cp_' ;
In this case, you'll use one of these templates :
<nowiki>{{A-Z-prefix|cp_}}</nowiki>
<nowiki>{{A-Z-title-prefix|Ma belle liste|cp_}}</nowiki>
 
::<small>in this note, non-english (french, spanish, german, etc) expressions are voluntary used to denote examples,</small>
::<small>[[PHP]] variable names such as <var>$szId</var> use [[hungarian]] prefixes,</small>
::<small>patterns such as <var>// !PATCH...</var> are so-called [[haDoc]] comments, not to be confused with appropriate [[phpDoc]] comments.</small>
 
=== How can I add a variable <nowiki>{{</nowiki>CURRENTWEEK}} for a "Featured article of the week" or similar? ===
 
Upgrade to 1.4 or later. Note that in PHP 4.4.1, PHP's week number function was changed to return a two-digit week number, with a leading zero for weeks less than 10. In MediaWiki 1.5.5 and later <nowiki>{{CURRENTWEEK}}</nowiki> will produce week numbers without a leading zero regardless of PHP version.
 
=== How do I change the contents of the navigation toolbar? ===
The solution is different between MediaWiki versions.
 
* For MediaWiki 1.5 or newer, see [[Help:Navigation bar]].
* For MediaWiki 1.3/1.4, see [[Customization:Quickbar]].
 
If the page doesn't change in the desired way after applying the changes, just point your browser to ''http://yoursite.tld/index.php/MainPage?action=purge''. Notice the "action=purge"-Part which clears the webpage cache.
 
==== Changing the files (php-installation-files)====
 
===== General notes =====
Every link in the navigation box is specified in two parts - the ''text'', and the ''target''. Each of these is stored in an interface message; that is, a page in the [[Help:MediaWiki namespace|MediaWiki namespace]] (in most situations, editting the LanguageXX.php files ''will have no effect on a running wiki'').
* if the content of the "target" message is a full URL (i.e. begins <nowiki>http://</nowiki>, etc), the result will be an external link equivalent to <code><nowiki>[<target> <text>]</nowiki></code>
* otherwise, the target will be interpreted as the name of a wiki page, and the link will be the equivalent of an internal link like <code><nowiki>[[<target>|<text>]]</nowiki></code>
'''You do not need to edit any PHP files to change the text or target of existing links, you need only find and edit the appropriate <code>MediaWiki:<whatever></code> pages.''' ('''Note''': This way you can only edit preconfigured variables. You are not totally enabled to edit the navigation-bar)
 
===== In version 1.5 =====
Follow instructions as per 1.4, except that instead of working with the files LocalSettings.php and DefaultSettings.php, the list is held in the <nowiki>[[MediaWiki:Sidebar]]</nowiki> page. You have to be logged into the Wiki with an adminstrator account change these pages.
 
The default should be:
 
<pre>
* navigation
** mainpage|mainpage
** portal-url|portal
** currentevents-url|currentevents
** recentchanges-url|recentchanges
** randompage-url|randompage
** helppage|help
** sitesupport-url|sitesupport
</pre>
 
===== In version 1.4 =====
 
====== How the navigation bar is rendered ======
 
[[Image:Wiki2.png]]
 
The rendering of one of the stock items, the '''Community portal''' of the english wiki, in the 4array:
 
# (In blue) The key for the visible text is fetched from the [[Help:MediaWiki namespace|MediaWiki namespace]]
# (In blue) The text under that key is placed in the navigation bar.
# (In red) The target page or URL for the link is also fetched from the Mediawiki namespace.
# (In red) The text from the "href" key is the link for the entry in the navigation bar.
 
====== How to customize your own navigation bar ======
 
The list of pages is defined in an array called <code>$wgNavigationLinks</code>; copy the entire array from <code>includes/DefaultSettings.php</code> to <code>/LocalSettings.php</code> if you wish to edit it (''never edit DefaultSettings.php itself''). The default array looks like this:
 
$wgNavigationLinks = array (
array( 'text'=>'mainpage', 'href'=>'mainpage' ),
array( 'text'=>'portal', 'href'=>'portal-url' ),
array( 'text'=>'currentevents', 'href'=>'currentevents-url' ),
array( 'text'=>'recentchanges', 'href'=>'recentchanges-url' ),
array( 'text'=>'randompage', 'href'=>'randompage-url' ),
array( 'text'=>'help', 'href'=>'helppage' ),
);
 
Each line of this array represents a link in the navigation box; ''remember that these are pointers into the database, not the actual text used.''
 
* '''To edit a link''': you do not need to copy and edit the <code>$wgNavigationLinks</code> array; simply find the appropriate pages, such as [[MediaWiki:portal]] and [[MediaWiki:portal-url]], and edit them while logged in with "sysop" privileges. The page [[Special:Allmessages]] can be useful for finding these and other editable interface elements.
* '''To remove a link''': copy the array as described above, and simply delete the appropriate line.
* '''To add a new link''':
*#add a line of the form <code>array( 'text'=>'something', 'href'=>'something-url' ),</code>; "something" (Blue in the illustration above) and "something-url" (Red in the illustration above) can be whatever you like, and should be something you will remember and recognise later.
*#edit (create) the pages [[MediaWiki:something]] (Blue above) and [[MediaWiki:something-url]] (Red above) in your wiki, substituting the names you chose at step 1 (the "MediaWiki:" part refers to the [[Help:MediaWiki namespace|MediaWiki namespace]]; whatever names you chose at step 1, the pages to edit will be of the form "[[MediaWiki:<your name here>]]"). The first should contain whatever you want the link's text to be (e.g. "Donate") (Blue above), and the second either the name of a wiki page (e.g. "Project:Get in touch") or the full URL of an external document (e.g. "http://example.com/feedbackform.php"). Make sure that if you are linking to a wiki page that you put the name of the page, not a link to that page (no double brackets) or you will end up with a link to an error message (error: link target missing) when the Quickbar is rendered, rather than a link to the intended page.
 
Edited robbr 8/11/05 - colour references were incorrect
 
Remember: if your changes don't show up, remember to clear/by-pass your browser cache.
Also you must not have $wgUseMemCached set to true, having this set will cause these links to not work.
 
===== In version 1.3 or earlier =====
 
In versions earlier than 1.4, there is no simple way to add a new link to the navigation bar. However, the existing links in version 1.3 behave in the same way as described - they are composed from two pages in the [[Help:MediaWiki namespace|MediaWiki namespace]].
 
*'''To edit a link''': find the appropriate "message" (page in your wiki), for instance by looking at your [[Special:Allmessages]] page, and make your changes. For instance, the "Community Portal" link has the text of [[MediaWiki:Portal]], and the target found in [[MediaWiki:Portal-url]]; similarly, [[MediaWiki:Sitesupport]] and [[MediaWiki:Sitesupport-url]], and others. The target can be either ''internal'' (just the name of a wiki page) or ''external'' (a full URL, beginning <nowiki>http://</nowiki> etc).
*'''To remove (hide) a link''': set the text of the link to "-" (a single hyphen, without the quotes); e.g. if [[MediaWiki:portal]] contained only "-", no "Community portal" link would appear.
 
Remember: if your changes don't show up, remember to clear/by-pass your browser cache.
 
====Using a wikipage as a source for a navigation bar====
 
Sometimes even the navigation-bars should be available for editing by a normal user, who has no access to the [[:en:PHP|PHP]]-scripts working in the background. A solution for this approach is to include a defined pagename. The advice below uses the [[namespace]] "MediaWiki" and the "function msgWiki( $str )", located in "include/SkinTemplate.php". That function renders a pagename within the MediaWiki-namespace to HTML. Within other skins, not using "SkinTemplate.php" this is not working.
 
=====MonoBook (MediaWiki 1.44, 1.54)=====
 
You have to modify the file skin/MonoBook.php
This advice works '''only ''' with the [[Skin]] [[MonoBook]]
 
* Insert a new page into the [[:en:Help:Namespace|namespace]] '''MediaWiki'''. E.g. [[MediaWiki:MenuNavigation]]
 
* Fill this article/wikipage with content (MediaWiki-Markup-Style) like:
<pre>
* [[an internal link]]
* [[another internal link]]
* [http://www.Link.de a external http-link]
</pre>
 
* open the file skins/Monobook.php
 
* look for:
 
<pre>
<h5><?php $this->msg('navigation') ?></h5>
<div class="pBody">
<ul>
<?php foreach($this->data['navigation_urls'] as $navlink) { ?>
<li id="<?php echo htmlspecialchars($navlink['id'])
?>"><a href="<?php echo htmlspecialchars($navlink['href']) ?>"><?php
echo htmlspecialchars($navlink['text']) ?></a></li><?php } ?>
</ul>
</div>
</pre>
 
* replace the lines:
 
<pre>
<ul>
<?php foreach($this->data['navigation_urls'] as $navlink) { ?>
<li id="<?php echo htmlspecialchars($navlink['id'])
?>"><a href="<?php echo htmlspecialchars($navlink['href']) ?>"><?php
echo htmlspecialchars($navlink['text']) ?></a></li><?php } ?>
</ul>
</pre>
 
with:
 
<pre>
<?php $this->msgWiki( 'MenuNavigation' ) ?>
</pre>
 
* The result should look like this:
 
<pre>
<h5><?php $this->msg('navigation') ?></h5>
<div class="pBody">
<?php $this->msgWiki( 'MenuNavigation' ) ?>
</div>
</pre>
 
* You can add further navigations-blocks the same way.
 
'''[http://en.giswiki.de Example]'''<br><br>
[[User:HeinzJo|HeinzJo]] 20:39, 12 Jun 2005 (UTC)
 
===How do I change the page footer?===
This is a dynamic element which is implemented in PHP code. If you are using the default MonoBook skin, the "About" and "Disclaimer" links are being generated by skins/MonoBook.php. You can either modify this file in place (but remember that it will be overwritten by updates) or copy it and make a custom skin (perhaps changing the default skin to the new one).
 
=== How do I create a small [http://en.wikipedia.org/wiki/Wiki_farm wiki farm]? ===
After copying the mediawiki source tree in /opt/mediawiki/ you need to run something like:
 
mkdir .../wiki
cd .../wiki
mkdir images
ln -s /opt/mediawiki/languages /opt/mediawiki/includes \
/opt/mediawiki/skins /opt/mediawiki/redirect.php /opt/mediawiki/index.php .
cp -a /opt/mediawiki/config/ /opt/mediawiki-1.5/install-utils.inc .
chown www-data: config/ images/
# configure your new wiki and fix the permissions
rm -rf config install-utils.inc
 
Then add /opt/mediawiki to the commands which set the include_path in config/index.php and add something like this to the main index.php, before require_once():
 
ini_set( "include_path", "/opt/mediawiki:." ); # line added
require_once( './includes/Defines.php' ); # existing line
 
* Make sure that your webserver can read from /opt/mediawiki
 
You may also want to visit [[#Is_it_possible_to_install_more_than_one_wiki_.28MediaWiki.29_on_a_server.3F_How.3F]] for further information about standardising the log in for users across multiple wikis.
 
You can also look at the (rather complex) [http://wp.wikidev.net/Wiki_farm setup wikimedia is using]
 
=== How do I add [[w:Metatag]]s ===
The page includes\OutputPage.php defines within the function '''addMetaTags ()''' the output of metatags.
This function can be used to define further [[metatag]]s.
 
The existing command ''$wgOut->addMeta ( 'KEYWORDS' , $a.) ;'' can be added by further keywords just by adding a dot and a comma separated list. The change would look something like <pre>$wgOut->addMeta ( 'KEYWORDS' , $a.', your Keywords, Comma separated') ;</pre>
 
Additional Metatags can be added too.
 
Just add further lines as last lines of the function addMetaTags() like:
 
$wgOut->addMeta ( 'LANGUAGE' , 'de') ;
 
[[User:HeinzJo|HeinzJo]] 18:53, 14 Jun 2005 (UTC)
 
This solution can be used to add the same keywords to each page. How can we add specific keywords to specific pages?
 
Should not we define a MediaWiki tag, in the page, to define the keywords?
 
We currently have the opportunity to add comments, which are not displayed: Maybe a special comment could be detected by the engine and used to fill the string this->Keywords.
 
Any idea?
 
[[User;Jean-Dom|Jean-Dom]] 20:01, 9 Aug 2005 (UTC)
 
I am also interested in the ability to allow users to insert metatags into a page when they edit it. Has any thought been given to the above question?
 
[[User:Pekadad|Pekadad]] 15:55, 30 November 2005 (UTC)
 
=== How do I add search-engines to the Search-Results for further investigations ===
* Create a new page within the [[MediaWiki:Namespace]], e.G. ''<code>MediaWiki:SearchInSearchEngines</code>''.
 
* Fill that page with content e.g.:
<pre>*[http://groups.google.de/groups?q=$1&hl=de alle '''Google Newsgroups''' nach "$1" durchsuchen]</pre>
Important is the variable '''$1'''. It is the content of searched words.
 
* Open the PHP-file "<code>SpecialSearch.php"</code> within the subdirectory "<code>includes</code>" of the MediaWiki-installationsdirectory.
 
* Find the function "<code>function goResult( $term )</code>"
 
* Insert at the end before the last line:<pre>$wgOut->addWikiText( '<p>' . wfMsg('SearchInSearchEngines', $term ) . "</p>\n" );</pre>
 
* Do the same with function: "<code>function showResults( $term )</code>"
 
* A Sample: http://www.giswiki.de/index.php/Spezial:Search?search=OpenSource&fulltext=Suche
 
* Enhancements: Handling empty spaces.
 
=== How do I reset the popular page counters ===
In <= 1.4:
UPDATE cur SET cur_counter=0;
 
In >= 1.5:
UPDATE page SET page_counter=0;
 
=== How do I create a custom namespace? ===
See [[Help:Custom namespaces]]
 
=== How do I see a list of users watching a page? ===
You can't, mainly because watchlists are considered to be more or less
"private" information. Obviously, the information's in the database if
you wanted to hack up an extension to do it, but there's no in-built
facility for it.
 
Remark: [[Enotif|EnotifWiki]] indicates the ''number'' of watching users in Recent Changes views.
 
=== How do I modify the search-engine to search also all 'sister' projects? ===
 
=== How do I permanently remove old revisions ===
 
A description of how to permanently remove the histories of all current pages is only available for the older versions of mediawiki. How can this be done for the new Version? PHP Script? SQL?
 
This is the version 1.5.5 workaround that I have come up with on how to permanently remove the histories of current pages from your database.
*The first step is to go to the page that you would like to delete the revision history of.
*The Second step is to actually delete that page.
*The third step is to select restore deleted page from the screen that pops up after deleting the page.
*Restore only the latest revision of your page.
*Then log on to phpmyadmin or your favorite db tool and go to your database.
*Select the archive table from your database and select to empty or truancate it.
 
This should leave your database nice and clean of all of the former revision entries for that page. (However you might have to control-refresh or clear your history to view the changes when you browse your site.)
[[User:Soylent red2722|Soylent red2722]] 16:12, 10 January 2006 (UTC)
 
== User administration ==
 
=== Basic User Account Management? ===
As a sysop, how do I see basic information about users like username, realname, email? How do I find the ip of a user for previous edits? What is the best way to roll back a users edits globally?
 
 
=== I want to see new user-registrations in RecentChanges===
What do I have to do, to see new user-registrations in RecentChanges ?
me too :-)
 
: You can use the "Newuserlog"-Extension... you can get it from the [http://cvs.sourceforge.net/viewcvs.py/wikipedia/extensions/Newuserlog/ CVS-folder]. Copy this file into your "extensions"-folder, and integrate the file into "LocalSettings.php"... should work then...
 
===How do I change a user's password?===
Assuming that <var>$wgPasswordSalt</var> is set to true (the default), you can use the following SQL query:
 
UPDATE user SET user_password = MD5(CONCAT(user_id, '-',
MD5('somepass'))) WHERE user_name = 'someuser';
Where obviously "somepass" is changed to the password you want to set and "someuser" is changed to the user name as it is listed in the table "user".
 
Note: the user_id in the CONCAT string is a column name and is not meant to be replaced with 'someuser'
 
=== User forgot his/her password, has no e-mail address ===
Let the user step through a '''"mail me a temporary password" cycle''' with a working e-mail address of her discretion, which you temporarily enter into her user account record.
 
You need to have
:(a) access to the Wiki database (table user) ''and''
:(b) a working e-mail system
 
Check requirement (b) by mailing yourself a temporary password via the login screen button. Make sure, that you have set up correctly your own e-mail address.
 
# As WikiSysop you enter temporarily user's e-mail address into user account in db table user.
# Tell the user to click "Mail me a temporary password" on the wiki login screen
# S/he will receive a temporary password soon
# S/he can now login with the password and
# S/he now must set up a new password for her/his account
 
The trick also overcomes any problem with salted or unsalted passwords.
 
===How do I allow only logged-in users to edit?===
See [[Setting user rights in MediaWiki]] for questions relating to user rights.
 
First you need to determine MediaWiki version. Go to Special pages, Version.
 
==== MediaWiki version 1.5.1 or later ====
To stop people other than this SysOp (Admin) from creating accounts, add this line in <code>LocalSettings.php</code>:
// Only SysOp (Admin) can create accounts -
$wgGroupPermissions['*']['createaccount'] = false;
 
To stop people from anonymously editing pages without being logged in, add this line in <code>LocalSettings.php</code>:
// No anonymous editing allowed -
$wgGroupPermissions['*']['edit'] = false;
 
==== MediaWiki version earlier than 1.5.1 ====
Add this in <code>LocalSettings.php</code>:
$wgWhitelistEdit = true;
 
==== Testing ====
To test whether anonymous editing disable worked, make sure you are really logged out. Possibly
you will be kept logged in using some cookie or whatever, in such case press "Log Out" in top right corner.
 
===How do I require an email address be specified at registration?===
 
===How do I allow only authorized users to view pages?===
There are two hacks (patches) for this. See [[Page access restriction with MediaWiki]] and [[Hidden pages]]. Alternatively using native wiki [[Preventing Access]].
 
===How do I reassign edits from one user to another?===
 
===Pre-1.5.7===
 
cd <path to mediawiki>
rm attribute.sql
php maintenance/attribute.php OldUserNameOrIP NewUserName
mysql < attribute.sql
 
Always start with a fresh sql file, since attribute.php appends to it. The nice thing is you can run attribute.php a bunch of times, then commit them with one run of mysql.
 
===1.5.7 upwards===
 
Run the ''reassignEdits'' maintenance script from the command line to reassign edits from one user to another.
 
<pre>Usage: php reassignEdits.php <from> <to> [--force]
 
<from> : Name of the user to assign edits from
<to> : Name of the user to assign edits to
--force : Reassign even if the target user doesn't exist</pre>
 
===How do I make a user a Sysop?===
 
Goto: [[Special:Userrights]]
and enter the username. Click on "sysop" from the "Available groups" list.
Only a user with "Bureaucrat" rights may make a user sysop.
 
===How do I remove Sysop-Rights from a user ? ===
see [[Setting_user_rights_in_MediaWiki#Revoking_user.27s_privileges|Setting_user_rights_in_MediaWiki]]
 
===How do I manage user rights and groups? ===
see [[Setting_user_rights_in_MediaWiki]] (version 1.4 and older) or [[Help:User rights]] (version 1.5 and newer).
 
===How do I allow any user to edit but the edited pages only updated on wiki after being approved by moderators? ===
 
[[How to become a MediaWiki hacker|Add the appropriate functionality to the code]]. <tt>;p</tt> There is no way of doing this with the current software, although if written well it could prove a useful alternative for page protection.
 
===How do I edit the Log in page to add a question so that only people with the correct answer are allowed to create a new account?===
Add the functionality to the code, as shown above. There is no other way with the current software.
 
See [http://www.fxparlant.net/Category:Mediawiki#Captcha FxParlant CAPTCHA] to learn how to add a [[CAPTCHA]] capability, requiring that users correctly interpret a visual image.
 
===How do I delete a user from my list of users?===
 
MediaWiki does not support the deletion of user accounts. To prevent an account from being used, either scramble the password or set up an indefinite block on the account.
 
'''Do not remove users from the <tt>user</tt> table in the mySQL database; this causes problems with other parts of the wiki due to the relational structure of the database.'''
 
====How do I scramble the password or set up an indefinite block?====
A wiki system administrator can block a username on the ''Special:Blockip'' page (a restricted special page - look under ''Special pages'' in the toolbox). One of the options for the block length is ''infinite''.
 
Alternately, an administrator with direct access to the wiki database can change a user's password. Scrambling a password is simply changing the password to some random text. The script from the "How to change a user's password" FAQ (above) can be used.
 
====But can I rename the user, then?====
Deleting the user is not strictly necessary, but it would help to be able to rename it to something neutral. Is it possible to change the username to something else?
 
In MediaWiki 1.5, bureaucrats can rename users directly in the wiki with the [[Renameuser|Renameuser extension]] installed. In previous versions, it required direct manipulation of the database:
<pre>
update low_priority user set user_name='NewUsername' where user_name='OldUsername';
update low_priority user_newtalk set user_ip='NewUsername' where user_ip='OldUsername';
update low_priority cur set cur_user_text='NewUsername' where cur_user_text='OldUsername';
update low_priority old set old_user_text='NewUsername' where old_user_text='OldUsername';
update low_priority archive set ar_user_text='NewUsername' where ar_user_text='OldUsername';
update low_priority ipblocks set ipb_address='NewUsername' where ipb_address='OldUsername';
update low_priority image set img_user_text='NewUsername' where img_user_text='OldUsername';
update low_priority oldimage set oi_user_text='NewUsername' where oi_user_text='OldUsername';
update low_priority recentchanges set rc_user_text='NewUsername' where rc_user_text='OldUsername';
</pre>
 
 
===How do I block a range of IP?===
How do I block a range of IP, e.g. 84.172.2xxx, so that every user, starting with this IP will be blocked?
 
===How do I change the name of the default administrator?===
 
Instead of changing the name of the administrator, create a new user with the desired name, and assign '''''sysop''''' privileges to that user with ''Special:Userrights'' (1.5 and later), or ''Special:Makesysop'' (pre-1.5).
 
If this is to be your primary account on the wiki, you may want to consider assigning the '''''bureaucrat''''' privilege as well.
 
=== How do I assign a username to an IP address? ===
(Question asked by [[User:Blueeyor|Blueeyor]] on 20:06, 25 Apr 2005 (UTC))
 
You can't have a specific IP become a specific user. You ''can'' check the "remember me" box.
 
If you want all the edits of one IP to be attributed to an user, see [[#How do I reassign edits from one user to another?|How do I reassign edits from one user to another?]] above.
 
=== How do I change an edit history from an IP address to a userID? ===
(Question asked by [[User:Blueeyor|Blueeyor]] on 20:06, 25 Apr 2005 (UTC))
 
See [[#How do I reassign edits from one user to another?|How do I reassign edits from one user to another?]] above.
 
=== How do I make a page only viewable by a WikiSysop or Bureaucrat or a particular user? ===
(Question asked by [[User:Wiseleyb|Wiseleyb]] 26 Apr 2005)
 
There are three hacks (patches) for this. See [[Page access restriction with MediaWiki]], [[Hidden pages]] and [[Regexp wgWhitelistRead|Regular expressions for wgWhitelistRead]].
 
=== How to add a new user when anonymous wiki access is not allowed? ===
Login as a sysop then use the special page: Special:Userlogin to add the new user account.
 
=== How do I restrict User:<username> page to be edited by only <username> and Sysop? ===
 
The current version of the [[Page access restriction with MediaWiki]] patch allows you to do this.
 
=== How do I, that only logged-in users can see the toolbox? ===
 
Thanks for your help!
 
:Look at this page: [[Customization#How_do_I_remove_the_toolbox_for_users_that_are_not_logged_in.3F]] --[[User:RaZorEdge qc|RaZorEdge qc]] 03:38, 4 February 2006 (UTC)
 
=== How do I add multiple user accounts? ===
Login as a sysop then use the special page: Special:Userlogin to add the new user's account.
 
: ''I have had good luck in 1.4 and 1.5 with importing tab-delimited data into the mw_user table. This was for an "authorized-editors only" site, with public read, but only member write. I disabled public editing and account creation, imported the user data, with an illegal password field (any single character will do), then required users to use the "mail me a new password" button in order to log in and change their password. --[[User:Bytesmiths|Bytesmiths]] 21:24, 19 December 2005 (UTC)''
 
=== How do I edit error messages? ===
[[Special:Allmessages]] contains a complete list of messages (error or otherwise), that can be edited. Alternatively, you could also view and edit your languages/Language.php file, which also contains some messages.
 
=== How can I edit wiki that everytime a new article is created, users get email notification? ===
 
=== How do I, as an owner of two wiki's, get the ability to use CheckUser on those wiki's? ===
 
A little more info, our wikis are not a part of wikimedia or its projects, we just use the mediawiki software. How do we get access to checkuser to help combat spam and vandals on those wiki's? --[[User:PatriarchAnthony|PatriarchAnthony]] 08:20, 13 January 2006 (UTC)
 
:# Install the CheckUser extension [http://cvs.sourceforge.net/viewcvs.py/wikipedia/extensions/CheckUser.php from CVS]
:# Set the value of $wgCheckUserLog in LocalSettings.php to point to a writable log file
:# Grant the ''checkuser'' permission using ''Special:Userrights''
 
:[[User:Robchurch|Rob Church]] <sup>''[[User_talk:Robchurch|Talk]]''</sup> 23:14, 19 February 2006 (UTC)
 
=== How do I force anonymous users to login, but not create accounts, nor see any other pages? ===
 
Q: I want to create all accounts myself -- as a sysop. I set <tt>$wgGroupPermissions['*']['read']=false;</tt> as well as <tt>'edit'</tt> and <tt>'createaccount'</tt>. This is "very secure", but prevents the anonymous users from even accessing the "Special:Userlogin" page &mdash; the only way for them to stop being anonymous. How do I solve this problem?
 
A: Ok, one needs to list the "Special:Userlogin" explicitly in the <tt>$wgWhitelistRead</tt> array in LocalSettings.php -- the file Defaultsettings.php provides examples. The trick is, the page's title is different depending on the language used, and -- in case of non-ASCII language -- must be entered in Unicode. In my case -- [[Спеціальні:Userlogin]].
 
 
''Additional note:''
Sometimes in Windows system that even you entered Unicode, it still won't work, the solution is following:
 
:For more esoteric languages, for which your editor and PHP parser might be in disagreement over file encoding such as under '''''Windows''''', you could use the PHP urldecode() to input the page names. For example in Hebrew you could use:
 
# "Special":Userlogin (in Hebrew)
$wgWhitelistRead = array( urldecode("%D7%9E%D7%99%D7%95%D7%97%D7%93:Userlogin"),
# "MainPage" in Hebrew
urldecode("%D7%A2%D7%9E%D7%95%D7%93_%D7%A8%D7%90%D7%A9%D7%99") ) ;
 
 
== How can i became a administrator in wiki? ==