You can create a plugin using hook parse_templates, and pre-register a variable to the header template, like:
Code:
vB_Template::preRegister('header', array('forumid' => $forumid));
and then in the header template:
However, finding the forumid might be a bit of a problem since not every page is going to have $foruminfo defined. You could try this:
Code:
global $foruminfo;
$forumid = $foruminfo['forumid'];
vB_Template::preRegister('header', array('forumid' => $forumid));
(or you could of course just register $foruminfo and use foruminfo.forumid like in your example), but I think you'll find that it only shows a forum id on certain pages, if at all.