|
From: FlorinCB <ory...@us...> - 2008-08-30 19:05:08
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv4048 Modified Files: mx_functions_style.php template.php Log Message: fix for forum integration module Index: template.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/template.php,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** template.php 13 Jul 2008 19:30:28 -0000 1.30 --- template.php 30 Aug 2008 19:04:58 -0000 1.31 *************** *** 817,821 **** foreach($filename_array as $handle => $filename) ! { $this->set_filename($handle, $filename); } --- 817,822 ---- foreach($filename_array as $handle => $filename) ! { ! $this->set_filename($handle, $filename); } *************** *** 856,859 **** --- 857,873 ---- } } + + if (strpos($this->files[$handle],'overall_header.') && $xs_include && defined('MX_PHPBB3_BLOCK')) + { + //Do not include phpBB3 overall header and footer files using xs_include inside forum integration + $this->files[$handle] = str_replace($filename, 'index.htm', $this->files[$handle]); + } + + if (strpos($this->files[$handle],'overall_footer.') && $xs_include && defined('MX_PHPBB3_BLOCK')) + { + //Do not include phpBB3 overall header and footer files using xs_include inside forum integration + $this->files[$handle] = str_replace($filename, 'index.htm', $this->files[$handle]); + } + // creating cache filename if($can_cache != '') *************** *** 926,930 **** // Note: This little snippet is needed to make the templating work with Olympus // ! if ( !defined( 'IN_ADMIN' ) ) { $admin_script = ($admin_script) ? $admin_script : $filename; --- 940,944 ---- // Note: This little snippet is needed to make the templating work with Olympus // ! if (!defined('IN_ADMIN')) { $admin_script = ($admin_script) ? $admin_script : $filename; *************** *** 939,942 **** --- 953,964 ---- echo '<!-- template ', $this->files[$handle], ' start -->'; } + + if ((strpos($filename,'overall_header.')) && defined('MX_PHPBB3_BLOCK')) + { + die("overall_header."); + //Do not include phpBB3 overall header and footer files. + $filename = str_replace('overall_header.', 'index.', $filename); + $filename = str_replace('overall_footer.', 'index.', $filename); + } if ($filename) *************** *** 993,996 **** --- 1015,1027 ---- $this->xs_startup(); $force_recompile = empty($this->uncompiled_code[$handle]) ? false : true; + + if ((strpos($this->files_cache[$handle],'overall_header.')) && defined('MX_PHPBB3_BLOCK')) + { + die("overall_header."); + //Do not include phpBB3 overall header and footer files. + $filename = str_replace('overall_header.', 'index.', $filename); + $filename = str_replace('overall_footer.', 'index.', $filename); + } + // checking if php file exists. if (!empty($this->files_cache[$handle]) && !$force_recompile) *************** *** 1016,1020 **** $this->compiled_code[$handle] = $this->compile2($this->uncompiled_code[$handle], '', ''); } ! } // Run the compiled code. if (empty($this->files_cache[$handle]) || $force_recompile) --- 1047,1052 ---- $this->compiled_code[$handle] = $this->compile2($this->uncompiled_code[$handle], '', ''); } ! } ! // Run the compiled code. if (empty($this->files_cache[$handle]) || $force_recompile) *************** *** 1026,1029 **** --- 1058,1062 ---- $this->execute($this->files_cache[$handle], '', $handle); } + return true; } *************** *** 1073,1076 **** --- 1106,1110 ---- } } + //if ($filename = $this->_tpl_load($handle)) Index: mx_functions_style.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_style.php,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** mx_functions_style.php 30 Aug 2008 11:20:42 -0000 1.89 --- mx_functions_style.php 30 Aug 2008 19:04:58 -0000 1.90 *************** *** 110,114 **** * @access public */ ! function make_filename($filename) { global $module_root_path, $mx_root_path, $phpbb_root_path, $theme, $mx_user, $mx_block; --- 110,114 ---- * @access public */ ! function make_filename($filename, $xs_include = false) { global $module_root_path, $mx_root_path, $phpbb_root_path, $theme, $mx_user, $mx_block; *************** *** 126,129 **** --- 126,140 ---- } */ + + if($this->subtemplates) + { + $filename = $this->subtemplates_make_filename($filename); + } + // Check replacements list + if(!$xs_include && isset($this->replace[$filename])) + { + $filename = $this->replace[$filename]; + } + $style_path = $mx_user->template_name; *************** *** 220,227 **** $fileSearch[] = $mx_user->default_template_name . '/' . 'template'; // Then check Default template $fileSearch[] = './'; - $temppath = $this->doFileSearch($fileSearch, $filename, $filename2, 'styles/', $phpbb_root_path, false); if (!empty($this->module_template_path)) ! { return $temppath; } --- 231,247 ---- $fileSearch[] = $mx_user->default_template_name . '/' . 'template'; // Then check Default template $fileSearch[] = './'; + + + $temppath = $this->doFileSearch($fileSearch, $filename, $filename2, 'styles/', $phpbb_root_path, false); if (!empty($this->module_template_path)) ! { ! if (!file_exists($root_path . $this->module_template_path . 'gecko.css')) ! { ! //Do not include phpBB3 overall header and footer files. ! $temppath = str_replace('overall_header', 'index', $temppath); ! $temppath = str_replace('overall_footer', 'index', $temppath); ! } ! return $temppath; } *************** *** 250,253 **** --- 270,274 ---- die("Template->make_filename(): Error - file $filename does not exist. <br />Class-Root: $this->root <br />Module: $module_root_path <br />Current style: $style_path <br />Cloned style: $mx_user->cloned_template_name <br />Default style: $mx_user->default_template_name <br />Custom module default style: $moduleDefault"); } + /** *************** *** 264,283 **** $this->module_template_path = ''; foreach ($fileSearch as $key => $path) ! { ! if (!empty($path)) { $this->debug_paths .= '<br>' . $root_path . $root . $path . '/' . $filename; if( file_exists($root_path . $root . $path . '/' . $filename) ) ! { $this->module_template_path = $root . $path . '/'; ! return $root_path . $root . $path . '/' . $filename; } ! if ($check_file2) { ! if( file_exists($root_path . $root . $path . '/' . $filename2) ) ! { ! $this->module_template_path = $root . $path . '/'; ! return $root_path . $root . $path . '/' . $filename2; ! } } } --- 285,303 ---- $this->module_template_path = ''; foreach ($fileSearch as $key => $path) ! { ! if (!empty($path) && ($path !== './')) { $this->debug_paths .= '<br>' . $root_path . $root . $path . '/' . $filename; + if( file_exists($root_path . $root . $path . '/' . $filename) ) ! { $this->module_template_path = $root . $path . '/'; ! return $root_path . $root . $path . '/' . $filename; } ! ! if ($check_file2 && file_exists($root_path . $root . $path . '/' . $filename2)) { ! $this->module_template_path = $root . $path . '/'; ! return $root_path . $root . $path . '/' . $filename2; } } |