|
From: Jon O. <jon...@us...> - 2008-11-01 15:12:32
|
Update of /cvsroot/mxbb/core/includes In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv13795 Modified Files: mx_functions_style.php Log Message: Removing set_filename(). I have moved code to make_filename(). Need to be debugged. Index: mx_functions_style.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_style.php,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** mx_functions_style.php 31 Oct 2008 19:02:21 -0000 1.104 --- mx_functions_style.php 1 Nov 2008 15:12:28 -0000 1.105 *************** *** 114,135 **** global $module_root_path, $mx_root_path, $phpbb_root_path, $theme, $mx_user, $mx_block; ! /* ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! case 'phpbb2': ! $style_path = $theme['template_name']; ! break; ! case 'phpbb3': ! $style_path = $theme['style_name']; ! break; ! } ! */ ! if($this->subtemplates) { $filename = $this->subtemplates_make_filename($filename); } // Check replacements list if(!$xs_include && isset($this->replace[$filename])) { --- 114,128 ---- global $module_root_path, $mx_root_path, $phpbb_root_path, $theme, $mx_user, $mx_block; ! // ! // ? ! // if($this->subtemplates) { $filename = $this->subtemplates_make_filename($filename); } + + // // Check replacements list + // if(!$xs_include && isset($this->replace[$filename])) { *************** *** 238,242 **** 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. --- 231,236 ---- if (!empty($this->module_template_path)) { ! // ?? ! if (!file_exists($mx_root_path . $this->module_template_path . 'gecko.css')) { //Do not include phpBB3 overall header and footer files. *************** *** 248,251 **** --- 242,284 ---- } + /* + // MOVED HERE FROM SET_FILENAME(), NEED TO BE MERGED APPROPRIATELY. + // + // Do not include phpBB3 overall header and footer files using xs_include inside forum integration + // Does this code need to be here? + // + if (PORTAL_BACKEND == 'phpbb3' && $xs_include && defined('MX_PHPBB3_BLOCK') && $module_root_path) + { + if (strpos($this->files[$handle],'overall_header.')) + { + //$this->files[$handle] = str_replace('overall_header', 'overall_header_plugin', $this->files[$handle]); + $filename2 = 'overall_header_plugin.html'; + $filename3 = 'index.htm'; + $this->debug_paths .= '<br>Module'; + $fileSearch = array(); + $fileSearch[] = $style_path; // First check current template + $fileSearch[] = $mx_user->cloned_template_name; // Then check Cloned template + $fileSearch[] = $moduleDefault; // Finally check Default template + $fileSearch[] = './'; // Compatibility with primitive modules + + $this->files[$handle] = $this->doFileSearch($fileSearch, $filename3, $filename2, 'templates/', $module_root_path); + } + + if (strpos($this->files[$handle],'overall_footer.')) + { + $filename2 = 'overall_footer_plugin.html'; + $filename3 = 'index.htm'; + $this->debug_paths .= '<br>Module'; + $fileSearch = array(); + $fileSearch[] = $style_path; // First check current template + $fileSearch[] = $mx_user->cloned_template_name; // Then check Cloned template + $fileSearch[] = $moduleDefault; // Finally check Default template + $fileSearch[] = './'; // Compatibility with primitive modules + + $this->files[$handle] = $this->doFileSearch($fileSearch, $filename3, $filename2, 'templates/', $module_root_path); + } + } + */ + // // This doesn't fit in...so left as is. *************** *** 346,473 **** } - /** - * Assigns template filename for handle. - */ - function set_filename($handle, $filename, $xs_include = false, $quiet = false) - { - global $board_config, $module_root_path, $mx_root_path, $phpbb_root_path, $theme, $mx_user, $mx_block; - $can_cache = $this->use_cache; - if(strpos($filename, '..') !== false) - { - $can_cache = false; - } - $this->files[$handle] = $this->make_filename($filename, $xs_include); - $this->files_cache[$handle] = ''; - $this->files_cache2[$handle] = ''; - // check if we are in admin control panel and override extreme styles mod controls if needed - if(defined('XS_ADMIN_OVERRIDE') && XS_ADMIN_OVERRIDE === true && @function_exists('xs_admin_override')) - { - xs_admin_override(); - } - // checking if we have valid filename - if(!$this->files[$handle]) - { - if($xs_include || $quiet) - { - return false; - } - else - { - die("Template->make_filename(): Error - invalid template $filename"); - } - } - - //Do not include phpBB3 overall header and footer files using xs_include inside forum integration - if ($xs_include && defined('MX_PHPBB3_BLOCK') && $module_root_path) - { - if (strpos($this->files[$handle],'overall_header.')) - { - //$this->files[$handle] = str_replace('overall_header', 'overall_header_plugin', $this->files[$handle]); - $filename2 = 'overall_header_plugin.html'; - $filename3 = 'index.htm'; - $this->debug_paths .= '<br>Module'; - $fileSearch = array(); - $fileSearch[] = $style_path; // First check current template - $fileSearch[] = $mx_user->cloned_template_name; // Then check Cloned template - $fileSearch[] = $moduleDefault; // Finally check Default template - $fileSearch[] = './'; // Compatibility with primitive modules - - $this->files[$handle] = $this->doFileSearch($fileSearch, $filename3, $filename2, 'templates/', $module_root_path); - } - - if (strpos($this->files[$handle],'overall_footer.')) - { - $filename2 = 'overall_footer_plugin.html'; - $filename3 = 'index.htm'; - $this->debug_paths .= '<br>Module'; - $fileSearch = array(); - $fileSearch[] = $style_path; // First check current template - $fileSearch[] = $mx_user->cloned_template_name; // Then check Cloned template - $fileSearch[] = $moduleDefault; // Finally check Default template - $fileSearch[] = './'; // Compatibility with primitive modules - - $this->files[$handle] = $this->doFileSearch($fileSearch, $filename3, $filename2, 'templates/', $module_root_path); - } - } - - - // creating cache filename - if($can_cache != '') - { - $this->files_cache2[$handle] = $this->make_filename_cache($this->files[$handle]); - if(@file_exists($this->files_cache2[$handle])) - { - $this->files_cache[$handle] = $this->files_cache2[$handle]; - } - } - // checking if tpl and/or php file exists - if(empty($this->files_cache[$handle]) && !@file_exists($this->files[$handle])) - { - // trying to load alternative filename (usually subSilver) - if(!empty($this->tpldef) && !empty($this->tpl) && ($this->tpldef !== $this->tpl)) - { - $this->files[$handle] = ''; - // save old configuration - $root = $this->root; - $tpl_name = $this->tpl; - // set temporary configuration - $this->root = $this->tpldir . $this->tpldef; - $this->tpl = $this->tpldef; - // recursively run set_filename - $res = $this->set_filename($handle, $filename, $xs_include, $quiet); - // restore old configuration - $this->root = $root; - $this->tpl = $tpl_name; - return $res; - } - if($quiet) - { - return false; - } - if($xs_include) - { - if($board_config['xs_warn_includes']) - { - die('Template->make_filename(): Error - included template file not found: ' . $filename); - } - return false; - } - else - { - die('Template->make_filename(): Error - template file not found: ' . $filename); - } - } - // checking if we should recompile cache - if(!empty($this->files_cache[$handle]) && !empty($board_config['xs_auto_recompile'])) - { - $cache_time = @filemtime($this->files_cache[$handle]); - if(@filemtime($this->files[$handle]) > $cache_time || $board_config['xs_template_time'] > $cache_time) - { - // file was changed. don't use cache file (will be recompled if configuration allowes it) - $this->files_cache[$handle] = ''; - } - } - return true; - } } // class mx_Template --- 379,382 ---- *************** *** 576,580 **** // ! // Clean up and ensure we are using mxp internal lang format // $board_config['phpbb_lang'] = $board_config['default_lang']; // Handy switch --- 485,489 ---- // ! // Clean up and ensure we are using mxp internal (long) lang format // $board_config['phpbb_lang'] = $board_config['default_lang']; // Handy switch *************** *** 582,585 **** --- 491,495 ---- $this->data['user_lang'] = phpBB2::phpbb_ltrim(basename(phpBB2::phpbb_rtrim($this->decode_lang($this->data['user_lang']))), "'"); + //if ( $this->data['session_logged_in'] ) // Old code if ( $this->data['user_id'] != ANONYMOUS ) { *************** *** 689,693 **** // Core Main Translation after shared phpBB keys so we can overwrite some settings ! require($mx_root_path . "language/lang_" . $this->lang['default_lang'] . "/lang_main.$phpEx"); // --- 599,603 ---- // Core Main Translation after shared phpBB keys so we can overwrite some settings ! include($mx_root_path . 'language/lang_' . $this->lang['default_lang'] . '/lang_main.' . $phpEx); // |