|
From: OryNider <ory...@us...> - 2008-01-16 04:03:52
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv19942 Modified Files: Tag: core28x mx_functions_phpbb.php template.php Log Message: sincronization with 2.9.2 Index: template.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/template.php,v retrieving revision 1.18.2.3 retrieving revision 1.18.2.4 diff -C2 -d -r1.18.2.3 -r1.18.2.4 *** template.php 13 Jan 2008 18:38:41 -0000 1.18.2.3 --- template.php 16 Jan 2008 04:03:46 -0000 1.18.2.4 *************** *** 1013,1016 **** --- 1013,1094 ---- /** + * Load a compiled template if possible, if not, recompile it + * @access private + */ + function _tpl_load(&$handle) + { + global $mx_user, $phpEx, $board_config; + + $recompile = (($board_config['load_tplcompile'] && @filemtime($filename) < filemtime($this->files[$handle])) || !file_exists($filename) || @filesize($filename) === 0) ? true : false; + + // Recompile page if the original template is newer, otherwise load the compiled version + if (!$recompile) + { + return $filename; + } + + // Just compile if no user object is present (happens within the installer) + $this->loadfile($handle); + return false; + } + + /** + * Display handle + * @access public + */ + function display($handle, $include_once = true) + { + global $mx_user, $phpbb_hook; + + if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array(__CLASS__, __FUNCTION__), $handle, $include_once)) + { + if ($phpbb_hook->hook_return(array(__CLASS__, __FUNCTION__))) + { + return $phpbb_hook->hook_return_result(array(__CLASS__, __FUNCTION__)); + } + } + + if (defined('IN_ERROR_HANDLER')) + { + if ((E_NOTICE & error_reporting()) == E_NOTICE) + { + error_reporting(error_reporting() ^ E_NOTICE); + } + } + + //if ($filename = $this->_tpl_load($handle)) + if ($filename) + { + ($include_once) ? include_once($filename) : include($filename); + } + else + { + eval(' ?>' . $this->compiled_code[$handle] . '<?php '); + } + + return true; + } + + /** + * Display the handle and assign the output to a template variable or return the compiled result. + * @access public + */ + function assign_display($handle, $template_var = '', $return_content = true, $include_once = false) + { + ob_start(); + $this->display($handle, $include_once); + $contents = ob_get_clean(); + + if ($return_content) + { + return $contents; + } + + $this->assign_var($template_var, $contents); + + return true; + } + + /** * Precompile file */ Index: mx_functions_phpbb.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_phpbb.php,v retrieving revision 1.32.2.4 retrieving revision 1.32.2.5 diff -C2 -d -r1.32.2.4 -r1.32.2.5 *** mx_functions_phpbb.php 15 Jan 2008 10:51:39 -0000 1.32.2.4 --- mx_functions_phpbb.php 16 Jan 2008 04:03:46 -0000 1.32.2.5 *************** *** 27,31 **** global $mx_page, $board_config, $phpbb_root_path, $phpEx; ! if( !function_exists('smilies_pass') && ((PORTAL_BACKEND == 'phpbb2') || (PORTAL_BACKEND == 'phpBB2')) ) { include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx); --- 27,31 ---- global $mx_page, $board_config, $phpbb_root_path, $phpEx; ! if( !function_exists('smilies_pass') && ((PORTAL_BACKEND == 'phpbb2') ) { include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx); |