Maybe something like this:
Code:
$smallwords = array( 'a','of','the');
$capwords = array('ALLCAPS', 'ABC', XYZ');
$words = explode(' ', $vbulletin->GPC['subject']);
foreach ($words as $key => $word) {
$capword = strtoupper($word);
if (in_array($capword, $capwords)) $words[$key] = $capword;
else if (!$key or !in_array($word, $smallwords)) $words[$key] = ucwords($word);
}
$vbulletin->GPC['subject'] = implode(' ' , $words);