[ticket/12994] Add core event to viewtopic.php before sending vars to template

Add core event to viewtopic.php before sending vars to template
to allow extensions performing additional actions/modifying data first.

PHPBB3-12994