Extension:AddPersonalUrls/ru

From MediaWiki.org
Jump to navigation Jump to search
Другие языки: English  • русский
Справка по расширениям MediaWiki
Crystal Clear action run.svg
AddPersonalUrls
Статус релиза: стабильный
AddPersonalUrls-screenshot.png
Реализация MyWiki, Skin
Описание Добавляет страницы в личные ссылки.
Автор(ы) (RV1971talk)
Последняя версия 0.4 (2013-08-02)
MediaWiki >=1.20
PHP 5.3
Лицензия GPL v3
Загрузка Sourceforge
#Лог изменений
Параметры
  • $wgAddPersonalUrlsTable
Использованные hook'и
BeforePageDisplay
EditFormPreloadText
PersonalUrls
Переведите расширение AddPersonalUrls если оно доступно на translatewiki.net
Проверьте использование и версию.

Этот плагин добавляет страницы в список личных ссылок. Можно представить что это демонстрация использования крюка PersonalUrls. Скорее всего придётся изменить список страниц для собственных нужд.

Данная версия добавляет следующие ссылки:

  • Ссылку на служебную страницу основанную на Extension:DynamicPageList, показывающую все подстраницы основной страницы пользователя.
  • Ссылку на любимые страницы пользователя.
  • Ссылку на страницу песочницу пользователя.
  • Ссылку на страницу записок пользователя.

За исключением первой, все страницы пусты в начале. Тебе можно будет редактировать их, используя любой викитекст. Имена являются просто примерами.

Инсталляция[edit]

  • Download и распакуйте файл(ы) в папку с названием AddPersonalUrls в вашу папку extensions/.
  • Добавьте следующий код в файл LocalSettings.php (в самый конец):
    require_once "$IP/extensions/AddPersonalUrls/AddPersonalUrls.php";
    
  • Yes Готово – Перейдите на страницу «Special:Version» на своём сайте, чтобы удостовериться в том, что расширение успешно установлено.

To upgrade an existing installation, replace the files with new ones. If you have customized it in any way, check the release notes for instructions on configuration changes.

Even though this extension has been tested on MediaWiki 1.20 only, it is likely to work on slightly earlier versions as well.

Configuration[edit]

Table of URLs[edit]

The additional URLs are defined in the global variable $wgAddPersonalUrlsTable, which you may customize in your LocalSettings.php. A default table is used if you do not provide a custom one. The table is an array where each entry assigns an ID to a (partial) URL or an array and works as follows:

  • Links are inserted after the link to the user's home page, in the order in which they appear in the array.
  • The ID is the name of a system message used to display the link. AddPersonalUrls is shipped with default messages (in the languages de, en, fr and it) for the links in the default $wgAddPersonalUrlsTable.
  • The URL is either an internal link (without brackets) or an external link. A link is recognized as external iff it contains the string '://' - if you have a better idea, please let me know.
  • If an array is specified, the first item is the URL, and the optional second item is append text to append to the URL. It may provide parameters to special pages. The distinction between URL and append text is necessary because otherwise, an existing special page with appended parameters would be recognized as a non-existing page and be displayed as a red link.
  • The string '$username' will be replaced with the current username, in URLs as well as in append text. Note that in LocalSettings.php, you need to write the URL or append text within single quotes to avoid that PHP already interprets $username while processing LocalSettings.php, in which case it would evaluate to an empty string.

The default content of $wgAddPersonalUrlsTable is currently as follows:

$wgAddPersonalUrlsTable = array(
	'addpersonalurls-userpages' => array(
		'Special:PrefixIndex',
		'?prefix=$username&namespace=2'
	),
	'addpersonalurls-home' => 'User:$username/Home',
	'addpersonalurls-favorites' => 'User:$username/Favorites',
	'addpersonalurls-sandbox' => 'User:$username/Sandbox',
	'addpersonalurls-notes' => 'User:$username/Notes'
);

Messages[edit]

addpersonalurls-desc
Description of this extension as shown in Special:Version.
addpersonalurls-preload
When a user clicks on a personal URL and the corresponding page does not exist, the result is a create-page screen with this text preloaded.
addpersonalurls-userpages
Description of the link which displays the subpages of User:$username where $username is the user currently logged in.
addpersonalurls-home
Description of the link which displays the subpage User:$username/Home where $username is the user currently logged in.
addpersonalurls-home-preload
When a user clicks on the addpersonalurls-home link and the corresponding page does not exist, the result is a create-page screen with the text of the addpersonalurls-preload message plus this text preloaded.
addpersonalurls-favorites
Description of the link which displays the subpage User:$username/Favorites where $username is the user currently logged in.
addpersonalurls-favorites-preload
When a user clicks on the addpersonalurls-favorites link and the corresponding page does not exist, the result is a create-page screen with the text of the addpersonalurls-preload message plus this text preloaded.
addpersonalurls-sandbox
Description of the link which displays the subpage User:$username/Sandbox where $username is the user currently logged in.
addpersonalurls-sandbox-preload
When a user clicks on the addpersonalurls-sandbox link and the corresponding page does not exist, the result is a create-page screen with the text of the addpersonalurls-preload message plus this text preloaded.
addpersonalurls-notes
Description of the link which displays the subpage User:$username/Notes where $username is the user currently logged in.
addpersonalurls-notes-preload
When a user clicks on the addpersonalurls-notes link and the corresponding page does not exist, the result is a create-page screen with the text of the addpersonalurls-preload message plus this text preloaded.

In general, when a personal page does not exist, the URL opens the page for editing, and the content of the system messages addpersonalurls-preload and ID-preload is preloaded. This will also work for any URLs you add, provided that ID is equal to addpersonalurls-subpage_title_in_lowercase.

CSS[edit]

In the resulting HTML code, each link is wrapped into an <li> element having an id attribute with value pt-ID. This is a feature provided by MediaWiki and allows to format personal URLs individually via CSS.

The AddPersonalUrls exension uses this feature to add icons, taken from the Wikicommons Nuvola icons, to the new links as well as to the existing ones provided by MedaWiki. You can override this with your own CSS.

Лог изменений[edit]

Version 0.4[edit]

Configuration changes[edit]

A number of enhancements have been implemented which considerably reduce the need for customization by site administrators.

  • Configuation is very different from version 0.31. See Extension:AddPersonalUrls#Configuration (or the file CONFIGURE in the distribution) for details.
  • AddPersonalUrls is now shipped with an i18n messages file which provides default messages for the languages de, en, fr and it. Thus, unless you want to use other languages or to customize the messages, you don't need to setup custom messages any more.
  • The extensions Call and DynamicPageList (third-party) are not needed any more.

Bug fixes[edit]

  • In version 0.31, the person icon beneath the first URL used to disappear when using this extension. This has been corrected.

New features[edit]

  • URLs can now contain external links. See Extension:AddPersonalUrls#Configuration (or the file CONFIGURE in the distribution) for details.
  • The array of URLs is now indexed with a name, which allows applying CSS to each single item.
  • In the Vector skin, icons are added to the new as well as to the existing icons.
  • When a personal page does not exist, the URL opens the page for editing, and a text explaining the purpose of this page is preloaded.

Other changes[edit]

  • The code has been reviewed in order to comply better with the guidelines on mediawiki.org.

0.31[edit]

  • Перешёл на новую версию Extension:DynamicPageList, которая больше не использует конкретную служебную страницу.

0.3[edit]

  • Параметр теперь член класса.

0.21[edit]

  • Исправление в mypages.

0.2[edit]

  • Конфигурация использую список.

0.1[edit]

  • Первая версия.

Смотри так-же[edit]