Haven't read the whole source code. But...
To convert
PHP Code:
eval('$ed2kbit .= "' . fetch_template('ed2kbit') . '";');
to be 4.0 compatible, use this:
(you need to explicitly register all the variables you intend to use inside a template. for example: $totalper)
PHP Code:
$templateBit = vB_Template::create('ed2kbit');
$templateBit->register('totalper', $totalper);
$templateBit->register('some_var_for_ed2kbit', $somevar);
$ed2kbit .= $templateBit->render();