|
From: Florin C B. <ory...@us...> - 2013-07-07 02:13:54
|
Update of /cvsroot/mxbb/core/includes In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21325 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.137 retrieving revision 1.138 diff -C2 -d -r1.137 -r1.138 *** mx_functions_style.php 2 Jul 2013 07:01:09 -0000 1.137 --- mx_functions_style.php 7 Jul 2013 02:13:52 -0000 1.138 *************** *** 1060,1063 **** --- 1060,1068 ---- $this->style = $style; // To main style init. Should be correct and valid. + // What template to use? + $template = new mx_Template($mx_root_path . $this->template_path . $this->template_name); + //todo@ remove redefination + @define('TEMPLATE_ROOT_PATH', $this->template_path . $this->template_name . '/'); + /* * Load template settings *************** *** 1069,1072 **** --- 1074,1086 ---- $row['cloned_template_name'] = $template_config_row['cloned_template']; $row['border_graphics'] = $template_config_row['border_graphics']; + + /* + * Load template settings + * - pass cloned template name to $theme + */ + $this->cloned_template_name = $row['cloned_template_name']; + $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) *************** *** 1084,1096 **** } - $this->cloned_template_name = $row['cloned_template_name']; - $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 - - // What template to use? - $template = new mx_Template($mx_root_path . $this->template_path . $this->template_name); - //todo@ remove redefination - @define('TEMPLATE_ROOT_PATH', $this->template_path . $this->template_name . '/'); - // Get missing theme colors from *.cfg file (sort of desperate fix) foreach($row as $key => $value) --- 1098,1101 ---- *************** *** 1101,1110 **** } } - // Load images - $this->_load_phpbb_images(); - $this->_load_mxbb_images(); - - // Load backend specific style defs. - $this->setup_style(); return $row; } --- 1106,1109 ---- *************** *** 1176,1180 **** function _load_template_config() { ! global $board_config, $template, $phpbb_root_path, $mx_root_path; //unset($GLOBALS['MX_TEMPLATE_CONFIG']); --- 1175,1179 ---- function _load_template_config() { ! global $board_config, $images, $theme, $template, $phpbb_root_path, $mx_root_path; //unset($GLOBALS['MX_TEMPLATE_CONFIG']); *************** *** 1187,1190 **** --- 1186,1203 ---- $template_name = $template_name_d = $this->template_name; + /* + * Load phpBB3 images + **/ + switch (PORTAL_BACKEND) + { + case 'internal': + case 'phpbb2': + $phpbb_images = $images; + break; + case 'phpbb3': + $phpbb_images = $this->_load_phpbb_images(); + break; + } + $images = (is_array($phpbb_images) && is_array($images)) ? array_merge($phpbb_images, @$images) : (is_array($images) ? $images: $phpbb_images); $template_config_filename = $mx_root_path . $this->current_template_path . '/' . $this->template_name . '.cfg'; *************** *** 1196,1220 **** print('template config filename ' . $template_config_filename . ' couldn\'t be opened.'); } - /* */ - // We include common temlate config file here to not load it every time a module template config file is included - /* - $this->theme['body_bgcolor'] = $theme['body_bgcolor']; - $this->theme['body_text'] = $theme['body_text']; - $this->theme['body_link'] = $theme['body_link']; - $this->theme['body_vlink'] = $theme['body_vlink']; - $this->theme['body_alink'] = $theme['body_alink']; - $this->theme['body_hlink'] = $theme['body_hlink']; - $this->theme['tr_color1'] = $theme['tr_color1']; // row1 - $this->theme['tr_color2'] = $theme['tr_color2']; // row2 - $this->theme['tr_color3'] = $theme['tr_color3']; // row3 - $this->theme['th_color1'] = $theme['th_color1']; // bodyline border color - $this->theme['th_color2'] = $theme['th_color2']; // forumline border color - $this->theme['th_color3'] = $theme['th_color3']; // boxes border color - $this->theme['td_color1'] = $theme['td_color1']; // code/quote boxes background - $this->theme['td_color2'] = $theme['td_color2']; // post box background - $this->theme['fontface1'] = $theme['fontface1']; - $this->theme['fontcolor1'] = $theme['fontcolor1']; // Main font color - $this->theme['fontcolor2'] = $theme['fontcolor2']; - */ $this->theme = (is_array($this->theme) && is_array($theme)) ? array_merge($this->theme, @$theme) : (is_array($theme) ? $theme: $this->theme); --- 1209,1212 ---- *************** *** 1279,1286 **** $current_template_phpbb_images = $current_template_path . $this->template_name . "/images"; $template_name = $this->template_name; ! @include($phpbb_root_path . $this->current_template_path . '/' . $this->template_name . '.cfg'); } ! /* * Since we have no current Template Config file, try the cloned template instead --- 1271,1278 ---- $current_template_phpbb_images = $current_template_path . $this->template_name . "/images"; $template_name = $this->template_name; ! @include($phpbb_root_path . $this->current_template_path . '/' . $this->template_name . '.cfg'); } ! /* * Since we have no current Template Config file, try the cloned template instead *************** *** 1291,1295 **** $current_template_phpbb_images = $current_template_path . "/images"; $template_name = $this->cloned_template_name; ! @include($phpbb_root_path . $this->cloned_current_template_path . '/' . $this->cloned_template_name . '.cfg'); } --- 1283,1287 ---- $current_template_phpbb_images = $current_template_path . "/images"; $template_name = $this->cloned_template_name; ! @include($phpbb_root_path . $this->cloned_current_template_path . '/' . $this->cloned_template_name . '.cfg'); } *************** *** 1335,1338 **** --- 1327,1331 ---- //$this->template_name = $this->theme['imageset_path']; //trigger_error("Could not get style data: $this->template_name", E_USER_ERROR); + // // Load phpBB Template configuration data *************** *** 1342,1378 **** { $cfg_data_imageset_data = phpBB3::parse_cfg_file("{$phpbb_root_path}styles/{$this->template_name}/imageset/{$this->img_lang}/imageset.cfg"); ! foreach ($cfg_data_imageset_data as $image_name => $value) ! { ! if (strpos($value, '*') !== false) ! { ! if (substr($value, -1, 1) === '*') ! { ! list($image_filename, $image_height) = explode('*', $value); ! $image_width = 0; ! } ! else ! { ! list($image_filename, $image_height, $image_width) = explode('*', $value); ! } ! } ! else ! { ! $image_filename = $value; ! $image_height = $image_width = 0; ! } ! ! if (strpos($image_name, 'img_') === 0 && $image_filename) ! { ! $image_name = substr($image_name, 4); ! $sql_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, ! ); ! } ! } $template_name = $this->template_name; $default_style_name = $this->default_style_name; --- 1335,1339 ---- { $cfg_data_imageset_data = phpBB3::parse_cfg_file("{$phpbb_root_path}styles/{$this->template_name}/imageset/{$this->img_lang}/imageset.cfg"); ! $template_name = $this->template_name; $default_style_name = $this->default_style_name; *************** *** 1389,1394 **** else if (@file_exists($phpbb_root_path . $this->style_path . $this->cloned_template_name . "/imageset" )) { $template_name = $this->cloned_template_name; ! $default_style_name = $this->default_style_name; $cloned_style_phpbb_path = $this->cloned_style_phpbb_path = $this->style_path . $this->cloned_template_name; //new --- 1350,1357 ---- else if (@file_exists($phpbb_root_path . $this->style_path . $this->cloned_template_name . "/imageset" )) { + $cfg_data_imageset_data = phpBB3::parse_cfg_file("{$phpbb_root_path}styles/{$this->cloned_template_name}/imageset/{$this->img_lang}/imageset.cfg"); + $template_name = $this->cloned_template_name; ! $default_style_name = $this->default_style_name; $cloned_style_phpbb_path = $this->cloned_style_phpbb_path = $this->style_path . $this->cloned_template_name; //new *************** *** 1403,1406 **** --- 1366,1371 ---- 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; *************** *** 1411,1457 **** //@include($phpbb_root_path . $this->default_current_template_path . '/' . $this->default_template_name . '.cfg'); @define('TEMPLATE_CONFIG', file_exists($phpbb_root_path . $current_template_phpbb_images . '/imageset.cfg') ? $phpbb_root_path . $current_template_phpbb_images . '/imageset.cfg' : false); ! } ! /**/ //Here we overwrite phpBB images from the template configuration file with images from database ! $images['icon_quote'] = $this->images('icon_quote'); ! $images['icon_edit'] = $this->images('icon_edit'); ! $images['icon_search'] = $this->images('icon_search'); ! $images['icon_profile'] = $this->images('icon_profile'); ! $images['icon_pm'] = $this->images('icon_pm'); ! $images['icon_email'] = $this->images('icon_email'); ! $images['icon_delpost'] = $this->images('icon_delpost'); ! $images['icon_ip'] = $this->images('icon_ip'); ! $images['icon_www'] = $this->images('icon_www'); ! $images['icon_icq'] = $this->images('icon_icq'); ! $images['icon_aim'] = $this->images('icon_aim'); ! $images['icon_yim'] = $this->images('icon_yim'); ! $images['icon_msnm'] = $this->images('icon_msnm'); ! $images['icon_minipost'] = $this->images('icon_minipost'); ! $images['icon_gotopost'] = $this->images('icon_gotopost'); ! $images['icon_minipost_new'] = $this->images('icon_minipost_new'); ! $images['icon_latest_reply'] = $images['icon_topic_latest'] = $this->images('icon_topic_latest'); ! $images['icon_newest_reply'] = $this->images('icon_newest_reply'); ! ! $images['forum'] = $this->images('forum'); ! $images['forums'] = $this->images('forums'); ! $images['forum_new'] = $this->images('forum_new'); ! $images['forum_locked'] = $this->images('forum_locked'); ! $images['folder'] = $images['topic_read'] = $this->images('topic_read'); ! $images['folder_new'] = $images['topic_unread'] = $this->images('topic_unread'); ! $images['folder_hot'] = $images['topic_hot'] = $this->images('topic_hot'); ! $images['folder_hot_new'] = $images['topic_hot_unread'] = $this->images('topic_hot_unread'); ! $images['folder_locked'] = $images['topic_locked'] = $this->images('topic_locked'); ! $images['folder_locked_new'] = $images['topic_locked_unread'] = $this->images('topic_locked_unread'); ! $images['folder_sticky'] = $images['topic_sticky'] = $this->images('topic_sticky'); ! $images['folder_sticky_new'] = $images['topic_sticky_unread'] = $this->images('topic_sticky_unread'); ! $images['folder_announce'] = $images['topic_announce'] = $this->images('topic_announce'); ! $images['folder_announce_new'] = $images['topic_announce_unread'] = $this->images('topic_announce_unread'); ! $images['post_new'] = $this->images('post_new'); ! $images['post_locked'] = $this->images('post_locked'); ! $images['reply_new'] = $this->images('reply_new'); ! $images['reply_locked'] = $this->images('reply_locked'); $images['pm_inbox'] = $this->images('pm_inbox'); $images['pm_outbox'] = $this->images('pm_outbox'); --- 1376,1464 ---- //@include($phpbb_root_path . $this->default_current_template_path . '/' . $this->default_template_name . '.cfg'); @define('TEMPLATE_CONFIG', file_exists($phpbb_root_path . $current_template_phpbb_images . '/imageset.cfg') ? $phpbb_root_path . $current_template_phpbb_images . '/imageset.cfg' : false); ! } ! ! foreach ($cfg_data_imageset_data as $image_name => $value) ! { ! if (strpos($value, '*') !== false) ! { ! if (substr($value, -1, 1) === '*') ! { ! list($image_filename, $image_height) = explode('*', $value); ! $image_width = 0; ! } ! else ! { ! list($image_filename, $image_height, $image_width) = explode('*', $value); ! } ! } ! else ! { ! $image_filename = $value; ! $image_height = $image_width = 0; ! } ! ! if (strpos($image_name, 'img_') === 0 && $image_filename) ! { ! $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; ! $images[$image_name] = $this->images($image_name); ! //$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'); ! $images['icon_edit'] = $this->images('img_icon_post_edit'); ! $images['icon_search'] = $this->images('img_icon_user_search'); ! $images['icon_profile'] = $this->images('img_icon_user_profile'); ! $images['icon_pm'] = $this->images('img_icon_contact_pm'); ! $images['icon_email'] = $this->images('img_icon_contact_email'); ! $images['icon_delpost'] = $this->images('img_icon_post_delete'); ! //$images['icon_ip'] = $this->images('icon_ip'); ! $images['icon_www'] = $this->images('img_icon_contact_www'); ! $images['icon_icq'] = $this->images('img_icon_contact_icq'); ! $images['icon_aim'] = $this->images('img_icon_contact_aim'); ! $images['icon_yim'] = $this->images('img_icon_contact_yahoo'); ! $images['icon_msnm'] = $this->images('img_icon_contact_msnm'); ! $images['icon_minipost'] = $this->images('img_icon_minipost'); ! $images['icon_gotopost'] = $this->images('img_icon_gotopost'); ! $images['icon_minipost_new'] = $this->images('img_icon_minipost_new'); ! $images['icon_latest_reply'] = $images['img_icon_topic_latest'] = $this->images('img_icon_topic_latest'); ! $images['icon_newest_reply'] = $this->images('img_icon_newest_reply'); ! $images['forum'] = $this->images('img_forum_read'); ! $images['forums'] = $this->images('img_forum_read_subforum'); ! $images['forum_new'] = $this->images('img_forum_unread'); ! $images['forum_locked'] = $this->images('img_forum_read_locked'); ! $images['folder'] = $images['topic_read'] = $this->images('img_topic_read'); ! $images['folder_new'] = $images['topic_unread'] = $this->images('img_topic_unread'); ! $images['folder_hot'] = $images['topic_hot'] = $this->images('img_topic_read_hot'); ! $images['folder_hot_new'] = $images['topic_hot_unread'] = $this->images('img_topic_unread_hot'); ! $images['folder_locked'] = $images['topic_locked'] = $this->images('img_topic_unread_locked'); ! $images['folder_locked_new'] = $images['topic_locked_unread'] = $this->images('img_topic_locked_unread'); ! $images['folder_sticky'] = $images['topic_sticky'] = $this->images('img_topic_read_mine'); ! $images['folder_sticky_new'] = $images['topic_sticky_unread'] = $this->images('img_topic_unread_mine'); ! $images['folder_announce'] = $images['topic_announce'] = $this->images('img_announce_read'); ! $images['folder_announce_new'] = $images['topic_announce_unread'] = $this->images('img_announce_unread'); + $images['post_new'] = $this->images('img_button_topic_new'); + $images['post_locked'] = $this->images('img_button_topic_locked'); + $images['reply_new'] = $this->images('img_button_topic_reply'); + $images['reply_locked'] = $this->images('img_icon_post_target_unread'); + + /* $images['pm_inbox'] = $this->images('pm_inbox'); $images['pm_outbox'] = $this->images('pm_outbox'); *************** *** 1466,1470 **** $images['pm_new_msg'] = $this->images('pm_new_msg'); $images['pm_no_new_msg'] = $this->images('pm_no_new_msg'); ! $images['Topic_watch'] = $this->images('Topic_watch'); $images['topic_un_watch'] = $this->images('topic_un_watch'); --- 1473,1477 ---- $images['pm_new_msg'] = $this->images('pm_new_msg'); $images['pm_no_new_msg'] = $this->images('pm_no_new_msg'); ! $images['Topic_watch'] = $this->images('Topic_watch'); $images['topic_un_watch'] = $this->images('topic_un_watch'); *************** *** 1474,1487 **** $images['topic_mod_move'] = $this->images('topic_mod_move'); $images['topic_mod_delete'] = $this->images('topic_mod_delete'); ! $images['voting_graphic'] = $this->images('voting_graphic'); ! @define('TEMPLATE_CONFIG', TRUE); // We include common temlate config file here to not load it every time a module template config file is included //$this->theme = is_array($this->theme) ? array_merge($this->theme, $theme) : $theme; ! //$this->theme = &$theme; ! break; } /* * We have no template to use - die --- 1481,1496 ---- $images['topic_mod_move'] = $this->images('topic_mod_move'); $images['topic_mod_delete'] = $this->images('topic_mod_delete'); ! $images['voting_graphic'] = $this->images('voting_graphic'); ! /**/ ! @define('TEMPLATE_CONFIG', TRUE); // We include common temlate config file here to not load it every time a module template config file is included //$this->theme = is_array($this->theme) ? array_merge($this->theme, $theme) : $theme; ! //$this->theme = &$theme; ! break; } + /* * We have no template to use - die *************** *** 1491,1497 **** mx_message_die(CRITICAL_ERROR, "Could not open phpBB $this->template_name template config file", '', __LINE__, __FILE__); } ! $img_lang = ( file_exists($phpbb_root_path . $this->current_template_path . '/images/lang_' . $this->encode_lang($this->lang['default_lang'])) ) ? $this->encode_lang($this->lang['default_lang']) : 'english'; ! /* * Import phpBB Graphics, prefix with PHPBB_URL, and apply LANG info --- 1500,1506 ---- mx_message_die(CRITICAL_ERROR, "Could not open phpBB $this->template_name template config file", '', __LINE__, __FILE__); } ! $img_lang = ( file_exists($phpbb_root_path . $this->current_template_path . '/images/lang_' . $this->encode_lang($this->lang['default_lang'])) ) ? $this->encode_lang($this->lang['default_lang']) : 'english'; ! /* * Import phpBB Graphics, prefix with PHPBB_URL, and apply LANG info *************** *** 1511,1515 **** $images[$key] = str_replace(PHPBB_URL . PHPBB_URL, PHPBB_URL, PHPBB_URL . $images[$key]); } ! } } --- 1520,1525 ---- $images[$key] = str_replace(PHPBB_URL . PHPBB_URL, PHPBB_URL, PHPBB_URL . $images[$key]); } ! } ! return $images; } *************** *** 1524,1539 **** global $images, $board_config, $template, $phpbb_root_path, $mx_root_path, $theme, $current_module_images; global $mx_block, $mx_user, $phpEx; ! //This will keep loaded images $mx3_images = $images; ! //unset($GLOBALS['MX_TEMPLATE_CONFIG']); $mx_template_config = false; ! /* * Load module cfg */ $moduleCfgFile = str_replace('/', '', str_replace('modules/', '', $mx_block->module_root_path)); ! switch (PORTAL_BACKEND) { --- 1534,1549 ---- global $images, $board_config, $template, $phpbb_root_path, $mx_root_path, $theme, $current_module_images; global $mx_block, $mx_user, $phpEx; ! //This will keep loaded images $mx3_images = $images; ! //unset($GLOBALS['MX_TEMPLATE_CONFIG']); $mx_template_config = false; ! /* * Load module cfg */ $moduleCfgFile = str_replace('/', '', str_replace('modules/', '', $mx_block->module_root_path)); ! switch (PORTAL_BACKEND) { *************** *** 1542,1687 **** break; case 'phpbb2': ! /* ! * Load phpBB Template configuration data ! * - First try current template ! */ ! if ( file_exists( $phpbb_root_path . $this->current_template_path . "/images" ) ) ! { ! $current_template_path = $current_template_phpbb_path = $this->current_template_path; ! $current_template_phpbb_images = "styles/" . $this->template_name . "/images"; ! $template_name = $this->template_name; ! @include($phpbb_root_path . $this->current_template_path . '/' . $this->template_name . '.cfg'); ! } ! /* ! * Since we have no current Template Config file, try the cloned template instead ! */ ! if ( file_exists( $phpbb_root_path . $this->cloned_current_template_path . "/images" ) && !defined('TEMPLATE_CONFIG') ) ! { ! $current_template_path = $current_template_phpbb_path = $this->cloned_current_template_path; ! $current_template_phpbb_images = $current_template_path . "/images"; ! $template_name = $this->cloned_template_name; ! @include($phpbb_root_path . $this->cloned_current_template_path . '/' . $this->cloned_template_name . '.cfg'); ! } ! /* ! * Last attempt, use default template intead ! */ ! if ( file_exists( $phpbb_root_path . $this->default_current_template_path . "/images" ) && !defined('TEMPLATE_CONFIG') ) ! { ! $current_template_path = $current_template_phpbb_path = $this->default_current_template_path; ! $current_template_phpbb_images = $this->default_current_template_path . "/images"; ! $template_name = $this->default_template_name; ! ! @include($phpbb_root_path . $this->default_current_template_path . '/' . $this->default_template_name . '.cfg'); ! } ! break; case 'phpbb3': ! /* ! * Load phpBB Template configuration data ! * - First prepare the variables ! */ ! if (!$this->template_name) ! { ! trigger_error("Could not get style data: $this->template_name", E_USER_ERROR); ! } ! if ($this->data['session_logged_in']) ! { ! $this->lang_name = (file_exists($phpbb_root_path . 'language/' . $this->encode_lang($this->data['user_lang']) . "/common.$phpEx")) ? $this->encode_lang($this->data['user_lang']) : ((file_exists($phpbb_root_path . 'language/' . $this->encode_lang($this->lang['default_lang']) . "/common.$phpEx")) ? $this->encode_lang($this->lang['default_lang']) : 'en'); ! $this->lang_path = $phpbb_root_path . 'language/' . $this->lang_name . '/'; ! ! $this->date_format = $this->data['user_dateformat']; ! $this->timezone = $this->data['user_timezone'] * 3600; ! $this->dst = $this->data['user_dst'] * 3600; ! } ! else ! { ! $this->lang_name = (file_exists($phpbb_root_path . 'language/' . $this->encode_lang($this->lang['default_lang']) . "/common.$phpEx")) ? $this->encode_lang($this->lang['default_lang']) : 'en'; ! $this->lang_path = $phpbb_root_path . 'language/' . $this->lang_name . '/'; ! $this->date_format = $board_config['default_dateformat']; ! $this->timezone = $board_config['board_timezone'] * 3600; ! $this->dst = $board_config['board_dst'] * 3600; ! } ! $this->img_lang = (@file_exists($phpbb_root_path . 'styles/' . $this->theme['imageset_path'] . '/imageset/' . $this->lang_name)) ? $this->lang_name : $this->encode_lang($board_config['default_lang']); ! /* ! * Load phpBB Template configuration data ! * - Try current template ! */ ! if (file_exists("{$phpbb_root_path}styles/{$this->template_name}/imageset/{$this->img_lang}/imageset.cfg")) ! { ! $cfg_data_imageset_data = phpBB3::parse_cfg_file("{$phpbb_root_path}styles/{$this->template_name}/imageset/{$this->img_lang}/imageset.cfg"); ! foreach ($cfg_data_imageset_data as $image_name => $value) ! { ! if (strpos($value, '*') !== false) ! { ! if (substr($value, -1, 1) === '*') ! { ! list($image_filename, $image_height) = explode('*', $value); ! $image_width = 0; ! } ! else ! { ! list($image_filename, $image_height, $image_width) = explode('*', $value); ! } ! } ! else ! { ! $image_filename = $value; ! $image_height = $image_width = 0; ! } ! ! if (strpos($image_name, 'img_') === 0 && $image_filename) ! { ! $image_name = substr($image_name, 4); ! $sql_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, ! ); ! } ! } ! ! $template_name = $this->template_name; ! $default_style_name = $this->default_style_name; ! ! $current_style_phpbb_path = $this->current_style_phpbb_path = $this->style_path . $this->template_name; //new ! $current_template_phpbb_path = $current_style_phpbb_path . "/templates"; ! $current_template_phpbb_images = @file_exists($phpbb_root_path . $current_style_phpbb_path . "/imageset") ? $current_style_phpbb_path. "/imageset" : (@file_exists($phpbb_root_path . $this->default_style2_name . "/imageset") ? $phpbb_root_path . $this->default_style2_name . "/imageset" : $phpbb_root_path . $this->default_template_name . "/imageset"); ! //@include($phpbb_root_path . $current_template_phpbb_images . '/imageset.cfg'); ! @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") && !defined('TEMPLATE_CONFIG') ) ! { ! $template_name = $this->cloned_template_name; ! $default_style_name = $this->default_style_name; ! ! $cloned_style_phpbb_path = $this->cloned_style_phpbb_path = $this->style_path . $this->cloned_template_name; //new ! $current_template_phpbb_path = $cloned_style_phpbb_path . "/templates"; ! $current_template_phpbb_images = @file_exists($phpbb_root_path . $cloned_style_phpbb_path . "/imageset") ? $this->style_path . $this->cloned_template_name . "/imageset" : (@file_exists($phpbb_root_path . $this->default_style2_name . "/imageset") ? $phpbb_root_path . $this->default_style2_name . "/imageset" : $phpbb_root_path . $this->default_template_name . "/imageset"); ! //@include($phpbb_root_path . $this->cloned_current_template_path . '/imageset.cfg'); ! @define('TEMPLATE_CONFIG', file_exists($phpbb_root_path . $current_template_phpbb_images . '/imageset.cfg') ? $phpbb_root_path . $current_template_phpbb_images . '/imageset.cfg' : false); ! //print_r($phpbb_root_path . $this->cloned_current_template_path . '/imageset.cfg'); ! } ! /** ! * Last attempt, use default template intead ! **/ ! else if ( @file_exists($phpbb_root_path . $this->style_path . $this->default_style_name . "/imageset") && !defined('TEMPLATE_CONFIG') ) ! { ! $template_name = $this->default_template_name; ! $default_style_name = $this->default_style_name; ! ! $default_style_phpbb_path = $this->default_style_phpbb_path = $this->style_path . $this->default_style_name; //new ! $current_template_phpbb_path = $default_style_phpbb_path . "/templates"; ! $current_template_phpbb_images = @file_exists($phpbb_root_path . $default_style_phpbb_path . "/imageset") ? $this->style_path . $this->default_style_name . "/imageset" : (@file_exists($phpbb_root_path . $this->default_style2_name . "/imageset") ? $phpbb_root_path . $this->default_style2_name . "/imageset" : $phpbb_root_path . $this->default_template_name . "/imageset"); ! //@include($phpbb_root_path . $this->default_current_template_path . '/' . $this->default_template_name . '.cfg'); ! @define('TEMPLATE_CONFIG', file_exists($phpbb_root_path . $current_template_phpbb_images . '/imageset.cfg') ? $phpbb_root_path . $current_template_phpbb_images . '/imageset.cfg' : false); ! //print_r($phpbb_root_path . $this->default_current_template_path . '/' . $this->default_template_name . '.cfg'); ! } /**/ // Here we overwrite phpBB images from the template configuration file with images from database --- 1552,1559 ---- break; case 'phpbb2': ! break; case 'phpbb3': ! /**/ // Here we overwrite phpBB images from the template configuration file with images from database *************** *** 1704,1713 **** $images['icon_latest_reply'] = $images['icon_topic_latest'] = $this->images('icon_topic_latest'); $images['icon_newest_reply'] = $this->images('icon_newest_reply'); ! $images['forum'] = $this->images('forum'); $images['forums'] = $this->images('forums'); $images['forum_new'] = $this->images('forum_new'); $images['forum_locked'] = $this->images('forum_locked'); ! $images['folder'] = $images['topic_read'] = $this->images('topic_read'); $images['folder_new'] = $images['topic_unread'] = $this->images('topic_unread'); --- 1576,1585 ---- $images['icon_latest_reply'] = $images['icon_topic_latest'] = $this->images('icon_topic_latest'); $images['icon_newest_reply'] = $this->images('icon_newest_reply'); ! $images['forum'] = $this->images('forum'); $images['forums'] = $this->images('forums'); $images['forum_new'] = $this->images('forum_new'); $images['forum_locked'] = $this->images('forum_locked'); ! $images['folder'] = $images['topic_read'] = $this->images('topic_read'); $images['folder_new'] = $images['topic_unread'] = $this->images('topic_unread'); *************** *** 1720,1729 **** $images['folder_announce'] = $images['topic_announce'] = $this->images('topic_announce'); $images['folder_announce_new'] = $images['topic_announce_unread'] = $this->images('topic_announce_unread'); ! $images['post_new'] = $this->images('post_new'); $images['post_locked'] = $this->images('post_locked'); $images['reply_new'] = $this->images('reply_new'); $images['reply_locked'] = $this->images('reply_locked'); ! $images['pm_inbox'] = $this->images('pm_inbox'); $images['pm_outbox'] = $this->images('pm_outbox'); --- 1592,1601 ---- $images['folder_announce'] = $images['topic_announce'] = $this->images('topic_announce'); $images['folder_announce_new'] = $images['topic_announce_unread'] = $this->images('topic_announce_unread'); ! $images['post_new'] = $this->images('post_new'); $images['post_locked'] = $this->images('post_locked'); $images['reply_new'] = $this->images('reply_new'); $images['reply_locked'] = $this->images('reply_locked'); ! $images['pm_inbox'] = $this->images('pm_inbox'); $images['pm_outbox'] = $this->images('pm_outbox'); *************** *** 1738,1742 **** $images['pm_new_msg'] = $this->images('pm_new_msg'); $images['pm_no_new_msg'] = $this->images('pm_no_new_msg'); ! $images['Topic_watch'] = $this->images('Topic_watch'); $images['topic_un_watch'] = $this->images('topic_un_watch'); --- 1610,1614 ---- $images['pm_new_msg'] = $this->images('pm_new_msg'); $images['pm_no_new_msg'] = $this->images('pm_no_new_msg'); ! $images['Topic_watch'] = $this->images('Topic_watch'); $images['topic_un_watch'] = $this->images('topic_un_watch'); *************** *** 1746,1753 **** $images['topic_mod_move'] = $this->images('topic_mod_move'); $images['topic_mod_delete'] = $this->images('topic_mod_delete'); ! ! $images['voting_graphic'] = $this->images('voting_graphic'); ! } ! // // Load MX-Publisher Template configuration data --- 1618,1626 ---- $images['topic_mod_move'] = $this->images('topic_mod_move'); $images['topic_mod_delete'] = $this->images('topic_mod_delete'); ! ! $images['voting_graphic'] = $this->images('voting_graphic'); ! /**/ ! } ! // // Load MX-Publisher Template configuration data *************** *** 1762,1766 **** //@define('MX_TEMPLATE_CONFIG', false); $mx_template_config = false; - if (@file_exists($mx_root_path . $module_root_path . $this->current_template_path . '/' . $template_name . '.cfg')) { --- 1635,1638 ---- *************** *** 1772,1776 **** include($mx_root_path . $module_root_path . $this->current_template_path . '/' . $moduleCfgFile . '.cfg'); } ! /* * Since we have no current Template Config file, try the cloned template instead --- 1644,1648 ---- include($mx_root_path . $module_root_path . $this->current_template_path . '/' . $moduleCfgFile . '.cfg'); } ! /* * Since we have no current Template Config file, try the cloned template instead *************** *** 1780,1791 **** $current_template_path = $module_root_path . $this->cloned_current_template_path; $template_name = $this->cloned_template_name; ! ! @require($mx_root_path . $module_root_path . $this->cloned_current_template_path . '/' . $template_name . '.cfg'); if (!$mx_template_config) { ! @require($mx_root_path . $module_root_path . $this->cloned_current_template_path . '/' . $moduleCfgFile . '.cfg'); } } ! /* * If use default template intead --- 1652,1663 ---- $current_template_path = $module_root_path . $this->cloned_current_template_path; $template_name = $this->cloned_template_name; ! ! @include($mx_root_path . $module_root_path . $this->cloned_current_template_path . '/' . $template_name . '.cfg'); if (!$mx_template_config) { ! @include($mx_root_path . $module_root_path . $this->cloned_current_template_path . '/' . $moduleCfgFile . '.cfg'); } } ! /* * If use default template intead *************** *** 1795,1820 **** $current_template_path = $module_root_path . $this->default_current_template_path; $template_name = $this->default_template_name; ! ! @require($mx_root_path . $module_root_path . $this->default_current_template_path . '/' . $template_name . '.cfg'); if (!$mx_template_config) { ! @require($mx_root_path . $module_root_path . $this->default_current_template_path . '/' . $moduleCfgFile . '.cfg'); } } ! // ! // If old version 2 module search for subSilver template intead ! // if (!$mx_template_config) { $template_name2 = 'subSilver'; ! $current_template_path = $module_root_path . $this->default_current_template_path; $template_name = $this->default_template_name; ! ! @require($mx_root_path . $module_root_path . $this->default_current_template_path . '/' . $template_name2 . '.cfg'); if (!$mx_template_config) { ! @require($mx_root_path . $module_root_path . $this->default_current_template_path . '/' . $moduleCfgFile . '.cfg'); } } --- 1667,1692 ---- $current_template_path = $module_root_path . $this->default_current_template_path; $template_name = $this->default_template_name; ! ! @include($mx_root_path . $module_root_path . $this->default_current_template_path . '/' . $template_name . '.cfg'); if (!$mx_template_config) { ! @include($mx_root_path . $module_root_path . $this->default_current_template_path . '/' . $moduleCfgFile . '.cfg'); } } ! /* ! * If old version 2 module search for subSilver template intead ! */ if (!$mx_template_config) { $template_name2 = 'subSilver'; ! $current_template_path = $module_root_path . $this->default_current_template_path; $template_name = $this->default_template_name; ! ! @include($mx_root_path . $module_root_path . $this->default_current_template_path . '/' . $template_name2 . '.cfg'); if (!$mx_template_config) { ! @include($mx_root_path . $module_root_path . $this->default_current_template_path . '/' . $moduleCfgFile . '.cfg'); } } *************** *** 1829,1833 **** $img_lang = ( file_exists($mx_root_path . $current_template_path . '/images/lang_' . $board_config['default_lang']) ) ? $board_config['default_lang'] : 'english'; ! while( list($key, $value) = @each($mx_images) ) { --- 1701,1705 ---- $img_lang = ( file_exists($mx_root_path . $current_template_path . '/images/lang_' . $board_config['default_lang']) ) ? $board_config['default_lang'] : 'english'; ! while( list($key, $value) = @each($mx_images) ) { *************** *** 1844,1848 **** } } ! // // What template is the module using? --- 1716,1720 ---- } } ! // // What template is the module using? *************** *** 1850,1854 **** $module_key = !empty($module_root_path) ? $module_root_path : '_core'; $this->template_names[$module_key] = $template_name; ! //This will keep loaded images $images = &$mx3_images; --- 1722,1726 ---- $module_key = !empty($module_root_path) ? $module_root_path : '_core'; $this->template_names[$module_key] = $template_name; ! //This will keep loaded images $images = &$mx3_images; *************** *** 1991,1997 **** global $images; ! // ! // The User class must first be initiated. ! // if (empty($this->page_id)) { --- 1863,1869 ---- global $images; ! /* ! * The User class must first be initiated. ! */ if (empty($this->page_id)) { *************** *** 1999,2010 **** } ! // ! // Inititate User style ! // $this->_init_style(); ! // ! // Load images ! // switch (PORTAL_BACKEND) { --- 1871,1882 ---- } ! /* ! * Inititate User style ! */ $this->_init_style(); ! /* ! * Load images ! **/ switch (PORTAL_BACKEND) { *************** *** 2016,2026 **** case 'phpbb2': break; ! case 'phpbb3': ! ! $this->_load_phpbb_images(); $this->_load_mxbb_images(); break; ! } } --- 1888,1906 ---- case 'phpbb2': break; ! case 'phpbb3': ! ! //$this->_load_phpbb_images(); $this->_load_mxbb_images(); break; ! } ! /**/ ! ! // Load images ! //$this->_load_phpbb_images(); ! //$this->_load_mxbb_images(); ! ! // Load backend specific style defs. ! $this->setup_style(); } |