Extension:PageAuthors

From mediawiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
OOjs UI icon advanced-invert.svg
PageAuthors
Release status: stable
Implementation Parser function
Description Get a sensible list of page authors
Author(s) Sophivorustalk
Latest version 1.0 (2021-10-18)
MediaWiki 1.35+
PHP 7+
Database changes No
License GNU General Public License 3.0 or later
Download
  • $wgPageAuthorsMinBytesPerEdit
  • $wgPageAuthorsDelimiter
  • $wgPageAuthorsIgnoreBots
  • $wgPageAuthorsIgnoreSystemUsers
  • $wgPageAuthorsIgnoreMinorEdits
  • $wgPageAuthorsIgnoreBlocked
  • $wgPageAuthorsMinBytesPerAuthor
  • $wgPageAuthorsIgnoreAnons
  • $wgPageAuthorsIgnoreSummaryPatterns
Translate the PageAuthors extension if it is available at translatewiki.net

Check usage and version matrix.

PageAuthors is an extension that introduces a magic word {{PAGEAUTHORS}} that returns a list of the main page authors of a page, sorted by number of bytes added. The extension is highly configurable so you can fine-tune what counts as an author.

Installation[edit]

  • Download and place the file(s) in a directory called PageAuthors in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'PageAuthors' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Usage[edit]

Simply add {{PAGEAUTHORS}} to any page and you will get a comma-separated list of the main authors of the current page, sorted by number of bytes added. See #Configuration to define your own criteria of what counts as an author.

You can also do {{PAGEAUTHORS:Some page}} to get the list of authors for some page other than the current one.

The list of authors can be further processed using Extension:Arrays or the #arraymap function of the PageForms extension, for example to link to the relevant user pages.

Configuration[edit]

Each configuration is shown with its default value:

  • $wgPageAuthorsMinBytesPerAuthor = 100; ― Minimum number of bytes added that each author must reach in order to be considered an author.
  • $wgPageAuthorsMinBytesPerEdit = 10; ― Minimum number of bytes that each edit must reach in order to be counted.
  • $wgPageAuthorsIgnoreMinorEdits = true; ― Whether to ignore edits marked as minor.
  • $wgPageAuthorsIgnoreBlocked = true; ― Whether to ignore blocked users.
  • $wgPageAuthorsIgnoreAnons = true; ― Whether to ignore anonymous users.
  • $wgPageAuthorsIgnoreBots = true; ― Whether to ignore bots.
  • $wgPageAuthorsIgnoreSystemUsers = true; ― Whether to ignore system users (such as in mass imports).
  • $wgPageAuthorsIgnoreSummaryPatterns = [ '/Undo.*/', '/Revert.*/' ]; ― Ignore edits with edit summaries that match these PHP regex patterns. By default, edits with edit summaries that start with 'Undo' or 'Revert' will be ignored (these match the default edit summaries when doing a revert or a rollback). So for example, if some vandal blanks a page and then a user reverts it, the revert won't count towards the byte count of the user.
  • $wgPageAuthorsDelimiter = ', '; ― Delimiter between authors.

See also[edit]

  • Extension:Contributors - Lists authors by edit count. This is not reliable because some users tend to do few but big edits while others tend to do many small ones. Extreme but real cases include pages where the initial author creates the entire page in a single huge edit while other later editors make multiple edits fixing trivial issues.
  • Extension:SemanticExtraSpecialProperties - The _EUSER property lists authors by chronological order. This is not reliable either because while it's often the case that the first few editors are the main authors, it also happens that later editors contribute significantly and may even rewrite the entire page.