When replacing only 1 value, do not need to use arrays as search/replace values (see
str_replace manual).
Also, if you're using a plugin, you may check the existence of content in $post[field24] and $post[field38] and, only if true, perform the replacement:
Use the hook
postbit_display_complete:
PHP Code:
if ($post[field24] OR $post[field38]) {
$vbulletin->templatecache['postbit_legacy'] = str_replace('$post[musername]','$post[field24] $post[field38]',$vbulletin->templatecache['postbit_legacy']);
}
Regards