Manual:Interwiki/ru
From MediaWiki.org
Интервики-ссылки (Interwiki links) — это ссылки, оформленные как внутренние ссылки с использованием специального префикса, но ведущие на страницы других проектов.
Интервики-ссылки позволяют сделать ссылку на страницы других вики-проектов, например Википедии, Викиучебника, Викиновостей и т.д., или, к примеру, на разделы вашего вики-проекта на разных языках (см. Manual:Wiki family).
Ссылка вида [[Wikipedia:Main Page]] выглядит следующим образом: Wikipedia:Main Page и перенаправляет на заглавную страницу (Main Page) Википедии.
Contents |
[edit] Интервики-ссылки на другие проекты
[edit] Стандартные
Для некоторых проектов Викимедиа (и ряда других) интервики-ссылки настроены по умолчанию, поэтому вы можете использовать их без редактирования своих данных. Обратите внимание, что Википедия была добавлена в качестве одного из таких умолчаний сравнительно недавно, начиная с версии 1.10.
Ниже приведены некоторые примеры интервики-префиксов, устанавливаемые по-умолчанию.
| префикс | адрес | пример использования |
| commons | http://commons.wikimedia.org/wiki/ | [[commons:MediaWiki]] |
| mediazilla | http://bugzilla.wikipedia.org/ | [[mediazilla:1209]] |
| meta | http://meta.wikimedia.org/wiki/ | [[meta:Main Page]] |
| mw | http://www.mediawiki.org/wiki/ | [[mw:Help:Contents]] |
| wikibooks | http://en.wikibooks.org/wiki/ | [[wikibooks:Main Page]] |
| wikimedia | http://wikimediafoundation.org/wiki/ | [[wikimedia:Main Page]] |
| wikinews | http://en.wikinews.org/wiki/ | [[wikinews:Main Page]] |
| wikiquote | http://en.wikiquote.org/wiki/ | [[wikiquote:Main Page]] |
| wikisource | http://sources.wikipedia.org/wiki/ | [[wikisource:Main Page]] |
| wikispecies | http://species.wikipedia.org/wiki/ | [[wikispecies:Main Page]] |
| wiktionary | http://en.wiktionary.org/wiki/ | [[wiktionary:Main Page]] |
| wikipedia | http://en.wikipedia.org/wiki/ | [[wikipedia:Main Page]] |
[[metawikipedia:Main Page]] в этом случае.[edit] Добавление нового веб-сайта в таблицу интервики-ссылок
Для настройки интервики-ссылок вам придётся редактировать базу данных. Если вам не нравится этот способ, вы можете установить одно из расширений для управления списком интервики-ссылок.
(А опытные пользователи PostgreSQL используют для этого же команду
INSERT INTO interwiki (iw_prefix, iw_url, iw_local, iw_trans) VALUES ('w', 'http://en.wikipedia.org/wiki/$1', 1, 0);)- Экспортируйте таблицу базы данных 'interwiki', затем добавьте в конец таблицы следующий пример для kayakwiki…
- ('kayakwiki', 'http://en.kayakwiki.org/index.php/$1', 1, 0);
-
Замечание: как показано в приведённом выше коде, разделитель ';' ДОЛЖЕН быть в конце таблицы. В конце любой другой строки этой таблицы разделителем должен быть ТОЛЬКО символ ','.
-
- Импортируйте таблицу 'interwiki'
- Протестируйте результат: Перейдите на ваш сайт и создайте страницу, в которой будет следующее содержание…
- [[kayakwiki:Places|]] должна отобразиться как ссылка на страницу 'Places' на сайте KayakWiki.org (URL — http://en.kayakwiki.org/index.php/Places)
Поскольку в версии 1.9 и более ранних список интервик, поставляемый по умолчанию, не включает Википедию, вы можете добавить её самостоятельно (а также другие проекты, какие потребуется).
В таблице базы данных interwiki имеются следующие поля:
This page is in progress of translating to Russian. You can help translating it or go to another language version that follows:
Эта страница в процессе перевода на русский язык. Вы можете помочь в переводе или перейти на другие языковые версии, указанные ниже:
iw_prefix: choose a prefix, which is used for interwiki linking, e.g. "wikipedia" for linking to Wikipedia.-
Замечание: Prefixes must be all lower-case.
-
iw_url: enter the project's URL, e.g.http://en.wikipedia.org/wiki/$1for Wikipedia. Don't forget the$1as it is replaced with the article's name you are linking to ([[Wikipedia:Main Page]]links tohttp://en.wikipedia.org/wiki/Main_Page).
-
Замечание: If iw_url is a binary BLOB field (SVN version, but also occurs in version 1.11.0, bug?) this won't work directly. You have to enter it as binary. There are two possible solutions: 1. You save the url in a plain text file, then import it through phpmyadmin. 2. You can directly enter an SQL query.
-
iw_local: if 1, your wiki will redirect even external links of the form iw_prefix:title, not only those from its own pages. you need this if you want to use the redirect functionality from outside your wiki or other wikis use your transwiki functions for nested transwiki links (like http://en.wikipedia.org/wiki/fr:Accueil)iw_trans: "transwiki transclusion" - set to 1 if you want to use pages from the other wiki as templates. You will also need to set $wgEnableScaryTranscluding = true in your LocalSettings.php
[edit] Интервики ссылки на другие языки
If you have installed a Wiki family, you can link from an article in English to an article in German (if you have a German project, too). You can set up MediaWiki, to show those links in the sidebar, just below the toolbox.
In your filesystem, there is a subfolder of your MediaWiki installation, called "languages". Go there and have a look at "Names.php" as it contains a list of known languages and their prefixes. E.g. you want to add your German project, search "Names.php" for "Deutsch" and note the prefix "de".
If you know the "right" prefix, edit your database by adding a new line to table interwiki:
iw_prefix: language-prefix (e.g. "de" for German), which is listed in "Names.php"iw_url: URL to your wiki-project (e.g.http://de.your-wiki.org/index.php/$1)iw_local: same as above "Adding More"iw_trans: same as above "Adding More"
Now, you can link an article to the same in other languages. Adding [[de:Hauptseite]] on your english Main_Page will create a link "Deutsch" below the toolbox, which leads to the Main_Page of the German wiki (Hauptseite).
Note, that this link is shown in Sidebar's section, only, and not inside of the article. If you want to create a link inside of the text, you have to add a colon previous to the prefix: [[:de:Hauptseite]].
[edit] Ссылки
| Мета-Вики: Help:Interwiki linking |
