|
From: Florin C B. <ory...@us...> - 2013-07-02 07:01:13
|
Update of /cvsroot/mxbb/core/includes In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv17264 Modified Files: mx_functions_admincp.php mx_functions_style.php Log Message: Index: mx_functions_admincp.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_admincp.php,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** mx_functions_admincp.php 2 Jul 2013 02:24:03 -0000 1.74 --- mx_functions_admincp.php 2 Jul 2013 07:01:09 -0000 1.75 *************** *** 2565,2569 **** { global $template, $lang, $db, $board_config, $theme, $delimeter; ! $module_id_max = $this->getMaxId(MODULE_TABLE, 'module_id'); $function_id_max = $this->getMaxId(FUNCTION_TABLE, 'function_id'); --- 2565,2569 ---- { global $template, $lang, $db, $board_config, $theme, $delimeter; ! $module_id_max = $this->getMaxId(MODULE_TABLE, 'module_id'); $function_id_max = $this->getMaxId(FUNCTION_TABLE, 'function_id'); *************** *** 2571,2609 **** $option_id_max = $this->getMaxId(PARAMETER_OPTION_TABLE, 'option_id'); $block_id_max = $this->getMaxId(BLOCK_TABLE, 'block_id'); ! $function_count = -1; $parameter_count = -1; $option_count = -1; $block_count = -1; ! $delete_par = false; $delete_opt = false; $delete_fnc = false; ! ! // ! // Generate safe object identifiers for the target DB ! // where this module pack is going to be imported... ! // $i = 0; ! while( $i < count($fcontents) ) { $module_data = explode($delimeter, trim($fcontents[$i])); ! switch( $module_data[0] ) { ! // ! // 0: module, 1: module_id, 2: module_name, 3: module_path, ! // 4: module_desc, 5: module_include_admin ! // case 'module': $delete_fnc = false; $exists_fnc_ids = array(); ! $safe_row = mx_get_info(MODULE_TABLE, 'module_path', $module_data[3]); ! ! // ! // Switch to check if its updating or installing module ! // if( $safe_row ) { --- 2571,2610 ---- $option_id_max = $this->getMaxId(PARAMETER_OPTION_TABLE, 'option_id'); $block_id_max = $this->getMaxId(BLOCK_TABLE, 'block_id'); ! $function_count = -1; $parameter_count = -1; $option_count = -1; $block_count = -1; ! $delete_par = false; $delete_opt = false; $delete_fnc = false; ! ! /* ! * Generate safe object identifiers for the target DB ! * where this module pack is going to be imported... ! */ $i = 0; ! $delete_option = false; ! $exists_option_ids = array(); while( $i < count($fcontents) ) { $module_data = explode($delimeter, trim($fcontents[$i])); ! switch( $module_data[0] ) { ! /* ! * 0: module, 1: module_id, 2: module_name, 3: module_path, ! * 4: module_desc, 5: module_include_admin ! */ case 'module': $delete_fnc = false; $exists_fnc_ids = array(); ! $safe_row = mx_get_info(MODULE_TABLE, 'module_path', $module_data[3]); ! ! /* ! * Switch to check if its updating or installing module ! */ if( $safe_row ) { *************** *** 2620,2645 **** } break; ! ! // ! // 0: function, 1: module_id, 2: function_id, 3: function_name, ! // ! // 4: function_desc, 5: function_file, 6: function_admin case 'function': $delete_par = false; $exists_par_ids = array(); ! $module_data[1] = $module_id; ! if( $delete_fnc ) { break; } ! $safe_row = mx_get_info(FUNCTION_TABLE, 'module_id', $module_id, 'function_file', $module_data['5']); ! if( $module_data['4'] == 'endoflist' ) { $old_items = $this->get_old_items(FUNCTION_TABLE, 'module_id', $module_id, 'function_id', $exists_fnc_ids); ! for( $f = 0; $f < count($old_items); $f++ ) { --- 2621,2647 ---- } break; ! ! /* ! * 0: function, 1: module_id, 2: function_id, 3: function_name, ! * ! * 4: function_desc, 5: function_file, 6: function_admin ! */ case 'function': $delete_par = false; $exists_par_ids = array(); ! $module_data[1] = $module_id; ! if( $delete_fnc ) { break; } ! $safe_row = mx_get_info(FUNCTION_TABLE, 'module_id', $module_id, 'function_file', $module_data['5']); ! if( $module_data['4'] == 'endoflist' ) { $old_items = $this->get_old_items(FUNCTION_TABLE, 'module_id', $module_id, 'function_id', $exists_fnc_ids); ! for( $f = 0; $f < count($old_items); $f++ ) { *************** *** 2664,2689 **** } break; ! ! // ! // 0: parameter, 1: function_id, 2: parameter_id, 3: parameter_name, ! // 4: parameter_type, 5: parameter_default, 6: parameter_function ! // case 'parameter': $delete_option = false; $exists_option_ids = array(); ! $module_data[1] = $function_id; ! if( $delete_par ) { break; } ! $safe_row = mx_get_info(PARAMETER_TABLE, 'function_id', $function_id, 'parameter_name', $module_data['3']); ! if( $module_data['4'] == 'endoflist' ) { $old_items = $this->get_old_items(PARAMETER_TABLE, 'function_id', $function_id, 'parameter_id', $exists_par_ids); ! for( $f = 0; $f < count( $old_items ); $f++ ) { --- 2666,2691 ---- } break; ! ! /* ! * 0: parameter, 1: function_id, 2: parameter_id, 3: parameter_name, ! * 4: parameter_type, 5: parameter_default, 6: parameter_function ! */ case 'parameter': $delete_option = false; $exists_option_ids = array(); ! $module_data[1] = $function_id; ! if( $delete_par ) { break; } ! $safe_row = mx_get_info(PARAMETER_TABLE, 'function_id', $function_id, 'parameter_name', $module_data['3']); ! if( $module_data['4'] == 'endoflist' ) { $old_items = $this->get_old_items(PARAMETER_TABLE, 'function_id', $function_id, 'parameter_id', $exists_par_ids); ! for( $f = 0; $f < count( $old_items ); $f++ ) { *************** *** 2706,2714 **** } break; ! ! // ! // 0: block, 1: block_id, 2: block_title, 3: block_desc, ! // 4: function_id, 5: auth_view, 6: auth_edit, 7: auth_delete ! // case 'block': $safe_row = mx_get_info(BLOCK_TABLE, 'function_id', $function_id); --- 2708,2716 ---- } break; ! ! /* ! * 0: block, 1: block_id, 2: block_title, 3: block_desc, ! * 4: function_id, 5: auth_view, 6: auth_edit, 7: auth_delete ! */ case 'block': $safe_row = mx_get_info(BLOCK_TABLE, 'function_id', $function_id); *************** *** 2727,2741 **** } break; ! case 'delete': break; ! case 'New_function': break; ! default: mx_message_die(GENERAL_MESSAGE, "Invalid Pack Format. Line: " . ( $i + 1 )); } ! if( !$delete_par && !$delete_option && !$delete_fnc ) { --- 2729,2743 ---- } break; ! case 'delete': break; ! case 'New_function': break; ! default: mx_message_die(GENERAL_MESSAGE, "Invalid Pack Format. Line: " . ( $i + 1 )); } ! if( !$delete_par && !$delete_option && !$delete_fnc ) { Index: mx_functions_style.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_style.php,v retrieving revision 1.136 retrieving revision 1.137 diff -C2 -d -r1.136 -r1.137 *** mx_functions_style.php 2 Jul 2013 02:24:03 -0000 1.136 --- mx_functions_style.php 2 Jul 2013 07:01:09 -0000 1.137 *************** *** 842,846 **** $init_override = $portal_config['override_user_style']; } ! /* if (!empty($_GET['style']) || isset($_COOKIE['style'])) { --- 842,846 ---- $init_override = $portal_config['override_user_style']; } ! /**/ if (!empty($_GET['style']) || isset($_COOKIE['style'])) { *************** *** 857,861 **** } } ! */ /* --- 857,861 ---- } } ! /**/ /* *************** *** 1781,1794 **** $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 ! // if (!$mx_template_config) { --- 1781,1794 ---- $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 ! */ if (!$mx_template_config) { *************** *** 1796,1803 **** $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'); } } --- 1796,1803 ---- $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'); } } *************** *** 1813,1831 **** $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'); } ! } ! ! // ! // We have no template to use - die ! // if (!$mx_template_config) { ! mx_message_die(CRITICAL_ERROR, "Could not open " . $mx_root_path . $module_root_path . $this->default_current_template_path . " style config file", '', __LINE__, __FILE__); } ! $img_lang = ( file_exists($mx_root_path . $current_template_path . '/images/lang_' . $board_config['default_lang']) ) ? $board_config['default_lang'] : 'english'; --- 1813,1831 ---- $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'); } ! } ! ! /* ! * We have no template to use - die ! */ if (!$mx_template_config) { ! mx_message_die(CRITICAL_ERROR, "Could not open " . $mx_root_path . $module_root_path . $this->default_current_template_path . '/' . $template_name . '.cfg' . " style config file " . "<br /> current_template_path: " . $mx_root_path . $module_root_path . $current_template_path_d . '/' . $template_name_d . '.cfg' . "<br /> cloned_template_path: " . $mx_root_path . $module_root_path . $cloned_template_path_d . "<br /> default_template_path: " . $mx_root_path . $module_root_path . $default_template_path_d . "<br /> template_name: " . $template_name_d . "<br /> template_config: " . $template_config_d . "", '', __LINE__, __FILE__); } ! $img_lang = ( file_exists($mx_root_path . $current_template_path . '/images/lang_' . $board_config['default_lang']) ) ? $board_config['default_lang'] : 'english'; *************** *** 1848,1857 **** // What template is the module using? // ! $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; ! unset($mx_images); } --- 1848,1860 ---- // What template is the module using? // ! $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; ! ! // 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; unset($mx_images); } *************** *** 1865,1872 **** function _load_module_lang($lang_mode = MX_LANG_MAIN) { ! global $lang, $board_config, $mx_block, $phpEx, $mx_root_path; ! ! $default_lang = ($this->lang['default_lang']) ? $this->encode_lang($this->lang['default_lang']) : $board_config['default_lang']; ! if (empty($default_lang)) { --- 1868,1873 ---- function _load_module_lang($lang_mode = MX_LANG_MAIN) { ! global $lang, $board_config, $mx_block, $phpEx, $mx_root_path; ! $default_lang = ($this->lang['default_lang']) ? $this->decode_lang($this->lang['default_lang']) : $board_config['default_lang']; if (empty($default_lang)) { *************** *** 1874,1878 **** $default_lang= 'english'; } - if (!isset($this->loaded_langs[$mx_block->module_root_path])) { --- 1875,1878 ---- *************** *** 1887,1895 **** $module_lang_path = $mx_root_path . $mx_block->module_root_path; } - // ------------------------------------------------------------------------- // Read Module Main Language Definition ! // ------------------------------------------------------------------------- ! if ((@include $module_lang_path . "language/lang_" . $default_lang . "/lang_main.$phpEx") === false) { if ((@include $module_lang_path . "language/lang_english/lang_main.$phpEx") === false) --- 1887,1894 ---- $module_lang_path = $mx_root_path . $mx_block->module_root_path; } // ------------------------------------------------------------------------- // Read Module Main Language Definition ! // ------------------------------------------------------------------------- ! if ((include $module_lang_path . "language/lang_" . $default_lang . "/lang_main.$phpEx") === false) { if ((@include $module_lang_path . "language/lang_english/lang_main.$phpEx") === false) *************** *** 1909,1913 **** if ((@include $module_lang_path . "language/lang_english/lang_admin.$phpEx") === false) { ! mx_message_die(CRITICAL_ERROR, 'Modiule admin language file ' . $mx_root_path . $module_lang_path . "language/lang_" . $default_lang . "/lang_admin.$phpEx" . ' couldn\'t be opened.'); } } --- 1908,1912 ---- if ((@include $module_lang_path . "language/lang_english/lang_admin.$phpEx") === false) { ! mx_message_die(CRITICAL_ERROR, 'Modiule admin language file ' . $mx_root_path . $module_lang_path . "language/lang_" . $default_lang . "/lang_admin.$phpEx" . ' couldn\'t be opened.'); } } *************** *** 1916,1920 **** } } ! /** * Enter description here... --- 1915,1919 ---- } } ! /** * Enter description here... *************** *** 1963,1984 **** * @param unknown_type $page_id */ ! function init( $user_ip, $page_id, $init_style = true ) { - // // Define basic constants - // $this->page_id = $page_id; $this->user_ip = $user_ip; - // // Inititate User data - // $this->_init_session($user_ip, $this->page_id); $this->_init_userprefs(); - // // Inititate User style ! // ! if ( $init_style ) { $this->_init_style(); --- 1962,1977 ---- * @param unknown_type $page_id */ ! function init($user_ip, $page_id, $init_style = true) { // Define basic constants $this->page_id = $page_id; $this->user_ip = $user_ip; // Inititate User data $this->_init_session($user_ip, $this->page_id); $this->_init_userprefs(); // Inititate User style ! if ($init_style) { $this->_init_style(); |