Are you saying you have a custom script that includes global.php, but it doesn't work outside the forum directory? Then yes, you should be able to use chdir() to change to the forum directory before including global.php, like:
Code:
chdir('./forum');
require('global.php');
You may need to chdir() back to the original directory, depending on what else you script does.