I do a few things.
First off, I almost ALWAYS use
sprintf(). It's pretty awesome.
PHP Code:
sprintf("SELECT * FROM %suser WHERE userid=%d",TABLE_PREFIX,$userid);
Bam, you'll always get an integer. Also, query looks hella prettier. :3
Two, why not use vBulletin's built-in cleaning functions on data? That would solve a lot of it, wouldn't it?
Mind you, I'm a complete newbie to the scripting of this modification in particular, but I have successfully programmed a bunch of homebrewed mods for my own. I just want a disclaimer here that I could be completely off-base. X3