template = &$template; } /** * Load template source from file * @access: private */ function _tpl_load_file($handle) { // Try and open template for read if (!file_exists($this->template->files[$handle])) { trigger_error("template->_tpl_load_file(): File {$this->template->files[$handle]} does not exist or is empty", E_USER_ERROR); } $this->template->compiled_code[$handle] = $this->compile(trim(@file_get_contents($this->template->files[$handle]))); // Actually compile the code now. $this->compile_write($handle, $this->template->compiled_code[$handle]); } /** * The all seeing all doing compile method. Parts are inspired by or directly from Smarty * @access: private */ function compile($code, $no_echo = false, $echo_var = '') { global $config; if ($echo_var) { global $$echo_var; } // Remove any "loose" php ... we want to give admins the ability // to switch on/off PHP for a given template. Allowing unchecked // php is a no-no. There is a potential issue here in that non-php // content may be removed ... however designers should use entities // if they wish to display < and > $match_php_tags = array('#\<\?php .*?\?\>#is', '#\