Extension:OnlineStatusBar

OnlineStatusBar adds a little bar to user and talk pages of each user who enabled it, which signalizes whether they are available or not. It also creates the magic word  which may be used on user pages to check the status of a user. It is available in the user preferences.

Installation

 * 1) Add the required tables to the database; on the command line, enter:  (Note: Your designated database user needs to have CREATE rights on your MediaWiki database.) Alternatively you may create a table manually as defined in OnlineStatusBar.sql, by just executing it in the database.
 * 2) Just add the line:   to LocalSettings.php

Configuration
You may insert those parameters into LocalSettings.php:
 *   - if you want to track also ip users
 *   - default online status
 *   - default offline status
 *   - if it's enabled for all users as default
 *   - delay between database write access for update

How does it work
This extension creates a new table which contains username and last time when user opened some page. Each user has option to enable it in preferences, all users who do not have it enabled are not affected and do not update this table. When user login or logout it insert / delete the record from table, expired records are frequently removed so that table is very small, users update the table everytime when they read any page so that information whether they are available is updated.

Caching
Extension is using caching in order to access db only when it's necessary, memcached is required for that.

Api
New module for api called "onlinestatus" is available, you can display user online status by opening: api.php?action=query&prop=onlinestatus&onlinestatususer=User where User is username of user

Performance
It reads db everytime when user who has this enabled open any page (cached) in order to find if it's necessary to update timestamp, if timestamp is older than value specified in config, it's updated, thanks to that extension shouldn't write more frequently than once a 5 minutes or so.

Classes
It contains 4 classes each in separate file

OnlineStatusBarHooks
This class contains the hooks which are used.

ISONLINE
Extension also add a magic word which turns to current status of user, possible states are:
 * online - User in online
 * away / busy - User is away or busy
 * unknown - User doesn't want to be tracked or it's not a user
 * offline - User is offline