[ticket/13051] Fix viewonline event (recently broken) and add a new core event

https://tracker.phpbb.com/browse/PHPBB3-13051

This is a reversion of https://github.com/phpbb/phpbb/pull/2915 which simply destroyed this events usability.

PHPBB3-13051
Do you think it is useful to have the first three variables here again?