Rozšíření:ContactPage

From mediawiki.org
This page is a translated version of the page Extension:ContactPage and the translation is 100% complete.
Základní informace k tomuto rozšíření MediaWiki
ContactPage
Stav rozšíření: stabilní
Zavádění Speciální stránka , Háček
Popis Poskytuje kontaktní formulář pro návštěvníky
Napsal(i) Daniel Kinzler, Sam Reed
Nejnovější verze Continuous updates
Zásady kompatibility Vydání snímků následuje MediaWiki. Hlavní vývojová větev není zpětně kompatibilní.
MediaWiki >= 1.42.0
PHP 5.4+
Změny v databázi Ne
Licence GNU General Public License 2.0 nebo pozdější
Zdrojový kód
README
Příklad nl.wikipedia.org
  • $wgContactConfig
Čtvrtletní stahování 67 (Ranked 83rd)
Přeložte rozšíření ContactPage, používá-li lokalizaci z translatewiki.net
Vagrant role contactpage
Problémy Otevřené úkoly · Nahlásit chybu

Rozšíření ContactPage implementuje kontaktní formulář pro návštěvníky. Vytvoří speciální stránku "Special:Contact", která je podobná "Special:EmailUser", ale má pevného příjemce a lze ji používat bez registrace.

Instalace a nastavení

  • Stáhněte soubor/y a vložte je do adresáře pojmenovaného ContactPage ve vaší složce extensions/.
    Vývojáři a přispěvatelé kódu by si místo toho měli nainstalovat rozšíření from Git pomocí:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/ContactPage
  • Na konec vašeho souboru LocalSettings.php přidejte následující kód:
    wfLoadExtension( 'ContactPage' );
    $wgContactConfig['default'] = [
    	'RecipientUser' => 'WikiUser',  // Must be the name of a valid account which also has a verified e-mail-address added to it.
    	'SenderName' => 'Contact Form on ' . $wgSitename,  // "Contact Form on" needs to be translated
    	'SenderEmail' => null,  // Defaults to $wgPasswordSender, may be changed as required
    	'RequireDetails' => true,  // Either "true" or "false" as required
    	'IncludeIP' => true, // Either "true" or "false" as required
    	'MustBeLoggedIn' => true,  // Check if the user is logged in before rendering the form. Either "true" or "false" as required
        'NameReadonly' => false, // Set to "true" to make the name field read only
        'EmailReadonly' => false, // Set to "true" to make the email address field read only
        'SubjectReadonly' => false, // Set to "true" to make the subject line field read only
        'MustHaveEmail' => false, // Set to "true" to require that the user submitting the form must have an associated email address
    	'AdditionalFields' => [
    		'Text' => [
    			'label-message' => 'emailmessage',
    			'type' => 'textarea',
    			'rows' => 20,
    			'required' => true,  // Either "true" or "false" as required
    		],
    	],
    	'DisplayFormat' => 'table',  // See HTMLForm documentation for available values.
    	'RLModules' => [],  // Resource loader modules to add to the form display page.
    	'RLStyleModules' => []  // Resource loader CSS modules to add to the form display page.
    ];
    
  • See the README file for further options to customize and adapt as it convenes.
  • Yes Dokončeno – Přejděte na stránku Special:Version vaší wiki a zkontrolujte, zda bylo rozšíření úspěšně nainstalováno.
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.


Další přizpůsobení

Adding a link to special page "Contact" to the footer

MediaWiki 1.37.0 or later
  1. Add the following code without changing it 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()
            );
        };
    };
    
  2. Add the label for "Special:Contact" to system message MediaWiki:Contactpage-label.
MediaWiki 1.36.x or earlier
  1. Add the following code without changing it to your "LocalSettings.php" file:
    $wgHooks['SkinTemplateOutputPageBeforeExec'][] = function( $skin, &$template ) {
    	$contactLink = Html::element( 'a', [ 'href' => $skin->msg( 'contactpage-url' )->escaped() ],
    		$skin->msg( 'contactpage-label' )->text() );
    	$template->set( 'contact', $contactLink );
    	$template->data['footerlinks']['places'][] = 'contact';
    	return true;
    };
    
  2. Add the URL of "Special:Contact" to system message MediaWiki:Contactpage-url and
  3. 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.

Problémy

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.

Související odkazy

  • Extension:EmailPage - Umožňuje odesílat úplné články s vloženým CSS uživatelům, skupinám nebo seznamům kontaktů
  • Extension:CIForms - Formuláře s automatickým ověřováním, otázkami s výběrem odpovědí a testy uzavření