lucamauri/recentactivity

Adds parser functions for listing recently created and edited articles

Maintainers

Package info

gitlab.com/lucamauri/RecentActivity

Homepage

Issues

Wiki

Documentation

Type:mediawiki-extension

pkg:composer/lucamauri/recentactivity

Statistics

Installs: 70

Dependents: 0

Suggesters: 0

Stars: 0

v2.0 2025-08-14 12:23 UTC

This package is auto-updated.

Last update: 2026-04-19 21:16:42 UTC


README

GPL-2.0-or-later License Built with Visual Studio Code MediaWiki

Adds a parser function for listing recently created or edited articles on a MediaWiki wiki.

Why the fork

This fork was created by Luca Mauri from the original RecentActivity extension by Aran Dunkley, hosted on GitLab at gitlab.com/lucamauri/RecentActivity.

The goals of this fork are:

  • PHP 8.x compatibility — the original extension used APIs deprecated or removed in PHP 8 and MediaWiki 1.36+
  • MediaWiki 1.39+ API modernisation — replaced wfGetDB(), IDatabase::select(), Title::newFromId(), and rev_user_text column references with current equivalents
  • Namespace filtering — added $wgRANamespaces configuration variable to allow filtering results by namespace (e.g. exclude File: pages from results)
  • Dependency injection — converted the hook handler to use constructor-based dependency injection via HookHandlers in extension.json, following modern MediaWiki extension standards
  • Code quality — improved docblocks, comments, i18n of error messages, and overall code readability

The original GitLab repository is preserved for attribution purposes.

Requirements

  • MediaWiki 1.39.0 or later
  • PHP 8.0 or later

Installation

Via Composer (recommended)

Add the following to composer.local.json at the root of your MediaWiki installation (create the file if it does not exist):

{
    "require": {
        "lucamauri/recentactivity": "^1.9"
    },
    "extra": {
        "merge-plugin": {
            "include": []
        }
    }
}

Then run Composer in the root of your MediaWiki installation:

composer install --no-dev

Manual installation

Download the source code from the GitHub releases page and decompress it into a folder named RecentActivity inside the extensions/ directory of your MediaWiki installation.

Activate the extension

Add the following line near the rest of the extension loading calls in LocalSettings.php:

wfLoadExtension( 'RecentActivity' );

Then add any configuration variables you need, as described in the Configuration section below.

Configuration

All configuration variables are optional. Add them to LocalSettings.php after the wfLoadExtension call.

$wgRAExclusionsCat

Pages belonging to this category will be excluded from all results.

  • Type: string
  • Default: 'Excluded from RecentActivity'
$wgRAExclusionsCat = 'My exclusion category';

$wgRANamespaces

Restrict results to pages in specific namespaces. Use an array of namespace ID integers. If empty (the default), pages from all namespaces are returned.

  • Type: array of integers
  • Default: [] (all namespaces)
// Show only pages from the main namespace (0) and the Project namespace (4)
$wgRANamespaces = [ 0, 4 ];

This is the recommended way to exclude media files from results — set it to [ 0 ] to return only main-namespace articles.

Usage

The extension adds the {{#RecentActivity:}} parser function. All parameters are optional and passed as named arguments.

Parameters

ParameterDescriptionDefault
typeedits for recently edited pages, new for recently created pages(empty — returns nothing)
userFilter results to edits or creations by this username(all users)
countNumber of results to return5
formatWikitext list marker prepended to each result*

Examples

Show the last five recently edited articles:

{{#RecentActivity:type=edits}}

Show the last five recently created articles:

{{#RecentActivity:type=new}}

Show the last five articles created by user Foo:

{{#RecentActivity:type=new|user=Foo}}

Show the last ten recently edited articles:

{{#RecentActivity:type=edits|count=10}}

Show recently edited articles with a double-asterisk prefix (useful for tree views):

{{#RecentActivity:type=edits|format=**}}

Debugging

Log output is written to the RecentActivity log group. To enable it, add the following to LocalSettings.php:

$wgDebugLogGroups['RecentActivity'] = '/var/log/mediawiki/recentactivity.log';

Credits

Originally developed by Aran Dunkley. Modernised and maintained by Luca Mauri.

Icon

The project icon © 2014 Andreas Kainz & Uri Herrera & Andrew Lake & Marco Martin & Harald Sitter & Jonathan Riddell & Ken Vermette & Aleix Pol & David Faure & Albert Vaca & Luca Beltrame & Gleb Popov & Nuno Pinheiro & Alex Richardson & Jan Grulich & Bernhard Landauer & Heiko Becker & Volker Krause & David Rosca & Phil Schaf / KDE

License

This extension is released under the GNU General Public License, version 2 or later.