The problem was that the scope of the global variable is not available to all vbulletin code when called from a more complex script (standalone php file seems to work fine). Our newest addition to the JFusion programmers team has found a solution on how to make it work even from inside another program:
Code:
global $vbulletin;
require_once(CWD . './includes/init.php');
//work around to make global vbulletin stick
$registry = $vbulletin;
unset($vbulletin);
$vbDb = $registry->db;
//declare as global vbulletin's registry and db objects
global $vbulletin,$db;
$vbulletin = $registry;
//vbulletin db object which is needed for vbulletin's project tools addon
$db = $vbDb;
This resets the global objects in the main script and allows it to be available for the next set of calls to the vb datamanager.
Thanks, Marius