MediaWiki よくある質問と回答集
From Meta, a Wikimedia project coordination wiki
Other languages:
[edit] General
[edit] なぜ MediaWiki を使う必要があるのでしょうか?
使うべきではないかもしれませんよ。MediaWiki は wiki エンジンの一つであり、すべての目的に適しているわけではありません。例えば専用のコンテンツ/ドキュメント・マネージメント・システムの方が便利なこともあります。機能一覧とMediaWikiを使用しているサイトの一覧を調べてみてください。 ソフトウエアのレビューも役に立ちます。
[edit] "Wikimedia" と "MediaWiki" は同じものですか?
いいえ。Wikimedia は wiki をベースにオープンコンテントのプロジェクトを展開している非営利団体、Wikimedia財団 の名前です。MediaWiki はその財団が使用する目的に沿って開発されたソフトウェアの名前です。
さらに詳細が知りたければ名前の問題をご覧ください。
[edit] バグレポートや機能追加の要望は、どこへ投稿すればいいですか?
すべてのバグレポートと機能要望はメディアジラに投稿してください。投稿する前に、すでにその機能やバグが投稿されていないか、新しいバージョンで直されていないか検索して調べてください。重複した投稿が内容にお願いします。
[edit] この FAQ で回答されていない質問があります。どこで尋ねればいいでしょう?
ここ以外では
[edit] インストール
See also:
- How do I set up interwiki links?
- How do I enable uploading files?
- How do I enable TeX (aka 'math support')?
- 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?
[edit] MediaWiki をインストールするにはどうすればいいですか? どのようなシステムが必要ですか?
Help:MediaWikiのインストールを参照してください。
[edit] 一つのサーバに複数の wiki (MediaWiki) をインストールすることは可能ですか?どうすればできますか?
可能です。MediaWiki は同じデータベース上で異なるテーブルプレフィックスを指定(インストール時に設定)するか、完全に別のデータベースを使うかして、異なるディレクトリに複数回インストールすることが可能です。
付け加えるならば、すべてのインストールに対し幾つかの設定を共通化し、これらに対する変更を一箇所で管理したいと思うかも知れません。設定ファイル(LocalSettings.php)は PHP コードとして実行されるので、PHPのインクルードメカニズムを利用してこれを実現することができます - 例えば、それぞれの LocalSettings.php に include_once("../CommonSettings.php") の行を追加し、すべてのwikiに適用したい設定を ../CommonSettings.php に置きます。
もし一つのホストに大量の wiki を抱えているならば、それぞれの wuki に対しソースコードのコピーを繰り返したくないかも知れません。その代わりに、ソースをどこか別の場所に解凍し、それぞれの wiki のインストールに対しては、LocalSettings.php ファイルのみを残して、MediaWiki ディレクトリ全体を symlink します。これは lndir コマンド(幾つかの Linux installations で利用できます)あるいは同等のツールを使って実現できます。
そして、それぞれの wiki に別々の LocalSettings.php を利用するか、あるいは (より管理が楽なように)URL に基づいて設定を決定します。Wiki farmも参照のこと。
同じサーバ上で動いている wiki 間でログイン状態を維持し続けたいならば、単純に下記の行を LocalSettings.php の $wgSiteName = ... の後に付け加えてください:
ini_set("session.name", "{$wgSitename}Session" );
(ただ、$wgSiteName にスペースが含まれている場合は、トラブルを引き起こす可能性があります。その場合は {$wgSiteName} を完全にスペースを取り除いたものに置き換えてください。
[edit] 別の種類の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 [[ ]] 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
sed '/Importing/!s/\ [A-Z]\w*[a-z]\w*[A-Z]\w*[a-zA-Z]/\ \[\[&\]\] /g' ImportStage1.txt > ImportStage2.txt
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,
sed 's/upload\:\w*\.\w*/http\:\/\/aberwiki\.org\/uploads\/& /g' ImportStage2.txt > ImportStage3.txt
This fixes your upload links. Change the replace text so it fills in your url such as http://www.yourwiki.org/uploads/filename
You are now ready to import ImportStage3.txt into your database with a command such as
mysql -u<mysqluser> -p<yourpass> <db name> < ImportStage3.txt
Note: If your importUseModWiki.php 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.
[edit] データベースのプレフィックスを定義することは可能ですか?
1.3.x 以前のバージョンでは定義することはできません。
1.4以降のバージョンではインストール時にデータベースのプリフィックスを指定することができます。プリフィックスのあとに _ (アンダーバー)を加えると、単純にいろんな名前をつけるよりもわかりやすいものとなるでしょう。
[edit] なぜ Help: 名前空間は空っぽなんですか?
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.
[edit] $wgLanguageCode を他のものに変更しましたが、何もおこりません。どうなってるんでしょうか?
When we display a user interface text and $wgUseDatabaseMessages is enabled, we first check if a page for that interface message exists in the MediaWiki: namespace (table CUR, field cur_namespace=8); if so, we return it and abort. If $wgUseDatabaseMessages is false, or no page exists, we call the getMessage() function of the language object (the Language??.php file for the language in question).
In other words, we try the MediaWiki: namespace first, and the local file second. When you install MediaWiki, the MediaWiki: namespace is initially filled with the data from Language??.php, where ?? is the language set in $wgLanguageCode. If you change the language code afterwards, the MediaWiki: pages are not updated, and the old language is used instead.
Setting $wgUseDatabaseMessages=false should show you the language you want (after clearing your cache (browser or mysql?)), but you will no longer be able to use the MediaWiki namespace. If you want to do that, you should run the script rebuildMessages.php from the maintenance directory instead.
See MediaWiki i18n and MediaWiki namespace for more information.
[edit] インストール途中で、何もメッセージが出ないまま止まってしまいます。あるいは空白のページが表示されます!
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
[edit] wikiを自分のサイトのフレーム内に表示したいのに、つねにフレームからポップアウトしてしまいます。
MediaWiki contains protection against abusive use of frame sets. Unfortunately this will trap your intentional frames as well -- to remove this, edit stylesheets/wikibits.js and remove these lines:
(Please note that if the wikibits.js file isn't in stylesheets/wikibits.js it may be skins/common/wikibits.js)
// Un-trap us from framesets if( window.top != window ) window.top.location = window.location;
[edit] ユーザインターフェースのメッセージを変えるにはどうすればいいですか?
The user interface text is put into pages in the special 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 $wgSitename 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 "rebuildMessages.php" script in the maintenance directory (it must be run from the command line and you must set up an AdminSettings.php file). See MediaWiki localisation.
[edit] Sourceforgeにインストールしたwikiがうまく動作しないんですがなぜでしょう?
See Running MediaWiki on Sourceforge.net.
[edit] WindowsでサムネイルをつくるのにImagemagickをインストールするにはどうすればいいですか?
With the following installed on the server, it should work:
- xampp-win32-1.4.14-installer
- mediawiki-1.5beta3
- 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 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.
[edit] indexがlocalhostあるいは127.0.0.1にリダイレクトされるか単にタイムアウトになってしまいます
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')
[edit] 最近の更新のためのRSSフィードをアクティブにするにはどうすればいいですか?
I read about the RSS-Feed feature of MediaWiki but how can I activate it my own installation?
- Provided you've the required version, go to the recent changes page (Special:Recentchanges) and look for the toolbox (to the left, using the default MonoBook skin) - there should be options for RSS and Atom feeds of the page. Rob Church Talk 16:22, 22 December 2005 (UTC)
[edit] アップロードファイルと中国文字について
My mediawiki version is 1.4.4 on WinXP. If I upload a image whose name begins with one or more Chinese characters, there will occur an Upload Error: "File names must be at least three letters."
When the file name I upload begins with some letters and followed with some Chinese characters, I found all those characters became "??????"
How can I solve this problem? Thanks for your help in advance. Hy48 17:18, 6 December 2005 (UTC)
- Character set issues are a hideous mess of issues, and I'd guess this one is something regarding the old version of MediaWiki in use. Try setting up a small test wiki running MediaWiki 1.5.3, then see if the problem recurs. If it's fixed, upgrade your main wiki to 1.5.3 - be sure to make a backup and prepare to have to convert the character set over, as needed. Rob Church Talk 16:24, 22 December 2005 (UTC)
[edit] 利用方法
[edit] 新しいページを作るにはどうすればいいですか?
- 新しいページのリンク元にするページを開いてください。
- 「編集」をクリックしてください。あなたが作りたいページへのリンクを追加してください。
- リンクを作る方法は、新しいページのタイトルを次のようにブランケットで囲みます。[[新しいページのタイトル]]
- 「保存」してください。リンクが赤い文字で現れます。そこをクリックすると、新しいページを編集画面が現れます。
- 新しいページの内容を記入して「保存」して下さい。
- Updated by -Sx- :: Literally, under 1.5Beta1, you simply surf to (or try to browse to) a page you want to create - like thus:
- somewikisite/index.php?title=SITE:New_pages_created
- When this blank page is displayed, click edit, as described above, and add your content. The page will be orphaned initially; but you can link to it from other pages, etc...
- Updated by DHJ - there really needs to be a way to simply create a new page from wherever you are - endusers should not be expected to have to know how to create new pages by writing URLs!
- Updated by WNE - If nothing else, a search should say "Create a new page for <the term that wasn't found.>" and, though this is discouraged, there is a way of doing this.
[edit] 目次(TOC)を付け加えるにはどうすればよいですか?
目次は4つ以上の表題がある場合に、自動的に表示されます。もしそれより少ない数の表題の場合に目次を表示させる場合、ページのどこかに__FORCETOC__ と書いてください。ページの冒頭に目次が表示されます。目次を表示させたい場所がある場合は、その場所に__TOC__と書いてください。
また目次を表示させたくない場合は、ページのどこかに、 __NOTOC__と書いて下さい。 See Help:Section for more information.
[edit] MediaWikiの動作が遅いのですが、どうすれば速くなりますか?
- まずeAcceleratorのようなPHPキャッシュエンジンを試すべきです。それらはパースされたPHPスクリプトを保存し、パフォーマンスを大いに向上させます(これはトラフィックが少なくない場合どのようなPHPをインストールした場合にも利用すべき類のものです)。TurckMMCacheを利用することができます。しかし、これは古くメンテナンスされていないアプリケーションです。eAcceleratorはTurckMMCacheの延長線上のものです。また、Squidとmemcached、そしてconfiguration settingsのCacheセクションもまた確認してください。
- より軽いskin、例えば 'monobook'の代わりに'standard'に、変更する。
- configuration settingのReductionセクションを参考のこと。
- $wgUseDatabaseMessages設定を参照のこと。
- 処理能力の低いコンピュータでシングルユーザwikiを実行するにはMySQLのテーブルをMyISAMに切り替えれば速くなるでしょう。MySQL Storage Comparisonも参照のこと。
[edit] 自分のMediaWikiサイトを丸ごとプリントすることは可能ですか?
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:
= Big Headings =
{{:Page title1}}
{{:Page title2}}
and so on...
This will automatically generate an index for your document as well!
[edit] 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
[edit] 自分がインストールしたmediawikiの中でcommons.wikimedia.orgを使うことはできますか?
At present the shared image repository must be present on the server's filesystem, so unless your site is on the Wikimedia main cluster the answer is no.
[edit] botを実行するにはどうすればいいですか?
You might want to use the python wikipediabot.
[edit] キャッシュされたページをクリアするにはどうすればいいですか?
- You can use ?action=purge on individual pages to update their cache dates. Note that this may take a few minutes.
- There is a global $wgCacheEpoch variable which can be set in LocalSettings.php to invalidate all prior cache entries (see DefaultSettings.php)
- A shell script such as this may be used
#! /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
[edit] /wiki/subdir/PageName のようにページをサブディレクトリの構造に保存するにはどうすればいいですか?
See Help:Link#Subpage_feature.
[edit] 1.5.3のインストールを終えました, そこで自分のページの翻訳を提供したいとします。 <Other languages:> を機能させるには、最初からどういう手順をたどればいいんでしょう?
(someone please provide a newbie tutorial)
[edit] 設定
[edit] 自分のシステム上のwikiページに http://localhost/directorypathと入力してアクセスします。ところが, http://systemname/directorypathと入力すると, ページが見つからない、というエラーが帰ってきます
Maybe there is something wrong with your Apache virtual hosts? See the Apache documentation for details.
[edit] 自分自身のサイトのMediaWikiのlook and feelを変更するにはどうすればよいですか?
詳細は MediaWiki look and feel を参照してください。
[edit] アップグレード後、私のskinが消えてしまいました!
ブラウザキャッシュをクリアし、ページをリロードしなさい。
[edit]
Under 1.5Beta1, set $wgDefaultSkin = 'disabled'; in your LocalSettings.php (contributed by -Sx-)...
Under 1.5, to disable all view top tabs, create a new skin according to these instructions 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:
<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">
Replace it with this:
<div id="column-one">
<div class="portlet" id="p-personal">
To remove the "Edit" links in the content sections, modify monobooknoviews/main.css.
Replace this line:
* html div.editsection { font-size: smaller; }
With this line:
* html div.editsection { display: none !important; }
[edit] ログインされていないユーザのためのデフォルトのskinを変更するにはどうすればいいですか?
LocalSettings.phpの中の$wgDefaultSkin = 'monobook';を設定します(例を参照のこと)。実際のskin名の大文字小文字がどうであれ、LocalSettings.phpファイルでは、skinを小文字 で参照するように注意しなさい(例: 'MonoBook'ではなく'monobook') 。
[edit] LocalSettings.phpの中の設定、たとえば$wgSitename等、を変更しましたがブラウザに反映されません。なぜですか?
(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 maintenance/rebuildMessages.php script. If you upgrade to the latest version of MediaWiki first, these will include dynamic references to the variables (e.g. {{SITENAME}}) and should therefore reflect future configuration changes.
[edit] MediaWikiは$wgSitenameの最初の文字を自動的に大文字に変更するのですか?
It does appear to do so.
[edit] 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:sitetitle. Go there and edit it just like you would any other page in your Wiki.
What I found in my Wiki is that even after you change things in your languageXX.php file, it's "too late", because Special:Allmessages was already constructed using what it found there. So you need to change all the instances of Wikipedia, manually. (I could be wrong, and if I do, someone please correct me)
Edit MediaWiki:Pagetitle.
I do not understand these directions. How do you edit this?
I don't understand them either, could you please explain why even if my pagetitle is correct at the top of each browser page the name displayed is always Pagename- Wikipedia? (the field you told to edit is correctly displaying UniWiki as sitename... puzzled)
I've been having the same problems; I use hebrew in my site, but my SITENAME is Navi Commission. When I edit MediaWiki:Pagetitle I see {{SITENAME}} - 1$ , but at the top of my browser is still "Wikipedia" written in Hebrew. How do I change that?
Under 1.5Beta3, simply click the "move" tab link and rename your page as you move it. (contributed by -Sx-)
Editing MediaWiki:Wikititlesuffix did the trick for me. (version 1.4.9)
[edit] アップロードを有効にするにはどうすればいいですか?
If you get the following message:
Sorry, uploading is disabled.
See Documentation:Administration#Toggle_uploads_on/off. For more information and trouble shooting, see Uploading files.
[edit] Mediawiki 1.5にファイルをアップロードしようとすると必ず"The file is corrupt or has an incorrect extension. Please check the file and upload again."というエラーがでます
You should be able to solve this by adding
$wgVerifyMimeType = false;
to your LocalSettings.php file
It's a longshot, but adding
$wgMimeDetectorCommand= "file -bi"; #use external mime detector (linux)
to your LocalSettings.php file solves this problem in some cases.
This works great on MacOS X (10.4.3) as well! This is great for a trusted site that won't be getting malware uploaded, but for truly public uploading, you should probably not subvert the filename extension and MIME type checks. --Bytesmiths 20:59, 19 December 2005 (UTC)
With 1.5, check whether the mediawiki temp dir exists and has the right permissions. In general, check your php-logs for any obvious errors.
After, try in the maintenance directory to rebuildImages and then, display the pages with a trailing ?action=purge.
[edit] templatesを使うにはどうすればいいですか?
See Help:Templates.
[edit] 自分のMediaWikiのタイムゾーンを設定するにはどうすればいいですか?
In LocalSettings.php add:
$wgLocalTZoffset = "-1";
etc.
See provisionally also:
- Brion Vibber's message about this at http://mail.wikipedia.org/pipermail/mediawiki-l/2004-April/000357.html
- bug/enhancement 505 Specify timezones by location, to allow automatic adjustments of timeoffset and daylight saving time (DST)
[edit] ベースURLsを短くするにはどうすればいいですか?
See eliminating index.php from the url for details. You may need access to server files like httpd.conf.
[edit] いくつかのキーワードで検索結果が1件も返ってきません!
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
[edit] 例えば"<input>" や "<form>" のようなHTMLタグを有効にするにはどうすればいいですか?
It seems to be possible to activate HTML-Tags like "<input>" or "<form>" (Have a look at [1], 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 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.
- Even this seems to still have some filters. I want to include multimedia (on a trusted-editors-only site) via the <EMBED> tag, but it shows up as literal HTML, even with $wgRawHtml = true; --Bytesmiths 21:12, 19 December 2005 (UTC)
[edit] $wgRawHtml = true;をsysopユーザに対してのみ有効にするにはどうすればいいですか?
[edit] adminのみが、記事にフルHTMLコードを追加できるようにするには?
- Answer:
How could the database determine, who have added the tags (to make it work)? Look in diffs? But these tags can be changed after by another user, what can change its meaning. So there are several "half-ways":
- if last change of page was made by sysop, then HTML tags are enabled, otherwise not (if anyone make any change after, this will be disabled)
- if sysop added HTML tags, the page is automaticly blocked for editing by other users
I don't know, how to do that in mediawiki, it is only theory. But both ways would require some hacks in php scripts.
A quick and really dirty way is to just copy the following line to includes\Setup.php line 211
if ($wgUser->isAllowed('protect')) $wgRawHtml=true;
This will check whether the current user can change page properties (normally only a sysop can do that) and will set the $wgRawHtml variable accordingly. Of course (if you know what you're doing) you can replace protect by a special HTML permission you define yourself -- Ms
A better approach would be to add a knob to Mediawiki that would allow raw HTML only in protected pages, which only admins can edit. You'd want to check whether the page is protected when determining whether to filter on the final output, rather than checking whether the user may protect pages. No checking should be necessary when submitting pages. Any Mediawiki developers wanna do this? It'd be really nice for sites that use Mediawiki in more of a CMS context than a wiki context.
[edit] 外部へのリンクがブラウザの新しいウインドウにポップアップするようにするにはどうすればいいですか?
http://meta.wikimedia.org/wiki/Opening_external_links_in_a_new_window
> Please do not do this.
This is not the place to pass judgement. Sometimes these features are useful.
And, how, when adding a new link manually, do I make it open in a new browser window? Yes, this is something I'd like to do.
[edit] イメージページに画像を表示するにはどうすればいいですか?
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
[edit] より複雑なカスタマイズ
[edit] 自分でインストールしたwikiにsandboxを付け加えるにはどうすればいいですか?
Just add a page named 'Sandbox' and refer to it from within another page using the link [[Sandbox]].
[edit] ロゴを変えるにはどうすればいいですか?
In your LocalSettings.php add:
$wgLogo = '/path/to/your/logo.png';
Default is {$wgUploadPath}/wiki.png. Default for version 1.5 is $wgStylePath/common/images/wiki.png
Default logo size is 135px by 135px
See also Customization#How_do_I_customize_the_logo_in_the_top_left_corner.3F.
[edit] 検索がヒットしなかった時にページ作成へのリンクを表示するにはどうすればいいですか?
This is not a recommended practice as it promotes the creation of orphan pages not reachable through link crawling.
If you insist on doing so, edit your MediaWiki:Nogomatch message to add such a link, such as at the English Wikipedia version.
NOTE: it should use wiki syntax and not HTML and only applies to 1.5 and above.
[edit] ブラウザのアドレス欄のアイコンを変更するにはどうすればいいですか?
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.)
If you want to use some other icon specifically for those browsers supporting it, you can change a bit in /includes/Skin.php. Change the line from 'href' => '/favicon.ico' to 'href' => '/path/to/your/favicon.ico'.
[edit] どうにかすればローカルのイントラネット用 [file://localhost/C: C-Drive]の様な『ファイル』URI-qualifierを利用することはできますか?
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 );
$text = $this->subReplaceExternalLinks( $text, 'file', false );
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
$wgUrlProtocols = 'file:\/\/|http:\/\/|https:\/\/|ftp:\/\/|irc:\/\/|gopher:\/\/|news:|mailto:';
- Doesn't seem to work 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 [2].
- List of browsers supporting or not supporting the file:/// link from pages delivered from a remote server, which is common to wiki pages:
| 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.04 (Windows) | no / yes (1) |
| Konqueror (Linux) | yes (3) |
Was listed as bugzilla:614 (RESOLVED WONTFIX).
(1) Enable user_pref("security.checkloaduri", false);, 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))
- A note: According to the Instiki FAQ loading of local file links from http links can be enabled on Mozilla and Firefox by putting user_pref("security.checkloaduri", false); into the file usr.js.
- It should also be possible to set this with the "about:config" interface (just type about:config in the address bar, typing security.ch 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. --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. --134.148.20.33 08:43, 10 May 2005 (UTC)
-
--194.95.179.181 13:32, 22 September 2005 (UTC) :
- in addition to version 1.5:
- may help using links with this format:
[[file:///%5C%5NAME-OF-COMP-OR-IP-ADR%5SUBDIR%5C20M%F6LLER%5Cfilename.html filename.html]]
- instead of
[[file:///\\NAME-OF-COMP-OR-IP-ADR\SUBDIR\20 MöLLER\filename.html filename]]
- replace Backslash with %5c, space with %20, ö with %F6 etc.
- 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 file:\\\\ to the define( 'HTTP_PROTOCOLS', line in parser.php and the $wgUrlProtocols variable in DefaultSettings.php, instead of file:\/\/. I am not sure if I could get away with changing just one file. This is for MediaWiki running on Windows with Apache. -Sprintstar 12:40, 1 November 2005 (UTC)
[edit] MediaWikiに私自身の動的コンテンツを追加するにはどうすればいいですか?
Write an extension that implements a special page. See Writing a new special page.
[edit] "Search"ボックスの下に自作のPHPファンクションの一つを挿入するにはどうすればいいですか?
[edit] 私のデータベースを完全にロックするにはどうすればいいですか?
LocalSettings.php内の$wgReadOnlyFileにファイル名を指定し、そのファイル内にロックする理由を書きます。wikiを編集しようとする人にファイルの内容が表示されます。
readonlyfileは完全なロックを保障するものでないことに注意してください。もしMediaWikiが絶対にデータを書き込まないことを求めるなら、database側で制御する必要があります。(例えばwikiユーザからUPDATE,INSERT,DELETE権限を削除(revoke)するかMySQLをread-onlyモードに変更するなど)。
[edit] categoryページのトップにアルファベット別一覧を追加するにはどうすればいいですか?
First, you'll need to edit /wiki/includes/CategoryPage.php and find the instance method shortList of class CategoryPage. The first line of the function looks like :
$r = "<h3>{$articles_start_char[0]}</h3>\n";
Replace it, adding an id attribute. The method becomes :
function shortList( $articles, $articles_start_char )
{
// !PATCH-ALPHA-CATEGORIES : CategoryPage::shortList
$r = "<h3
id=\"{$articles_start_char[0]}\"
>".$articles_start_char[0]."</h3>\n";
A more professional design could produce :
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 = "<h3 $szId >".$articles_start_char[0]."</h3>\n";
A few lines after, replace, in the same way, the following line:
$r .= "</ul><h3>{$articles_start_char[$index]}</h3>\n<ul>";
With :
// !PATCH-ALPHA-CATEGORIES : CategoryPage::shortList
$r .= "</ul><h3
id=\"{$articles_start_char[$index]}\"
>{$articles_start_char[$index]}</h3>\n<ul>";
Or, in a more professional design :
// !PATCH-ALPHA-CATEGORIES : CategoryPage::shortList
$szId = ($wgAlphaCategoriesPrefix === false) ? ''
: ($wgAlphaCategoriesPrefix." id=\"{$articles_start_char[$index]}\" ") ;
$r .= "</ul><h3 $szId >{$articles_start_char[$index]}</h3>\n<ul>";
Then, edit a Category page. Insert a line that looks like
{{A-Z-title|Ma belle liste alphabétique}}
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 :
=={{{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>
After reloading the Category page, your page will include something like :
Ma belle liste alphabétique
Later on, each time you want to add an alphabetic index to a Category page, simply reuse your A-Z-title :
{{A-Z-title|Ma très belle liste alphabétique}}
Four related templates are available in this discussion page.
{{A-Z}}
{{A-Z-title|Ma belle liste}}
{{A-Z-prefix|cp_}}
{{A-Z-title-prefix|Ma belle liste|cp_}}
In a professionnal design, you should add in the /wiki/includes/DefaultSettings.php something like :
// !PATCH-ALPHA-CATEGORIES : // !SEE-ALSO CategoryPage::shortList in CategoryPage.php /* * $wgAlphaCategoriesPrefix = false ; // disable feature * $wgAlphaCategoriesPrefix = '' ; // default * $wgAlphaCategoriesPrefix = 'myprefix_' ; // customized prefix */ $wgAlphaCategoriesPrefix = '' ;
In this case, you may eventually add, in your /wiki/LocalSettings.php something like
$wgAlphaCategoriesPrefix = 'cp_' ;
In this case, you'll use one of these templates :
{{A-Z-prefix|cp_}}
{{A-Z-title-prefix|Ma belle liste|cp_}}
[edit] "Featured article of the week"等に{{CURRENTWEEK}} 変数を追加するにはどうすればいいですか?
NOTE: this is not needed in 1.4
Variables such as {{CURRENTMONTH}} and {{CURRENTDAY}} are called Magic Words, and you will want to add a new one to your system. For MediaWiki 1.4beta3, you'll need to edit three files, adding just a small bit of text. Be Bold. At the same time, don't work on your live version, but on a working back up.
In /wiki/includes/MagicWords.php near the top of the file you'll find a list of define statements, like this:
define('MAG_REDIRECT', 0);
Notice that the number in the parenthesis is incrementing. Go to the bottom of this list and add a new definition, with XX being the next number for your set up:
define('MAG_CURRENTWEEK', XX);
Just below definition list you'll find an array which probably looks rather like
$wgVariableIDs = array( MAG_CURRENTMONTH, MAG_CURRENTMONTHNAME, MAG_CURRENTDAY, MAG_CURRENTDAYNAME, MAG_CURRENTYEAR, MAG_CURRENTTIME, MAG_NUMBEROFARTICLES, MAG_CURRENTMONTHNAMEGEN, MAG_SITENAME, MAG_SERVER, MAG_PAGENAME, MAG_PAGENAMEE, MAG_NAMESPACE );
Add a comma after the last MAG_word, a line return, and the new magic word:
MAG_CURRENTWEEK
Save and close /wiki/includes/MagicWords.php.
Now you will need to edit /wiki/includes/Parser.php. You will need to find the getVariableValue function. In this function you want to add a new case to the select list. Choose a position in the select and insert:
case MAG_CURRENTWEEK:
return $varCache[$index] = $wgContLang->formatNum( date('W') );
A short explanation of what this does is in order. This will put the week of the year into the variable. This value will be from 1 to 54. Yes, there are only 52 weeks, plus one or two days, in a year. However, according to the ISO 8601 standard for week numbering, yearly weeks begin on Monday, so if the first day of the year is Sunday, that will be week number 1, and the next day will be week 2, and you will have 53 weeks by the end, and if it just happens to be a Leap Year the year will end on a Monday - making week 54.
Side notes:
- An ISO week effectively always starts on Monday.
- However the comment above is wrong about ISO week numbering. In the ISO week numbering system, the first week of the ISO year must contain at least 4 days in the civil year. So whenever a civil year starts on Sunday January 1st, this is the last day of the last week of the previous ISO year. And if a civil year ends on Monday December 31, this is the first day of the first week of the next ISO year.
- A ISO year contains only complete ISO weeks (from Monday to Sunday): the first ISO week of a ISO year starts on Monday, between December 29 of the previous civil year and January 4 of the current civil year. The last ISO week of the ISO year terminates on Sunday, between December 28 in the current civil year and January 3 of the next civil year.
- A ISO year can then count a total of either 364 or 371 days (both cases can then occur in leap or non-leap years). So in the ISO week numbering system, weeks can then effectively be numbered from 1 to 53 only (there's no week 54 in ISO years).
- This all means that January 1st is part of ISO week number 1 only if it falls on a Monday, Tuesday, Wednesday or Thursday, otherwise January 1st is counted as part of the last week of the previous civil and ISO year. December 31 is part of the last week of the current year only if it falls on Thursday, Friday, Saturday or Sunday, otherwise December 31 will be counted as part of the next civil and ISO year.
- To define a week precisely within the same civil year, it is then necessary to specify the ISO year number which may differ (between December 28 and January 3) from the civil year by 1. Then, any date can be fully specified by this ISO year, the ISO week number (from 1 to 52 or 53, depending on year), and the day of week (from Monday to Sunday).
- Alternatively, any date can be fully specified by the ISO year and the ISO day of year (between 1 and 364 or 371, depending on the year), where the ISO day of year 1 is always a Monday (the conversion from a ISO day of year to the ISO week number and day of week is independant of the year; the same is true for the reverse conversion).
Save and close /wiki/includes/Parser.php.
The final file you will need to edit is /wiki/languages/Language.php. Note the different directory. You will need to locate the $wgMagicWordsEn array, and insert a new line:
MAG_CURRENTWEEK => array( 1, 'CURRENTWEEK' ),
If you are adding the new line to the end of the list, remember to make sure there is a comma at the end of the line above your new line, and that there is not a comma at the end of your new line.
Save and close /wiki/languages/Language.php.
Be sure to test your changes before adding them to the live version.
[edit]
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.
[edit] ファイルの変更(php-installation-files)
[edit] 全体的な注
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 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 http://, etc), the result will be an external link equivalent to
[<target> <text>] - 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
[[<target>|<text>]]
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 MediaWiki:<whatever> pages. (Note: This way you can only edit preconfigured variables. You are not totally enabled to edit the navigation-bar)
[edit] version1.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 [[MediaWiki:Sidebar]] page. You have to be logged into the Wiki with an adminstrator account change these pages.
The default should be:
* navigation ** mainpage|mainpage ** portal-url|portal ** currentevents-url|currentevents ** recentchanges-url|recentchanges ** randompage-url|randompage ** helppage|help ** sitesupport-url|sitesupport
[edit] version 1.4 の場合
[edit]
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 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.
[edit]
The list of pages is defined in an array called $wgNavigationLinks; copy the entire array from includes/DefaultSettings.php to /LocalSettings.php 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' ), array( 'text'=>'sitesupport', 'href'=>'sitesupport-url' ), );
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
$wgNavigationLinksarray; 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
array( 'text'=>'something', 'href'=>'something-url' ),; "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 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.
- add a line of the form
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.
[edit] version 1.3 以前の場合
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 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 http:// 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.
[edit]
Sometimes even the navigation-bars should be available for editing by a normal user, who has no access to the 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.
[edit] MonoBook (MediaWiki 1.44)
You have to modify the file skin/MonoBook.php This advice works only with the Skin MonoBook
- Insert a new page into the namespace MediaWiki. E.g. MediaWiki:MenuNavigation
- Fill this article/wikipage with content (MediaWiki-Markup-Style) like:
* [[an internal link]] * [[another internal link]] * [http://www.Link.de a external http-link]
- open the file skins/Monobook.php
- look for:
<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>
- replace the lines:
<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>
with:
<?php $this->msgWiki( 'MenuNavigation' ) ?>
- The result should look like this:
<h5><?php $this->msg('navigation') ?></h5>
<div class="pBody">
<?php $this->msgWiki( 'MenuNavigation' ) ?>
</div>
- You can add further navigations-blocks the same way.
HeinzJo 20:39, 12 Jun 2005 (UTC)
[edit] 小規模の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/maintenance \ /opt/mediawiki/skins /opt/mediawiki/redirect.php . cp -a /opt/mediawiki/config/ . chown www-data: config/ cp /opt/mediawiki/index.php index.php
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:
ini_set( "include_path", "/opt/mediawiki:." ); # line added require_once( 'includes/Defines.php' ); # this line used to include './includes/Defines.php'
- make sure your webserver can read from /opt/mediawiki
You may also want to visit this link for further information about standarising the log in for users across multiple wikis.
You can also look at the (rather complex) setup wikimedia is using
[edit] w:Metatagを付け加えるにはどうすればいいですか?
The page includes\OutputPage.php defines within the function addMetaTags () the output of metatags. This function can be used to define further metatags.
The existing command $wgOut->addMeta ( 'KEYWORDS' , $a.) ; can be added by further keywords just by adding a dot and a comma sperated list. The change would look something like
$wgOut->addMeta ( 'KEYWORDS' , $a.', your Keywords, Comma seperated') ;
Additional Metatags can be added too.
Just add further lines as last lines of the function addMetaTags() like:
$wgOut->addMeta ( 'LANGUAGE' , 'de') ;
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?
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?
Pekadad 15:55, 30 November 2005 (UTC)
[edit] さらに調査を続けられるよう検索結果にsearch-enginesを追加するにはどうすればいいですか?
- Create a new page within the MediaWiki:Namespace, e.G.
MediaWiki:SearchInSearchEngines.
- Fill that page with content e.g.:
* [http://groups.google.de/groups?q=$1&hl=de alle '''Google Newsgroups''' nach "$1" durchsuchen]
Important is the variable $1. It is the content of searched words.
- Open the PHP-file "
SpecialSearch.php"within the subdirectory "includes" of the MediaWiki-installationsdirectory.
- Find the function "
function goResult( $term )"
- Insert at the end before the last line:
$wgOut->addWikiText( '<p>' . wfMsg('SearchInSearchEngines', $term ) . "</p>\n" );
- Do the same with function: "
function showResults( $term )"
- Enhancements: Handling empty spaces.
[edit] popular pageのカウンタをリセットするにはどうすればいいですか?
In <= 1.4: UPDATE cur SET cur_counter=0;
In >= 1.5: UPDATE page SET page_counter=0;
[edit] カスタムのnamespaceを作成するにはどうすればいいですか?
[edit] ページを見ているユーザの一覧を見るにはどうすればいいですか?
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: EnotifWiki indicates the number of watching users in Recent Changes views.
[edit] すべての'sister' projectsを検索するようにsearch-engineを変更するにはどうすればいいですか?
[edit] ユーザ管理
[edit] ユーザアカウントの基本的な管理方法は?
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?
[edit] ユーザのパスワードを変更するにはどうすればいいですか?
Assuming that $wgPasswordSalt 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".
[edit] ユーザがパスワードを忘れてしまいました。しかもe-mailアドレスを持っていません
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.
[edit] ログインしたユーザにのみ編集を許可するにはどうすればいいですか?
- ユーザ権限に関する質問は Setting user rights in MediaWiki を参照のこと。
- まずMediaWikiのバージョンを確認し、それぞれのバージョンに応じたページを参照のこと。
- MediaWiki version 1.5.1 以降の場合
LocalSettings.phpに次の2つの設定項目を付け加える。- 2つとも付け加えるか、片方だけ付け加えるかは運用方法次第で選択すればよい。
- 匿名でのアカウント作成を禁止する。
// Only SysOp (Admin) can create accounts - $wgGroupPermissions['*']['createaccount'] = false;
-
- 匿名でのページ更新を禁止する。
// No anonymous editing allowed - $wgGroupPermissions['*']['edit'] = false;
- MediaWiki version 1.5.1 より以前の場合
-
LocalSettings.phpに次の設定項目を付け加える。
$wgWhitelistEdit = true;
- テストの方法
-
- 匿名での編集の禁止が有効になっているかどうかをテストするためには完全にログアウトしていることを確認してからテストすること。クッキーが有効な場合などにはログイン状態が続いている可能性がある。その場合は、右上の"Log Out"を押すこと。
[edit] 登録の際に必ずemailアドレスが明記されるようにするにはどうすればいいですか?
[edit] 許可されたユーザだけがページを閲覧できるようにするにはどうすればいいですか?
There are two hacks (patches) for this. See Page access restriction with MediaWiki and Hidden pages. Alternatively using native wiki Preventing Access.
[edit] How do I reassign edits from one user to another?
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.
[edit] あるユーザを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.
[edit] あるユーザからSysop-Rightsを取り上げるにはどうすればいいですか?
see Setting_user_rights_in_MediaWiki
[edit] ユーザの権限とグループを管理するにはどうすればいいですか?
see Setting_user_rights_in_MediaWiki (version 1.4 and older) or Help:User rights (version 1.5 and newer).
[edit] 編集をどのユーザにも許可したとしても、モデレータに承認されたページのみをwikiに反映するにはどうすればいいでしょう?
Add the appropriate functionality to the code. ;p There is no way of doing this with the current software, although if written well it could prove a useful alternative for page protection.
[edit] ログインページに質問を追加し、正解した人のみが新しいアカウントを作成できるようにするにはどうすればいいですか?
Add the functionality to the code, as shown above. There is no other way with the current software.
See FxParlant CAPTCHA to learn how to add a CAPTCHA capability, requiring that users correctly interpret a visual image.
[edit] 私のユーザリストからあるユーザを削除するにはどうすればいいですか?
MediaWikiにはユーザアカウントを削除する機能はサポートしていません。あるアカウントの使用を制限するには、パスワードをスクランブルするか、アカウントに対しindefinite blockをset upしなさい。
mySQLデータベースのuserテーブルからユーザを削除してはいけません。削除した場合、データベースのリレーショナル構造のせいでwikiの別の場所で問題を引き起こします。
[edit] それでは、ユーザ名を変更することは可能ですか?
厳密に言うと、ユーザを削除することが必要なわけではありません。しかし、何かニュートラルなものに変更できれば助かります。ユーザ名を別の何かに変更することはできますか?
MediaWiki 1.5では、Renameuser extensionがインストールされていれば、管理者(bureaucrats)はユーザ名を直接wikiで変更できます。それより前のバージョンでは、データベースを直接いじくることが必要です:
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';
[edit] デフォルトの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.
[edit] How do I assign a username to an IP address?
(Question asked by 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? above.
[edit] edit historyのIP addressをuserIDに変更するにはどうすればいいですか?
(Question asked by Blueeyor on 20:06, 25 Apr 2005 (UTC))
See How do I reassign edits from one user to another? above.
[edit] WikiSysopあるいはBureaucratあるいは特定のユーザのみが閲覧可能なページを作成するにはどうすればいいですか?
(Question asked by Wiseleyb 26 Apr 2005)
There are three hacks (patches) for this. See Page access restriction with MediaWiki, Hidden pages and Regular expressions for wgWhitelistRead.
[edit] anonymous wiki accessが許可されていない場合、どうやって新しいユーザアカウントを作成すればいいですか?
sysopとしてログインし、ユーザアカウントを追加するためにspecial page: Special:Userlogin を利用します。
[edit] User:<username> ページが <username> と Sysopのみによって編集可能なように制限するにはどうすればいいですか?
[edit] 複数の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. --Bytesmiths 21:24, 19 December 2005 (UTC)
[edit] エラーメッセージを編集するにはどうすればいいですか?
[edit] MediaWikiの開発を手伝いたいと思います。どこから始めればいいですか?
see:How_to_become_a_MediaWiki_hacker ?
[edit] SearchIndex Tableを回復するにはどうすればいいですか?
When I try to repair it with phpmyadmin utilities it seems to be in use and nothing can be do with it.
Thanks for your attention and help
................
The SearchIndex table appears to break occassionally when any page in the wiki is edited and saved. Using the repair option in PhpMyAdmin seems to fix the table.
[edit] 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?
Say for example I want to display the Wikipedia 'Sister' projects on my main page, just like is done on Wikipedia, how can I do this...
