If you are going to write your own vbulletin powered page, you really should follow this tutorial -
[How-To] vBulletin API Basics: Creating Custom Pages & Misc. If it's just gonna be a function, then you really don't need to include other pages in there at all and you really should put all the output into a variable, not echo it. Echoing it can produce some strange results.