|
From: Culprit <cul...@us...> - 2008-02-12 06:29:36
|
Update of /cvsroot/mxbb/core/includes/shared/phpbb3/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31175/core/includes/shared/phpbb3/includes Modified Files: functions_module.php functions_hook.php Log Message: ACP update related phpbb3 backend Index: functions_hook.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/shared/phpbb3/includes/functions_hook.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** functions_hook.php 9 Feb 2008 12:42:03 -0000 1.9 --- functions_hook.php 12 Feb 2008 06:29:31 -0000 1.10 *************** *** 19,28 **** mx_page::load_file( 'functions_module', 'phpbb3'); mx_page::load_file( 'message_parser', 'phpbb3'); - //mx_page::load_file( 'functions_content', 'phpbb3'); - //mx_page::load_file( 'functions_user', 'phpbb3'); - - //include_once( $mx_root_path . 'includes/shared/phpbb3/includes/functions_module.' . $phpEx ); - // include_once( $mx_root_path . 'includes/sessions/phpbb3/auth.' . $phpEx ); - // include_once( $mx_root_path . 'includes/sessions/phpbb3/session.' . $phpEx ); class mx_phpbb3_admin --- 19,22 ---- *************** *** 183,187 **** '#([^_])append_sid#si' => '\1mx_append_sid', '#\$module_id[ \t][^;]*;#si' => "\$module_id = '" . $this->action_scripts[$panel] . "';", ! '#\$mode[ \t][^;]*;#si' => "\$mode = '" . $mx_request_vars->request( 'mode') . "';", '#request_var#si' => '$mx_request_vars->request', '#login_box\(#si' => '// login_box(', --- 177,181 ---- '#([^_])append_sid#si' => '\1mx_append_sid', '#\$module_id[ \t][^;]*;#si' => "\$module_id = '" . $this->action_scripts[$panel] . "';", ! '#\$mode[ \t][^;]*;#si' => "\$mode = '" . $mx_request_vars->request( 'mode', MX_TYP_NO_TAGS) . "';", '#request_var#si' => '$mx_request_vars->request', '#login_box\(#si' => '// login_box(', *************** *** 233,237 **** print '<pre>'; print htmlentities( $html); ! print_r( $match_link); die( ); } --- 227,231 ---- print '<pre>'; print htmlentities( $html); ! //print_r( $match_link); die( ); } *************** *** 247,253 **** $admin_path = $mx_root_path. 'acp/'; ! $match_link_cnt = preg_match_all( '#(action|href)=[\'"](([^?]*)\??([^\'"]*)?)?[\'"]#si', $html, $match_link); ! $preg_array = array( '##si' => ''); for( $i=0; $i<$match_link_cnt; $i++) { --- 241,254 ---- $admin_path = $mx_root_path. 'acp/'; ! $match_link_cnt = preg_match_all( '#(action|href)=[\'"](([^?\'"]*)\??([^\'"]*)?)[\'"]#si', $html, $match_link); ! if( 0) ! { ! print '<pre>'; ! print htmlentities( trim($html)); ! print_r( $match_link); ! die(); ! } ! $preg_array = array( '##si' => ''); for( $i=0; $i<$match_link_cnt; $i++) { *************** *** 273,277 **** $link_orig = preg_replace( '#([./\[\]\(\)?\\\\])#si', "\\\\\\1", $match_link[2][$i]); $link_orig = str_replace( '#', '\#', $link_orig); ! $preg_array = array_merge( $preg_array, array( '#' . $link_orig .'#si' => $admin_path . $link)); } //return $html; --- 274,281 ---- $link_orig = preg_replace( '#([./\[\]\(\)?\\\\])#si', "\\\\\\1", $match_link[2][$i]); $link_orig = str_replace( '#', '\#', $link_orig); ! if ( !empty($link_orig) ) ! { ! $preg_array = array_merge( $preg_array, array( '#' . $link_orig .'#si' => $admin_path . $link)); ! } } //return $html; *************** *** 279,283 **** { print '<pre>'; ! print htmlentities( trim($html)); foreach( $preg_array as $patt => $repl) { --- 283,287 ---- { print '<pre>'; ! //print htmlentities( trim($html)); foreach( $preg_array as $patt => $repl) { *************** *** 286,289 **** --- 290,294 ---- die(); } + return preg_replace( array_keys( $preg_array), $preg_array, $html); } Index: functions_module.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/shared/phpbb3/includes/functions_module.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** functions_module.php 8 Feb 2008 14:59:32 -0000 1.10 --- functions_module.php 12 Feb 2008 06:29:31 -0000 1.11 *************** *** 2,6 **** /** * ! * @package phpBB3 * @version $Id$ * @copyright (c) 2005 phpBB Group --- 2,7 ---- /** * ! * @package MX-Publisher phpBB3 ! * @subpackage Admin * @version $Id$ * @copyright (c) 2005 phpBB Group *************** *** 17,30 **** } ! // ! // Common global functions ! // Fixes for MX-Publisher: ! // $config -> $board_config ! // $cache -> $mx_cache ! // $user -> $mx_user ! // $auth -> $phpbb_auth ! // Added $mx_root_path ! // append_sid -> mx3_append_sid ! // /** --- 18,33 ---- } ! /** ! * Common global functions for replacing to work MX-Publisher with phpbb3 ! * VARIABLES: ! * $config -> $board_config ! * $cache -> $mx_cache ! * $user -> $mx_user ! * $auth -> $phpbb_auth ! * Added $mx_root_path ! * FUNCTIONS: ! * append_sid -> mx3_append_sid ! * add_log -> mx_add_log ! */ /** *************** *** 48,52 **** 'request_var', 'add_form_key', 'generate_text_for_display', 'check_form_key', 'gen_sort_selects', 'on_page', 'generate_pagination', 'generate_text_for_edit', 'generate_text_for_storage', 'group_create', ! 'unique_id' ); /** --- 51,55 ---- 'request_var', 'add_form_key', 'generate_text_for_display', 'check_form_key', 'gen_sort_selects', 'on_page', 'generate_pagination', 'generate_text_for_edit', 'generate_text_for_storage', 'group_create', ! 'unique_id', 'set_config', 'style_select', 'language_select' ); /** *************** *** 430,434 **** $modulecode = file_get_contents("$module_path/{$this->p_class}_$this->p_name.$phpEx"); ! $preg_array = array( '#^<\?(php)?|\?>$#si' => '', --- 433,437 ---- $modulecode = file_get_contents("$module_path/{$this->p_class}_$this->p_name.$phpEx"); ! $FUNCTION_REPLACE = implode( '|', $this->FUNCTION_REPLACE_PHPBB3_ARRAY); $preg_array = array( '#^<\?(php)?|\?>$#si' => '', *************** *** 440,443 **** --- 443,447 ---- '#\$auth-#si' => '$phpbb_auth-', '#append_sid\(#si' => 'mx3_append_sid(', + '#add_log\(#si' => 'mx_add_log(', '#get_username_string\(#si' => 'mx_get_username_string(', '#global#si' => 'global $mx_acp,', *************** *** 449,453 **** } $mx_acp->template->assign_vars', ! '#(' . implode( '|', $this->FUNCTION_REPLACE_PHPBB3_ARRAY) . ')\(#si' => 'phpBB3::\1(', ); --- 453,458 ---- } $mx_acp->template->assign_vars', ! '#(' . $FUNCTION_REPLACE . ')\(#si' => 'phpBB3::\1(', ! "#'(" . $FUNCTION_REPLACE . ")'#si" => "'phpBB3::\\1'" ); |