You need to put:
PHP Code:
include('./filename.php');
after the require golbal.php statement.
Add the template for the calendar and then make sure that the calendar php file doesn't output the template but evals it to a variable, eg:
PHP Code:
eval("\$calendar = \"".gettemplate(small_calendar)."\";");
ie $calendar instead of dooutput then you just place your variable in this case $calendar in the required template.