|
From: FlorinCB <ory...@us...> - 2008-09-04 00:40:32
|
Update of /cvsroot/mxbb/mx_phpbb3/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv29598 Modified Files: forum_hack.php phpbb_defs.php Removed Files: common.php Log Message: upgrade Index: forum_hack.php =================================================================== RCS file: /cvsroot/mxbb/mx_phpbb3/includes/forum_hack.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** forum_hack.php 1 Sep 2008 04:00:59 -0000 1.1 --- forum_hack.php 4 Sep 2008 00:40:25 -0000 1.2 *************** *** 22,31 **** @define('MX_PHPBB3_BLOCK', true); ! ! //include_once($mx_root_path . 'includes/shared/phpbb3/includes/functions.' . $phpEx); ! //include_once($mx_root_path . 'includes/shared/phpbb3/includes/functions_posting.' . $phpEx); ! //include_once($mx_root_path . 'includes/shared/phpbb3/includes/bbcode.' . $phpEx); ! //include_once($mx_root_path . 'includes/sessions/phpbb3/auth.' . $phpEx); ! //include_once($mx_root_path . 'modules/mx_phpbb3blocks/includes/mx_functions_display.' . $phpEx); // -------------------------------------------------------------------------------- --- 22,26 ---- @define('MX_PHPBB3_BLOCK', true); ! include_once($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); // -------------------------------------------------------------------------------- *************** *** 456,460 **** case 'posting': $mode = $this->_get_mode( $url, $by_http_vars ); ! if ( $mode == 'topicreview' || $mode == 'smilies' ) { return ''; --- 451,455 ---- case 'posting': $mode = $this->_get_mode( $url, $by_http_vars ); ! if ($mode == 'topicreview' || $mode == 'smilies') { return ''; *************** *** 463,467 **** case 'search': $mode = $this->_get_mode( $url, $by_http_vars ); ! if ( $mode == 'searchuser' ) { return ''; --- 458,462 ---- case 'search': $mode = $this->_get_mode( $url, $by_http_vars ); ! if ($mode == 'searchuser') { return ''; *************** *** 470,474 **** case 'viewtopic': $mode = $this->_get_mode( $url, $by_http_vars ); ! if ( $mode == 'printertopic' || $mode == 'smilies' ) { return ''; --- 465,469 ---- case 'viewtopic': $mode = $this->_get_mode( $url, $by_http_vars ); ! if ($mode == 'printertopic' || $mode == 'smilies') { return ''; *************** *** 718,721 **** --- 713,717 ---- function smilies_pass($message) { + global $mx_bbcode; // // Replaces same function in bbcode.php *************** *** 724,728 **** //$smilies_path = $board_config['smilies_path']; //$board_config['smilies_path'] = $this->phpbb_url . $board_config['smilies_path']; ! $message = mx_smilies_pass( $message ); //$board_config['smilies_path'] = $smilies_path; return $message; --- 720,724 ---- //$smilies_path = $board_config['smilies_path']; //$board_config['smilies_path'] = $this->phpbb_url . $board_config['smilies_path']; ! $message = $mx_bbcode->smilies_pass($message); //$board_config['smilies_path'] = $smilies_path; return $message; *************** *** 734,737 **** --- 730,734 ---- function generate_smilies( $mode, $page_id ) { + global $mx_bbcode; // // Replaces same function in functions_post.php *************** *** 740,744 **** //$smilies_path = $board_config['smilies_path']; //$board_config['smilies_path'] = $this->phpbb_url . $board_config['smilies_path']; ! mx_generate_smilies( $mode, $page_id ); //$board_config['smilies_path'] = $smilies_path; $template->assign_vars( array( 'U_MORE_SMILIES' => $this->append_sid( "posting.$phpEx?mode=smilies" ) ) ); --- 737,741 ---- //$smilies_path = $board_config['smilies_path']; //$board_config['smilies_path'] = $this->phpbb_url . $board_config['smilies_path']; ! $mx_bbcode->generate_smilies($mode, $page_id); //$board_config['smilies_path'] = $smilies_path; $template->assign_vars( array( 'U_MORE_SMILIES' => $this->append_sid( "posting.$phpEx?mode=smilies" ) ) ); *************** *** 1236,1240 **** $mx_root_path = $this->mx_root_path; ! $code = file_get_contents($phpbb_root_path . $phpbb_file . ".$phpEx"); // --- 1233,1237 ---- $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"); // *************** *** 1259,1264 **** //$code = preg_replace('#^(.?include).*(extension).*(\r\n?|\n)#m','// mxBB: Removed include extension.inc' . "\n", $code); $code = preg_replace('#^(.?include).*(common).*(\r\n?|\n)#m','// mxBB: Removed include common.php' . "\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 --- 1256,1275 ---- //$code = preg_replace('#^(.?include).*(extension).*(\r\n?|\n)#m','// mxBB: Removed include extension.inc' . "\n", $code); $code = preg_replace('#^(.?include).*(common).*(\r\n?|\n)#m','// mxBB: Removed include common.php' . "\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); + + // + // 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 *************** *** 1285,1289 **** $code = str_replace('$phpEx =', '// MXP: Removed $phpEx =', $code); $code = str_replace('$user->session_begin()', '// MXP: Removed $user->session_begin()', $code); ! $code = str_replace('$user->setup(', '// MXP: Removed $user->setup(', $code); $code = str_replace('\'body\'', '\'phpbb3_body\'', $code); --- 1296,1300 ---- $code = str_replace('$phpEx =', '// MXP: Removed $phpEx =', $code); $code = str_replace('$user->session_begin()', '// MXP: Removed $user->session_begin()', $code); ! //$code = str_replace('$user->setup(\'viewforum', '// MXP: Removed $user->setup(\'viewforum', $code); $code = str_replace('\'body\'', '\'phpbb3_body\'', $code); *************** *** 1312,1316 **** $code = str_replace('get_user_avatar(', 'mx_get_user_avatar(', $code); $code = str_replace('get_username_string(', 'mx_get_username_string(', $code); ! $code = str_replace('append_sid(', '$mx_forum->append_sid(', $code); $code = str_replace('redirect(', '$mx_forum->redirect(', $code); $code = str_replace('make_jumpbox(', '$mx_forum->make_jumpbox(', $code); --- 1323,1327 ---- $code = str_replace('get_user_avatar(', 'mx_get_user_avatar(', $code); $code = str_replace('get_username_string(', 'mx_get_username_string(', $code); ! $code = str_replace('append_sid(', 'mx3_append_sid(', $code); $code = str_replace('redirect(', '$mx_forum->redirect(', $code); $code = str_replace('make_jumpbox(', '$mx_forum->make_jumpbox(', $code); *************** *** 1331,1344 **** $code = str_replace('bbcode_nl2br(', 'phpBB3::bbcode_nl2br(', $code); $code = str_replace('smiley_text(', 'phpBB3::smiley_text(', $code); ! $code = str_replace('message_die(', 'mx_message_die(', $code); - // - // Remove some includes already included by mxBB - // - $code = preg_replace ("/include(.*)functions_select/", "//", $code); - $code = preg_replace ("/include(.*)functions_post/", "//", $code); - $code = preg_replace ("/include(.*)bbcode/", "//", $code); - $code = preg_replace ("/include(.*)auth/", "include($mx_root_path . 'includes/sessions/phpbb3/auth.' . $phpEx);", $code); // --- 1342,1348 ---- $code = str_replace('bbcode_nl2br(', 'phpBB3::bbcode_nl2br(', $code); $code = str_replace('smiley_text(', 'phpBB3::smiley_text(', $code); ! $code = str_replace('add_form_key(', 'phpBB3::add_form_key(', $code); $code = str_replace('message_die(', 'mx_message_die(', $code); // *************** *** 1439,1443 **** $code = str_replace('exit;', 'return;', $code); ! break; } --- 1443,1447 ---- $code = str_replace('exit;', 'return;', $code); ! break; } *************** *** 1463,1466 **** --- 1467,1471 ---- { //die(str_replace("\n", '<br>', htmlspecialchars($code))); + //die( '<pre>'.preg_replace("#\n#esi", "'<br>' . sprintf('%4d ',\$i++)", htmlspecialchars($code)) . '</pre>'); eval($code); } *************** *** 1494,1499 **** --- 1499,1512 ---- * ================================================================================ */ + 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(); + return; Index: phpbb_defs.php =================================================================== RCS file: /cvsroot/mxbb/mx_phpbb3/includes/phpbb_defs.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** phpbb_defs.php 1 Sep 2008 04:01:10 -0000 1.1 --- phpbb_defs.php 4 Sep 2008 00:40:26 -0000 1.2 *************** *** 15,19 **** define( 'NEWS_CAT_TABLE', FORUMS_TABLE ); ! $cat_extract_order = 'cat_id, forum_order'; $cool_array_category_id = 'forum_id'; --- 15,19 ---- define( 'NEWS_CAT_TABLE', FORUMS_TABLE ); ! $cat_extract_order = 'left_id'; $cool_array_category_id = 'forum_id'; --- common.php DELETED --- |