I took your php page, replaced the $userinfo with $vbulletin->userinfo and I get a page that simply says:
// AVATAR
But, since you aren't using a template to spit anything out and you aren't echoing anything in your php, I would not expect any other result.
edit: I meant to add, if I add this, I get something to spit out. I'm not sure it's the best way to do this though (someone else may comment on that).
PHP Code:
echo "<img src='/forums/" .$vbulletin->userinfo['avatarurl']. "'>";