Oh...try adding "global $vbulletin;" to the start of the plugin code ETA: ...and change bbuserinfo to vbulletin->userinfo,
so that the code is:
Code:
global $vbulletin;
$text = str_replace('__SECURITYTOKEN__', $vbulletin->userinfo[securitytoken], $text) ;
If that doesn't work, view the html source again and see what the hidden value looks like.
ETA: OK, I went and tried it and this seems to work. One thing I'm not sure about is that there's a bbcode_parse_complete_precache hook a little before the one we're using, and it's before the post is cached (as the name suggests). I'm not sure what the implications are of using one over the other. I thought I'd use post-cache so the token doesn't get cached, but I haven't studied the code.