[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.

<a href="https://tracker.phpbb.com/browse/PHPBB3-12994">PHPBB3-12994</a>.