This would be correct, you forgot to define your template cache's etc.
PHP Code:
<?php
// # Set up php error reporting...
error_reporting(E_ALL & ~E_NOTICE);
// # Define important var's
define('NO_REGISTER_GLOBALS', 1);
// name of script
define('THIS_SCRIPT', 'script');
// allows us to use custom templates in this script
define('GET_EDIT_TEMPLATES', true);
// # Cache templates
// get special phrase groups
$phrasegroups = array();
// get special data templates from the datastore
$specialtemplates = array();
// pre-cache templates used by all actions
$globaltemplates = array(
'customtemplatename1',
'customtemplatename2'
);
// pre-cache templates used by specific actions
$actiontemplates = array();
// # Get backend...
require_once('./global.php');
// $template output's customtemplate1
eval('$template = "' . fetch_template('customtemplatename1') . '";');
// output's custometemplate2 (main template)
eval('print_output("' . fetch_template('customtemplate2') . '");');