In your plugin temporarily add
PHP Code:
var_dump($vbulletin->GPC['b']);
at the bottom of the PHP Code. Run the script again and check the output. There should be something like NULL or int(2) at the top of the screen. (You might need to view the HTML source of the page, but it should be listed at the very top).
You may find the rest of the page ceases to function correctly just ignore that, you can remove the line once you've followed the instructions.
Post what you get outputted here.