$find_string = '<span class="postcontrols">'; $repl_string = vB_Template::fetch_template_raw('my_custom_template'); $vbulletin->templatecache['postbit_legacy'] = str_replace($find_string, $find_string . $repl_string, $vbulletin->templatecache['postbit_legacy']);