lucamauri / recentactivity
Adds parser functions for listing recently created and edited articles
Package info
gitlab.com/lucamauri/RecentActivity
Type:mediawiki-extension
pkg:composer/lucamauri/recentactivity
This package is auto-updated.
Last update: 2026-04-19 21:16:42 UTC
README
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(), andrev_user_textcolumn references with current equivalents - Namespace filtering — added
$wgRANamespacesconfiguration variable to allow filtering results by namespace (e.g. excludeFile:pages from results) - Dependency injection — converted the hook handler to use constructor-based dependency injection via
HookHandlersinextension.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:
arrayof 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
| Parameter | Description | Default |
|---|---|---|
type | edits for recently edited pages, new for recently created pages | (empty — returns nothing) |
user | Filter results to edits or creations by this username | (all users) |
count | Number of results to return | 5 |
format | Wikitext 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.