[ticket/11816] Fix multiple parenthesis as well before $VARs in templates

http://tracker.phpbb.com/browse/PHPBB3-11816