HI Billy, i have a Joomla site and i was having the same problem implementing this code. I found out i had to install a plugin to enable joomla to understand php code.
I don´t know about vbulletin, but it´s a good idea to ask at the vbulletin forums.
http://www.vbulletin.com/forum/
Cheers.