|
From: FlorinCB <ory...@us...> - 2008-09-07 03:13:44
|
Update of /cvsroot/mxbb/mx_phpbb3/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31231 Modified Files: forum_hack.php Log Message: some fixes Index: forum_hack.php =================================================================== RCS file: /cvsroot/mxbb/mx_phpbb3/includes/forum_hack.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** forum_hack.php 4 Sep 2008 00:40:25 -0000 1.2 --- forum_hack.php 7 Sep 2008 03:13:40 -0000 1.3 *************** *** 24,27 **** --- 24,34 ---- include_once($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); + //include_once($mx_root_path . 'includes/shared/phpbb3/includes/message_parser.' . $phpEx); + + if(!function_exists('posting_gen_inline_attachments')) + { + //include_once($mx_root_path . 'includes/shared/phpbb3/includes/functions_posting.' . $phpEx); + } + // -------------------------------------------------------------------------------- // Class: mx_forum *************** *** 141,145 **** global $mx_root_path, $portal_config, $db, $phpEx; ! if ( defined( PHPBB_URL ) && defined( PORTAL_URL ) ) { $this->phpbb_url = PHPBB_URL; --- 148,152 ---- global $mx_root_path, $portal_config, $db, $phpEx; ! if (defined('PHPBB_URL') && defined('PORTAL_URL')) { $this->phpbb_url = PHPBB_URL; *************** *** 150,154 **** $PORTAL_TABLE = $this->_get_mx_table_name('portal'); $sql = "SELECT * FROM $PORTAL_TABLE WHERE portal_id = 1"; ! if ( !( $result = $db->sql_query($sql) ) ) { $this->phpbb_url = ''; --- 157,161 ---- $PORTAL_TABLE = $this->_get_mx_table_name('portal'); $sql = "SELECT * FROM $PORTAL_TABLE WHERE portal_id = 1"; ! if (!($result = $db->sql_query($sql))) { $this->phpbb_url = ''; *************** *** 157,161 **** else { ! $row = $db->sql_fetchrow( $result ); $script_name = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($row['script_path'])); --- 164,168 ---- else { ! $row = $db->sql_fetchrow($result); $script_name = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($row['script_path'])); *************** *** 741,745 **** $template->assign_vars( array( 'U_MORE_SMILIES' => $this->append_sid( "posting.$phpEx?mode=smilies" ) ) ); } ! // -------------------------------------------------------------------------------- // Fix required by ported posting.php after submiting changes (new,edit,delete)... --- 748,758 ---- $template->assign_vars( array( 'U_MORE_SMILIES' => $this->append_sid( "posting.$phpEx?mode=smilies" ) ) ); } ! ! function decode_message($custom_bbcode_uid = '', $update_this_message = true) ! { ! globaL $parse_message; ! ! $parse_message->decode_message($custom_bbcode_uid, $update_this_message); ! } // -------------------------------------------------------------------------------- // Fix required by ported posting.php after submiting changes (new,edit,delete)... *************** *** 1232,1237 **** $phpbb_root_path = $this->phpbb_root_path; $mx_root_path = $this->mx_root_path; - $code = strpos($phpbb_file, $phpbb_root_path) ? file_get_contents($phpbb_root_path . $phpbb_file . ".$phpEx") : strpos($phpbb_file, $mx_root_path) ? require_once($phpbb_file . ".$phpEx") : file_get_contents($phpbb_root_path . $phpbb_file . ".$phpEx"); // --- 1245,1262 ---- $phpbb_root_path = $this->phpbb_root_path; $mx_root_path = $this->mx_root_path; + + switch ( $phpbb_file ) + { + case 'bbcode': + $code = ''; + $mx_cache->load_file('bbcode', 'phpbb3'); + break; + + default: + $code = file_get_contents($phpbb_root_path . $phpbb_file . ".$phpEx"); + break; + } + // *************** *** 1259,1276 **** // - // Remove some includes already included by mxBB - // - $code = preg_replace ("/include(.*)functions_select/", "//Include this from MXP", $code); - $code = preg_replace ("/include(.*)functions_post/", "//Include this from MXP", $code); - $code = preg_replace ("/include(.*)bbcode/", "//Include this from MXP", $code); - $code = preg_replace ("/include(.*)message_parser/", "//Include this from MXP: message_parser", $code); - - // // Change some includes already exists in MXP // $code = preg_replace('#^(.?include).*(auth).*(\r\n?|\n)#m','require($mx_root_path . \'includes/sessions/phpbb3/auth.\' . $phpEx);' . "\n", $code); $code = preg_replace('#^(.?include).*(functions_display).*(\r\n?|\n)#m','require($mx_root_path . \'modules/mx_phpbb3blocks/includes/mx_functions_display.\' . $phpEx);' . "\n", $code); // // Commment out the page_header and page_tail includes // --- 1284,1302 ---- // // Change some includes already exists in MXP // $code = preg_replace('#^(.?include).*(auth).*(\r\n?|\n)#m','require($mx_root_path . \'includes/sessions/phpbb3/auth.\' . $phpEx);' . "\n", $code); $code = preg_replace('#^(.?include).*(functions_display).*(\r\n?|\n)#m','require($mx_root_path . \'modules/mx_phpbb3blocks/includes/mx_functions_display.\' . $phpEx);' . "\n", $code); + //$code = preg_replace('#^(.?include).*(message_parser).*(\r\n?|\n)#m','require($mx_root_path . \'includes/shared/phpbb3/includes/message_parser.\' . $phpEx);' . "\n", $code); // + // Remove some includes already included by mxBB + // + $code = preg_replace ("/include(.*)functions_select/", "//Include this from MXP", $code); + $code = preg_replace ("/include(.*)functions_post/", "//Include this from MXP", $code); + //$code = preg_replace ("/include(.*)bbcode/", "//Include this from MXP", $code); + //$code = preg_replace ("/include(.*)message_parser/", "//Include this from MXP: message_parser", $code); + + // // Commment out the page_header and page_tail includes // *************** *** 1344,1347 **** --- 1370,1375 ---- $code = str_replace('add_form_key(', 'phpBB3::add_form_key(', $code); $code = str_replace('message_die(', 'mx_message_die(', $code); + $code = str_replace(' unique_id(', ' phpBB3::unique_id(', $code); + $code = str_replace(' decode_message(', ' phpBB3::decode_message(', $code); *************** *** 1499,1509 **** * ================================================================================ */ - mx_cache::load_file('message_parser', 'phpbb3'); - - if(!function_exists('posting_gen_inline_attachments')) - { - mx_cache::load_file('functions_posting', 'phpbb3'); - } - $mx_forum = new mx_forum(); $mx_forum->init(); --- 1527,1530 ---- *************** *** 1524,1534 **** if ($mx_forum->phpbb_config['enable_module']) { ! if (isset($_POST) && !empty($_POST) ) { ! $up_files_keys = array_keys($_POST); foreach( $up_files_keys as $up_file ) { ! @rename($_POST[$up_file]['tmp_name'], $_POST[$up_file]['tmp_name'] . '.mxbb' ); ! $_POST[$up_file]['tmp_name'] .= '.mxbb'; $_FILES[$up_file]['tmp_name'] .= '.mxbb'; } --- 1545,1555 ---- if ($mx_forum->phpbb_config['enable_module']) { ! if (isset($_FILES) && !empty($_FILES) ) { ! $up_files_keys = array_keys($_FILES); foreach( $up_files_keys as $up_file ) { ! @rename($_FILES[$up_file]['tmp_name'], $_FILES[$up_file]['tmp_name'] . '.mxbb' ); ! $_FILES[$up_file]['tmp_name'] .= '.mxbb'; $_FILES[$up_file]['tmp_name'] .= '.mxbb'; } |