You could add the script in the ubbthreads.php file from lines 237 to 259 (look for
Let's see how many user's are viewing each forum ) to your ubbt_registerednav.tmpl file. It might be a little ugly, cause you'd be adding another database query to every page, but it should work. Remember that the templates are constructed as one big echo, so you'll have to come out of echo, execute the php script, and then go back to echoing html. Something like this:
UBBTPRINT;
Execute some php scripting here
echo <<<UBBTPRINT
now we are back to echoing out html