Seems a weird way to establish a database connection...
why not simply including global.php and use the db connection from $vbulletin->db ?
PHP Code:
require_once('./includes/class_bbcode.php');
Are you sure this file exists and actually does something usable?
Overall a not-so-good way to use vbulletin methods in external scripts, i suggest to use this instead:
https://vborg.vbsupport.ru/showthread.php?t=228112