Two small additional notes.
Firstly, templatecache identities are CASE SENSITIVE. So
$vbulletin->templatecache['SHOWTHREAD'] will work but
$vbulletin->templatecache['showthread'] will not, because the the template is named with capitals.
Secondly, if you are doing a find/replace it's slightly more efficient to include what you're finding in the replacement text instead of appending it in the str_replace. So
Code:
$find = 'this';
$replace = 'this that';
$vbulletin->templatecache['SHOWTHREAD'] = str_replace($find, $replace, $vbulletin->templatecache['SHOWTHREAD']);
is more efficient than
Code:
$find = 'this';
$replace = ' that';
$vbulletin->templatecache['SHOWTHREAD'] = str_replace($find, $find.$replace, $vbulletin->templatecache['SHOWTHREAD']);
Doing it the first way also has another advantage in that you can add your replacement immediately before what you're finding. If you do it the second way, you can only add it after.