If you just include global.php it includes init.php and functions.php. If you want to move out of the forum root use chdir()
E.g.:
PHP Code:
$cwd = getcwd();
chdir('path/to/forumroot/');
require_once('global.php');
$threaddm =& datamanager_init('Thread_FirstPost', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
chdir($cwd);
// Continue script here...
// For error checking I think they are contained in a $threaddm->errors array.