Extension:RecentChangesOption

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
OOjs UI icon advanced.svg
RecentChangesOption
Release status: beta
RecentChangesNamespaceOption screenshot.png
Implementation Special page
Description Adds options to manage the default visibility of certain log types or namespaces on the Recent Changes page
Author(s) dlhtalk
MediaWiki 1.18+
Database changes No
License MIT License
Download
README
Translate the RecentChangesOption extension if it is available at translatewiki.net
Check usage and version matrix.

The RecentChangesOption extension adds options to manage the default visibility of certain log types or namespaces on the Recent Changes page.

RecentChangesOption will provide messages in the requesting user's language preference. MediaWiki provides translations for log types and namespace names, so the messages can be automatically generated.

Installation[edit]

  • Download and place the file(s) in a directory called RecentChangesOption in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    require_once "$IP/extensions/RecentChangesOption/RecentChangesOption.php";
    
  • Set the default visibility of certain log types or namespaces by creating an instance of the RecentChangesOption class. Refer to the documentation for log types (the letype list), namespace constants, and the examples below.
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Examples[edit]

// Hide the User creation log by default
RecentChangesOption::create()->filterLogType("newusers");

// Do not hide the User creation log by default, but still provide an easy
// way for users to hide it
RecentChangesOption::create(/* $hideDefault */ false)->filterLogType("newusers");

// Hide the Template namespace by default
RecentChangesOption::create()->filterNamespace(NS_TEMPLATE);

// Hide the Template namespace and its associated talk page by default
RecentChangesOption::create(true, /* $filterAssociatedNamespace */ true)->filterNamespace(NS_TEMPLATE);

// Hide the User creation log, Block log; Template, MediaWiki namespaces
// (and their talk pages) by default
RecentChangesOption::create(true, true)->filterLogType("newusers", "block")->filterNamespace(NS_TEMPLATE, NS_MEDIAWIKI);

// Hide all public logs
RecentChangesOption::create()->filterLogType("");