|
From: FlorinCB <ory...@us...> - 2009-07-08 15:47:28
|
Update of /cvsroot/mxbb/mx_phpbb3/includes In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv15441 Modified Files: forum_hack.php phpbb3_constants.php Log Message: update, this will enable some features required by phpbb3 plugin Index: forum_hack.php =================================================================== RCS file: /cvsroot/mxbb/mx_phpbb3/includes/forum_hack.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** forum_hack.php 7 Sep 2008 03:13:40 -0000 1.3 --- forum_hack.php 8 Jul 2009 15:47:20 -0000 1.4 *************** *** 2,8 **** /** * ! * @package mxBB Portal Module - mx_phpbb3 * @version $Id$ ! * @copyright (c) 2002-2006 [Markus, Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * --- 2,8 ---- /** * ! * @package MXP Portal Module - mx_phpbb3 * @version $Id$ ! * @copyright (c) 2002-2006 [Markus, Jon Ohlsson] MXP Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * *************** *** 22,27 **** @define('MX_PHPBB3_BLOCK', true); - include_once($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); - //include_once($mx_root_path . 'includes/shared/phpbb3/includes/message_parser.' . $phpEx); --- 22,25 ---- *************** *** 416,420 **** // ! // Redirect phpBB login calls to mxBB // if ($script_name == 'login') --- 414,418 ---- // ! // Redirect phpBB login calls to MXP // if ($script_name == 'login') *************** *** 794,800 **** // -------------------------------------------------------------------------------- ! // mxbb_reformat - fixup (truncates) urls, images and words (wrapping) for a narrow column layout // -------------------------------------------------------------------------------- ! function mxbb_magic( $mytext = '' ) { global $board_config; --- 792,798 ---- // -------------------------------------------------------------------------------- ! // MXP_reformat - fixup (truncates) urls, images and words (wrapping) for a narrow column layout // -------------------------------------------------------------------------------- ! function MXP_magic( $mytext = '' ) { global $board_config; *************** *** 1263,1267 **** // Remove def of IN_PHPBB // ! $code = preg_replace('#^(.?define).*(IN_PHPBB).*(\r\n?|\n)#m','// mxBB: Removed IN_PHPBB def' . "\n", $code); // --- 1261,1265 ---- // Remove def of IN_PHPBB // ! $code = preg_replace('#^(.?define).*(IN_PHPBB).*(\r\n?|\n)#m','// MXP: Removed IN_PHPBB def' . "\n", $code); // *************** *** 1279,1284 **** // Commment out the main includes // ! //$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); --- 1277,1286 ---- // Commment out the main includes // ! //$code = preg_replace('#^(.?include).*(extension).*(\r\n?|\n)#m','// MXP: Removed include extension.inc' . "\n", $code); ! $code = preg_replace('#^(.?include).*(common).*(\r\n?|\n)#m','// MXP: Removed include common.php' . "\n", $code); ! $code = preg_replace ("/include(.*)functions_select/", "//Include this from MXP", $code); ! $code = str_replace("include($phpbb_root_path . 'common.' . $phpEx)","",$code); ! ! $code = preg_replace('#^(.?require).*(utf_tools).*(\r\n?|\n)#m','// MXP: Removed include common.php' . "\n", $code); *************** *** 1291,1295 **** // ! // Remove some includes already included by mxBB // $code = preg_replace ("/include(.*)functions_select/", "//Include this from MXP", $code); --- 1293,1297 ---- // ! // Remove some includes already included by MXP // $code = preg_replace ("/include(.*)functions_select/", "//Include this from MXP", $code); *************** *** 1301,1306 **** // Commment out the page_header and page_tail includes // ! //$code = preg_replace('#^(.?).*(include).*(page_header).*(\r\n?|\n)#m','// mxBB: Removed include page_header.php' . "\n", $code); ! //$code = preg_replace('#^(.?).*(include).*(page_tail).*(\r\n?|\n)#m',"// mxBB: Removed include page_tail.php" . "\n" . 'return;' . "\n", $code); $code = str_replace('page_header(', '// MXP: Removed page_header(', $code); //$code = str_replace('page_footer(', '//page_footer(', $code); --- 1303,1308 ---- // Commment out the page_header and page_tail includes // ! //$code = preg_replace('#^(.?).*(include).*(page_header).*(\r\n?|\n)#m','// MXP: Removed include page_header.php' . "\n", $code); ! //$code = preg_replace('#^(.?).*(include).*(page_tail).*(\r\n?|\n)#m',"// MXP: Removed include page_tail.php" . "\n" . 'return;' . "\n", $code); $code = str_replace('page_header(', '// MXP: Removed page_header(', $code); //$code = str_replace('page_footer(', '//page_footer(', $code); *************** *** 1332,1336 **** $code = str_replace('login_box(\'\', $mx_user->lang[\'LOGIN_VIEWFORUM\']);', 'append_sid(\'login.\'.$phpEx);', $code); // ! // Replace common phpBB functions with mxBB alternatives // $code = str_replace('display_forums(', 'mx_display_forums(', $code); --- 1334,1338 ---- $code = str_replace('login_box(\'\', $mx_user->lang[\'LOGIN_VIEWFORUM\']);', 'append_sid(\'login.\'.$phpEx);', $code); // ! // Replace common phpBB functions with MXP alternatives // $code = str_replace('display_forums(', 'mx_display_forums(', $code); *************** *** 1338,1341 **** --- 1340,1344 ---- $code = str_replace('generate_text_for_display(', 'mx_generate_text_for_display(', $code); $code = str_replace('generate_forum_nav(', 'mx_generate_forum_nav(', $code); + $code = str_replace('generate_link_hash(', 'phpBB3::generate_link_hash(', $code); $code = str_replace('get_forum_parents(', 'mx_get_forum_parents(', $code); $code = str_replace('get_moderators(', 'mx_get_moderators(', $code); *************** *** 1378,1382 **** // NOTE: This regex will only work if "global" is stated on a new line... // ! $code = preg_replace('#^(.?).*\s(global)(.*?)($)(.*?)(\r\n?|\n)#m', '// mxBB rewrite of global, to instance $this in this function ' . "\n " . '// global $mx_forum, \\3 //', $code) ? $code : preg_replace('#^(.?).*\s(global)(.*?)($)(.*?)(\r\n?|\n)#m', '// mxBB rewrite of global, to instance $this in this function ' . "\n " . 'global $mx_forum, \\3 //', $code); switch ( $phpbb_file ) --- 1381,1385 ---- // NOTE: This regex will only work if "global" is stated on a new line... // ! $code = preg_replace('#^(.?).*\s(global)(.*?)($)(.*?)(\r\n?|\n)#m', '// MXP rewrite of global, to instance $this in this function ' . "\n " . '// global $mx_forum, \\3 //', $code) ? $code : preg_replace('#^(.?).*\s(global)(.*?)($)(.*?)(\r\n?|\n)#m', '// MXP rewrite of global, to instance $this in this function ' . "\n " . 'global $mx_forum, \\3 //', $code); switch ( $phpbb_file ) *************** *** 1399,1403 **** // For narrow columns // ! //$code = str_replace('$message = str_replace("\n"', '$message = $mx_forum->mxbb_magic( $message );' . "\n" . '$message = str_replace("\n"', $code); $code = str_replace('<a href=\"modcp', '<a href=\"'.$phpbb_root_path.'modcp', $code); --- 1402,1406 ---- // For narrow columns // ! //$code = str_replace('$message = str_replace("\n"', '$message = $mx_forum->MXP_magic( $message );' . "\n" . '$message = str_replace("\n"', $code); $code = str_replace('<a href=\"modcp', '<a href=\"'.$phpbb_root_path.'modcp', $code); *************** *** 1550,1556 **** 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'; } } --- 1553,1559 ---- foreach( $up_files_keys as $up_file ) { ! @rename($_FILES[$up_file]['tmp_name'], $_FILES[$up_file]['tmp_name'] . '.MXP' ); ! $_FILES[$up_file]['tmp_name'] .= '.MXP'; ! $_FILES[$up_file]['tmp_name'] .= '.MXP'; } } *************** *** 1581,1586 **** // session_start(); ! $_SESSION['mxbb_post_vars'] = $_POST; ! $_SESSION['mxbb_post_files'] = $_FILES; // --- 1584,1589 ---- // session_start(); ! $_SESSION['MXP_post_vars'] = $_POST; ! $_SESSION['MXP_post_files'] = $_FILES; // Index: phpbb3_constants.php =================================================================== RCS file: /cvsroot/mxbb/mx_phpbb3/includes/phpbb3_constants.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** phpbb3_constants.php 1 Sep 2008 04:01:01 -0000 1.1 --- phpbb3_constants.php 8 Jul 2009 15:47:21 -0000 1.2 *************** *** 40,44 **** define( 'TOPIC_ADD_TYPE_TABLE', $mx_table_prefix . 'topic_add_type' ); ! $default_lang = ($mx_user->lang['default_lang']) ? $mx_user->get_old_lang($mx_user->lang['default_lang']) : $board_config['default_lang']; if (empty($default_lang)) --- 40,44 ---- define( 'TOPIC_ADD_TYPE_TABLE', $mx_table_prefix . 'topic_add_type' ); ! $default_lang = ($mx_user->lang['default_lang']) ? $mx_user->encode_lang($mx_user->lang['default_lang']) : $board_config['default_lang']; if (empty($default_lang)) |