|
From: Florin C B. <ory...@us...> - 2014-07-10 01:04:54
|
Update of /cvsroot/mxbb/core/includes In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv12279 Modified Files: mx_functions_style.php Log Message: Index: mx_functions_style.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_style.php,v retrieving revision 1.143 retrieving revision 1.144 diff -C2 -d -r1.143 -r1.144 *** mx_functions_style.php 7 Jul 2014 20:36:52 -0000 1.143 --- mx_functions_style.php 10 Jul 2014 01:04:52 -0000 1.144 *************** *** 870,874 **** * Init Portal style */ ! if (defined('IN_ADMIN')) { $init_style = $portal_config['default_admin_style']; --- 870,874 ---- * Init Portal style */ ! if ( defined('IN_ADMIN') ) { $init_style = $portal_config['default_admin_style']; *************** *** 896,900 **** if ( $theme = $this->_setup_style($style) ) { ! setcookie('style', $style, (time() + 21600), $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); return; } --- 896,900 ---- if ( $theme = $this->_setup_style($style) ) { ! setcookie('style', $style, (time()+21600), $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); return; } *************** *** 908,914 **** { $style = isset($_GET['demo_theme']) ? intval($_GET['demo_theme']) : intval($_COOKIE['demo_theme']); ! if ($theme = $this->_setup_style($style)) { ! setcookie('demo_theme', $style, (time() + 21600), $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); return; } --- 908,914 ---- { $style = isset($_GET['demo_theme']) ? intval($_GET['demo_theme']) : intval($_COOKIE['demo_theme']); ! if ( $theme = $this->_setup_style($style) ) { ! setcookie('demo_theme', $style, (time()+21600), $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); return; } *************** *** 917,921 **** { $init_style = !$mx_request_vars->is_empty_request('demostyle') ? phpBB3::request_var('demostyle', '') : phpBB3::request_var('style', ''); - if (intval($init_style) == 0) { --- 917,920 ---- *************** *** 1009,1018 **** $init_override = 1; } ! // Setup MXP Style $user_style = false; if (!$init_override) { ! if ($this->data['user_id'] != ANONYMOUS && $this->data['user_style'] > 0) { $user_style = $mx_request_vars->post('user_style', MX_TYPE_INT, $this->data['user_style']); --- 1008,1018 ---- $init_override = 1; } ! // // Setup MXP Style + // $user_style = false; if (!$init_override) { ! if ( $this->data['user_id'] != ANONYMOUS && $this->data['user_style'] > 0 ) { $user_style = $mx_request_vars->post('user_style', MX_TYPE_INT, $this->data['user_style']); *************** *** 1020,1024 **** } $init_style = $mx_request_vars->post('default_style', MX_TYPE_INT, $init_style); ! $theme = $this->_setup_style($init_style, $user_style); } --- 1020,1024 ---- } $init_style = $mx_request_vars->post('default_style', MX_TYPE_INT, $init_style); ! $theme = $this->_setup_style($init_style, $user_style); } *************** *** 1080,1084 **** break; } - if ( !($result = $db->sql_query_limit($sql, 1)) ) { --- 1080,1083 ---- *************** *** 1089,1096 **** { mx_message_die(CRITICAL_ERROR, "Could not get MX-Publisher style data for themes_id [$init_style]"); ! } $db->sql_freeresult($result); } ! /* * Init class settings --- 1088,1096 ---- { mx_message_die(CRITICAL_ERROR, "Could not get MX-Publisher style data for themes_id [$init_style]"); ! } ! $db->sql_freeresult($result); } ! /* * Init class settings *************** *** 1133,1137 **** */ $template_config_row = $this->_load_template_config(); ! $row['template_copy'] = $template_config_row['template_copy']; $row['cloned_template_name'] = $template_config_row['cloned_template']; --- 1133,1137 ---- */ $template_config_row = $this->_load_template_config(); ! $row['template_copy'] = $template_config_row['template_copy']; $row['cloned_template_name'] = $template_config_row['cloned_template']; *************** *** 1145,1149 **** $this->cloned_current_template_path = !empty($this->cloned_template_name) ? $this->template_path . $this->cloned_template_name : ''; $this->cloned_style_phpbb_path = !empty($this->cloned_template_name) ? $this->style_path . $this->cloned_template_name : ''; //new ! switch (PORTAL_BACKEND) { --- 1145,1150 ---- $this->cloned_current_template_path = !empty($this->cloned_template_name) ? $this->template_path . $this->cloned_template_name : ''; $this->cloned_style_phpbb_path = !empty($this->cloned_template_name) ? $this->style_path . $this->cloned_template_name : ''; //new ! ! switch (PORTAL_BACKEND) { *************** *** 1173,1177 **** } } - /* * Load images for example for --- 1174,1177 ---- *************** *** 1183,1188 **** $this->_load_phpbb_images(); $this->_load_mxbb_images(); ! break; ! case 'internal': case 'smf2': --- 1183,1187 ---- $this->_load_phpbb_images(); $this->_load_mxbb_images(); ! break; case 'internal': case 'smf2': *************** *** 1193,1199 **** case 'rhea': $this->_load_mxbb_images(); ! break; ! } ! // Load backend specific style defs. $this->setup_style(); --- 1192,1197 ---- case 'rhea': $this->_load_mxbb_images(); ! break; ! } // Load backend specific style defs. $this->setup_style(); *************** *** 1450,1455 **** @define('TEMPLATE_CONFIG', true); } ! /** ! * Since we have no current Template Config file, try the cloned template instead /**/ else if (@file_exists($phpbb_root_path . $this->style_path . $this->cloned_template_name . "/imageset" )) --- 1448,1453 ---- @define('TEMPLATE_CONFIG', true); } ! // ! // Since we have no current Template Config file, try the cloned template instead /**/ else if (@file_exists($phpbb_root_path . $this->style_path . $this->cloned_template_name . "/imageset" )) *************** *** 1466,1476 **** @define('TEMPLATE_CONFIG', file_exists($phpbb_root_path . $current_template_phpbb_images . '/imageset.cfg') ? $phpbb_root_path . $current_template_phpbb_images . '/imageset.cfg' : false); } - /** - * Last attempt, use default template intead /**/ ! else if (@file_exists($phpbb_root_path . $this->style_path . $this->default_style_name . "/imageset")) { ! $cfg_data_imageset_data = phpBB3::parse_cfg_file("{$phpbb_root_path}styles/{$this->default_style_name}/imageset/{$this->img_lang}/imageset.cfg"); ! $template_name = $this->default_template_name; $default_style_name = $this->default_style_name; --- 1464,1474 ---- @define('TEMPLATE_CONFIG', file_exists($phpbb_root_path . $current_template_phpbb_images . '/imageset.cfg') ? $phpbb_root_path . $current_template_phpbb_images . '/imageset.cfg' : false); } /**/ ! // Last attempt, use default template intead ! /**/ ! else if (@file_exists($phpbb_root_path . $this->style_path . $this->default_style_name . "/imageset" )) { ! $cfg_data_imageset_data = phpBB3::parse_cfg_file("{$phpbb_root_path}styles/{$this->default_template_name}/imageset/{$this->img_lang}/imageset.cfg"); ! $template_name = $this->default_template_name; $default_style_name = $this->default_style_name; *************** *** 1483,1487 **** } - /**/ foreach ($cfg_data_imageset_data as $image_name => $value) { --- 1481,1484 ---- *************** *** 1507,1520 **** { $image_name = substr($image_name, 4); ! ! //$image_ary[] = array( ! // 'image_name' => (string) $image_name, ! // 'image_filename' => (string) $image_filename, ! // 'image_height' => (int) $image_height, ! // 'image_width' => (int) $image_width, ! // 'imageset_id' => (int) $this->theme['imageset_id'], ! // 'image_lang' => (string) $this->img_lang, ! //); ! //Here we overwrite phpBB3 images names from the template configuration file with images file names from database //$phpbb_images[$image_name] = $image_filename; --- 1504,1517 ---- { $image_name = substr($image_name, 4); ! /* ! $image_ary[] = array( ! 'image_name' => (string) $image_name, ! 'image_filename' => (string) $image_filename, ! 'image_height' => (int) $image_height, ! 'image_width' => (int) $image_width, ! 'imageset_id' => (int) $this->theme['imageset_id'], ! 'image_lang' => (string) $this->img_lang, ! ); ! */ //Here we overwrite phpBB3 images names from the template configuration file with images file names from database //$phpbb_images[$image_name] = $image_filename; *************** *** 1522,1528 **** //$images = is_array($images) ? array_merge($phpbb_images, $images) : $phpbb_images; } ! } ! /**/ //Here we overwrite phpBB images from the template configuration file with images from database $images['icon_quote'] = $this->images('img_icon_post_quote'); --- 1519,1525 ---- //$images = is_array($images) ? array_merge($phpbb_images, $images) : $phpbb_images; } ! } + /**/ //Here we overwrite phpBB images from the template configuration file with images from database $images['icon_quote'] = $this->images('img_icon_post_quote'); *************** *** 1741,1745 **** foreach( $value as $key2 => $val2 ) { ! $images[$key][$key2] = str_replace(PHPBB_URL . PHPBB_URL, PHPBB_URL, PHPBB_URL . $val2); } } --- 1738,1742 ---- foreach( $value as $key2 => $val2 ) { ! $images[$key][$key2] = str_replace(PORTAL_URL . PHPBB_URL, PHPBB_URL, $val2); } } *************** *** 1747,1751 **** { $images[$key] = str_replace('{LANG}', 'lang_' . $img_lang, $value); ! $images[$key] = str_replace(PHPBB_URL . PHPBB_URL, PHPBB_URL, PHPBB_URL . $images[$key]); } } --- 1744,1748 ---- { $images[$key] = str_replace('{LANG}', 'lang_' . $img_lang, $value); ! $images[$key] = str_replace(PORTAL_URL . PHPBB_URL, PHPBB_URL, $images[$key]); } } *************** *** 1858,1865 **** } ! // ! // Load MX-Publisher Template configuration data ! // - First try current template ! // $current_template_path = $current_template_path_d = $module_root_path . $this->current_template_path; $cloned_template_path = $cloned_template_path_d = $module_root_path . $this->cloned_current_template_path; --- 1855,1862 ---- } ! /* ! * Load MX-Publisher Template configuration data ! * - First try current template ! */ $current_template_path = $current_template_path_d = $module_root_path . $this->current_template_path; $cloned_template_path = $cloned_template_path_d = $module_root_path . $this->cloned_current_template_path; *************** *** 1952,1956 **** --- 1949,1955 ---- } + // // What template is the module using? + // $module_key = !empty($module_root_path) ? $module_root_path : '_core'; $this->template_names[$module_key] = $template_name; *************** *** 2177,2182 **** $this->_load_module_style(); } ! // Reset custom module default style, once used. if (!empty($this->default_module_style)) { --- 2176,2183 ---- $this->_load_module_style(); } ! ! // // Reset custom module default style, once used. + // if (!empty($this->default_module_style)) { |