Extension:ContactPage/ru

This page is a translated version of the page Extension:ContactPage and the translation is 50% complete.
Справка по расширениям MediaWiki
ContactPage
Статус релиза: стабильно
Реализация Служебная страница , Хук
Описание Предоставляет контактную форму для посетителей
Автор(ы) Daniel Kinzler, Sam Reed
Последняя версия Continuous updates
Политика совместимости Снэпшоты выходят вместе с MediaWiki. Мастер не имеет обратной совместимости.
PHP 5.4+
Изменения в БД Нет
Лицензия GNU General Public License 2.0 или позднее
Скачать
README
Пример nl.wikipedia.org
  • $wgContactConfig
Ежеквартальные загрузки 14 (Ranked 48th)
Переведите расширение ContactPage, если оно доступно на translatewiki.net
Роль Vagrant contactpage
Проблемы Открытые задачи · Сообщить об ошибке

Расширение ContactPage реализует контактную форму для посетителей. Он создает специальную страницу "Special:Contact", которая похожа на "Special:EmailUser", но имеет фиксированного получателя и может использоваться без регистрации.

Установка и настройка

  • Скачайте и распакуйте файл(ы) в папку с названием ContactPage в вашей папке extensions/.
    Вместо этого разработчикам и соавторам кода следует установить расширение из Git, используя:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/ContactPage
    
  • Добавьте следующий код в конце вашего файла LocalSettings.php :
    wfLoadExtension( 'ContactPage' );
    $wgContactConfig['default'] = [
        'RecipientUser' => null, // Must be the name of a valid account which also has a verified e-mail-address added to it.
        'RecipientEmail' => 'Contact Form on ' . $wgSitename,  // 'Contact Form on' needs to be translated
        'RecipientName' => null,
        'SenderEmail' => null, // Defaults to $wgPasswordSender, may be changed as required
        'SenderName' => null,
        'RequireDetails' => false,
        'IncludeIP' => false,
        'MustBeLoggedIn' => false,
        'MustHaveEmail' => false, // True means the user submitting the form must have an associated email address
        'NameReadonly' => false,
        'EmailReadonly' => false,
        'SubjectReadonly' => false,
        'UseCustomBlockMessage' => false,
        'Redirect' => null,
        'RLModules' => [], // Resource loader modules to add to the form display page.
        'RLStyleModules' => [], // Resource loader CSS modules to add to the form display page.
        'AdditionalFields' => [
    		'Text' => [
    			'label-message' => 'emailmessage',
    			'type' => 'textarea',
    			'required' => true
    		]
    	],
    	'FieldsMergeStrategy' => null
    ];
    
  • See the README file for further options to customize and adapt as it convenes.
  •   Готово – Перейдите на страницу Special:Version на своей вики, чтобы удостовериться в том, что расширение успешно установлено.
You can require a CAPTCHA test for the contact page if you have the ConfirmEdit extension installed. CAPTCHAs are enabled by adding
$wgCaptchaTriggers['contactpage'] = true;
to "LocalSettings.php" below the invocation of both extensions.


Дальнейшая настройка

  1. Add the following code (with the correct URL inserted) to your LocalSettings.php file:
$wgHooks['SkinAddFooterLinks'][] = function( Skin $skin, string $key, array &$footerlinks ) {
    if ( $key === 'places' ) {
        $footerlinks['contact'] = Html::element( 'a',
            [
                'href' => 'https://www.example.org/wiki/Special:Contact',  // URL to "Special:Contact"
                'rel' => 'noreferrer noopener'  // not required, but recommended for security reasons
            ],
        $skin->msg( 'contactpage-label' )->text()
        );
    };
};
  1. Add the label for "Special:Contact" to system message MediaWiki:Contactpage-label.

Creating complex forms

See HTMLForm and related pages for more information on the possibilities available to create more complex forms.

Manual:HTMLForm Tutorial 3 provides more details of the values that can be used for type value of fields under AdditionalFields. For example, you can use 'type': 'usersmultiselect' to have a field that allows the selection of multiple usernames.

Проблемы

Users of some hosting providers such as SiteGround and Amazon SES may get a PHP mail error or one that says that the FROM email address is not configured in the server, despite $wgPasswordSender being configured correctly and other email functionality working as expected. A fix for this issue is described here .

См. также

  • Extension:EmailPage - Позволяет отправлять полностью отрисованные статьи со встроенным CSS пользователям, группам или спискам контактов
  • Extension:CIForms - Формы с автоматической проверкой, вопросами с множественным выбором и тестами cloze