Extension:Postscript

From Linux Web Expert

MediaWiki extensions manual
Postscript
Release status: stable
Implementation User interface
Description append a text or script post of all artices.
Author(s) Kimagurenote (Corytalk)
Latest version 1.0.2
MediaWiki 1.25+
Database changes No
License BSD 3-clause "Modified" License
Download https://kimagurenote.net/kn/Postscript#Download
https://kimagurenote.net/kn/Postscript#History
Example https://kimagurenote.net/kn/Postscript
Quarterly downloads Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').
Public wikis using Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').

The Postscript extension provides a way to append some text and/or script in post of all artices each namespaces.

Installation

  • <translate> <tvar name=1>Download zip file from author's website, unzip it</tvar> and place the file(s) in a directory called <tvar name=name>Postscript</tvar> in your <tvar name=ext>extensions/</tvar> folder.</translate>
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    /* Extension:Postscript */
    wfLoadExtension( 'Postscript' );
    $wgPostscriptText[NS_MAIN] = <<<'START_END_MARKER'
    <script>…</script>
    START_END_MARKER;
    $wgPostscriptText[NS_FILE] = <<<'START_END_MARKER'
    <script>…</script>
    START_END_MARKER;
    
  • File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>

NS_xxx means please see Manual:Namespace constants.

Notes

<<<'START_END_MARKER' is heredoc, a PHP syntax.

This extensoin provides a way to append raw HTML (includes script). If you want to append wiki text, please see Extension:Header Footer or Extension:PageNotice.

(v1.0.1) changed using hook ContentAlterParserOutput to BeforePageDisplay because avoid to conflict with Extension:Popups.

(v1.0.2) changed to exclude empty and redirect pages. but work in redirect pages opened with redirect=no.

See also