User:Andrewds1021/UserLastActivity

Note: This script is still in the testing phase.

This solution was created in response to Thread:1621411.

The purpose of this script is to retrieve and display the timestamp of the last logged action committed by the specified user on the local wiki. The script uses MediaWiki's api.php to retrieve this information. If it is able to retrieve the information, it inserts the date and time as the entire contents of the specified HTML element (removing all other content). In the event that the specified user has no logged actions on the local wiki, an appropriate message will be inserted instead.

Configuration
To have this script insert the date-time of a user's most recent logged activity on the local wiki, start by specifying an HTML element for which the content will be replaced with the date-time. For the selected element, assign the class  as well as one (or both) of the HTML attributes   and. The former attribute should be assigned the user's username while the latter should be assigned the user's user id. Using the user's user id prevents the need to change the assigned value in the event that the user changes their username via the UserRenameTool.