|
From: Culprit <cul...@us...> - 2008-02-08 14:59:35
|
Update of /cvsroot/mxbb/core/includes/shared/phpbb3/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv9177/core/includes/shared/phpbb3/includes Modified Files: functions_hook.php functions_module.php Log Message: new admin ACP update phpBB3 backend Index: functions_hook.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/shared/phpbb3/includes/functions_hook.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** functions_hook.php 6 Feb 2008 15:13:40 -0000 1.7 --- functions_hook.php 8 Feb 2008 14:59:32 -0000 1.8 *************** *** 18,21 **** --- 18,25 ---- mx_page::load_file( 'functions', 'phpbb3'); 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 ); *************** *** 204,208 **** } } ! $script = preg_replace( array_keys( $preg_array ), array_values( $preg_array ), $script ); return $script; } --- 208,212 ---- } } ! $script = preg_replace( array_keys( $preg_array ), $preg_array, $script ); return $script; } *************** *** 210,216 **** function assign_content_acp( $html) { - //$html = preg_replace( '#.*\<div id="page-body"\>#si', '', $html); global $phpbb_root_path, $phpbb_admin_path; $html = trim(preg_replace('#<!-- INCLUDE overall_(header|footer)\.html -->#si', '', $html)); //$match_img_count = preg_match_all( '#img src="(adm\/[^"]*)"#s', $html, $match_img); --- 214,220 ---- function assign_content_acp( $html) { global $phpbb_root_path, $phpbb_admin_path; $html = trim(preg_replace('#<!-- INCLUDE overall_(header|footer)\.html -->#si', '', $html)); + $html = preg_replace( '#^.*\<div id="page-body"\>|<\/div>[^<]*<div id="page-footer">.*$#si', '', $html); //$match_img_count = preg_match_all( '#img src="(adm\/[^"]*)"#s', $html, $match_img); *************** *** 237,253 **** function _convert_links( $html ) { ! global $phpEx, $mx_request_vars; $panel_i = $mx_request_vars->request( 'i', ''); $menu_action = $this->mx_master->menu_actions; $admin_path = $mx_root_path. 'acp/'; ! $match_link_cnt = preg_match_all( '#(action|href)=[\'"](([^?]*)\??([^\'"]*?))[\'"]#si', $html, $match_link); ! $preg_array = array(); for( $i=0; $i<$match_link_cnt; $i++) { $params = str_replace( '&', '&', $match_link[4][$i]); $p_cnt = preg_match_all( '#([^=&]*)=([^&]*)#si', '&' . $params , $link_parts); ! $link_compare_ary = array_combine( $link_parts[1], $link_parts[2]); $eregi = 'adm/index.' . $phpEx . '?i=' . $panel_i . '&panel=' . $link_compare_ary['i'] . '&mode=' . $link_compare_ary['mode']; $panel = $menu_action[$eregi]; --- 241,258 ---- function _convert_links( $html ) { ! global $phpEx, $mx_request_vars, $mx_root_path; $panel_i = $mx_request_vars->request( 'i', ''); $menu_action = $this->mx_master->menu_actions; + array_shift( $menu_action); $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++) { $params = str_replace( '&', '&', $match_link[4][$i]); $p_cnt = preg_match_all( '#([^=&]*)=([^&]*)#si', '&' . $params , $link_parts); ! $link_compare_ary = @array_combine( $link_parts[1], $link_parts[2]); $eregi = 'adm/index.' . $phpEx . '?i=' . $panel_i . '&panel=' . $link_compare_ary['i'] . '&mode=' . $link_compare_ary['mode']; $panel = $menu_action[$eregi]; *************** *** 255,267 **** unset( $link_compare_ary['i']); unset( $link_compare_ary['mode']); ! ksort( $link_compare_ary); ! foreach( $link_compare_ary as $key => $value) { ! $link .= '&' . $key . '=' . $value; } ! $link_orig = preg_replace( '#([./\[\]\(\)?\\\\]{1})#si', "\\\\\\1", $match_link[2][$i]); ! $preg_array = array_merge( $preg_array, array( '#' . $link_orig .'#si' => $link)); } - return preg_replace( array_keys( $preg_array), $preg_array, $html); } --- 260,289 ---- unset( $link_compare_ary['i']); unset( $link_compare_ary['mode']); ! ! if ( is_array( $link_compare_ary)) { ! ksort( $link_compare_ary); ! $par_count = count( $link_compare_ary); ! $par_keys = array_keys( $link_compare_ary); ! for( $j=0; $j<$par_count; $j++) ! { ! $link .= '&' . $par_keys[$j] . '=' . $link_compare_ary[$par_keys[$j]]; ! } } ! $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; ! if( 0) ! { ! print '<pre>'; ! print htmlentities( trim($html)); ! foreach( $preg_array as $patt => $repl) ! { ! print '"' . $patt . '" => "' . $repl . '"<hr/>'; ! } ! 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.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** functions_module.php 6 Feb 2008 23:43:43 -0000 1.9 --- functions_module.php 8 Feb 2008 14:59:32 -0000 1.10 *************** *** 45,48 **** --- 45,53 ---- var $module_ary = array(); + var $FUNCTION_REPLACE_PHPBB3_ARRAY = array( + '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' + ); /** * List modules *************** *** 71,75 **** ORDER BY left_id ASC"; $result = $db->sql_query($sql); ! $rows = array(); while ($row = $db->sql_fetchrow($result)) --- 76,80 ---- ORDER BY left_id ASC"; $result = $db->sql_query($sql); ! $rows = array(); while ($row = $db->sql_fetchrow($result)) *************** *** 206,210 **** $names[$row['module_basename'] . '_' . $row['module_mode']][] = true; ! $module_row = array( 'depth' => $depth, --- 211,215 ---- $names[$row['module_basename'] . '_' . $row['module_mode']][] = true; ! $module_row = array( 'depth' => $depth, *************** *** 425,457 **** $modulecode = file_get_contents("$module_path/{$this->p_class}_$this->p_name.$phpEx"); ! $func_array = array( ! 'request_var', 'add_form_key', 'generate_text_for_display' ! ); $preg_array = array( '#^<\?(php)?|\?>$#si' => '', '#\$config#si' => '$board_config', ! '#\$cache#si' => '$mx_cache', ! '#\$user#si' => '$mx_user', ! '#\$auth#si' => '$phpbb_auth', '#append_sid\(#si' => 'mx3_append_sid(', '#get_username_string\(#si' => 'mx_get_username_string(', ! '#global#si' => 'global $mx_acp,', '#\$template-#si' => '$mx_acp->template-', '#\$mx_acp->template->assign_vars#si' => 'foreach( $mx_user->lang as $key => $value) { ! $mx_acp->template->assign_var( \'L_\' . $key, $value); } $mx_acp->template->assign_vars', ! '#(' . implode( '|', $func_array) . ')\(#si' => 'phpBB3::\1(', ! ); ! ! $modulecode = preg_replace( array_keys( $preg_array), $preg_array, $modulecode); ! //print_r( $mx_user); ! //$mx_user = new mx_user(); ! //$mx_user->add_lang('acp/groups'); ! //print_r( $mx_user->lang); ! //print '<pre style="font:10pt normal;font-family:Courier New">' .preg_replace( array("#\n#esi", "#\t#si"), array("'\n' . sprintf('%4d ', \$i++)", ' '), htmlentities( $modulecode ) ); ! //die(); eval($modulecode); --- 430,462 ---- $modulecode = file_get_contents("$module_path/{$this->p_class}_$this->p_name.$phpEx"); ! $preg_array = array( '#^<\?(php)?|\?>$#si' => '', '#\$config#si' => '$board_config', ! '#\$(cache|user)([,;])#si' => '$mx_\1\2', ! '#\$auth([,;])#si' => '$phpbb_auth\1', ! '#\$cache-#si' => '$mx_cache-', ! '#\$user-#si' => '$mx_user-', ! '#\$auth-#si' => '$phpbb_auth-', '#append_sid\(#si' => 'mx3_append_sid(', '#get_username_string\(#si' => 'mx_get_username_string(', ! '#global#si' => 'global $mx_acp,', '#\$template-#si' => '$mx_acp->template-', + '#trigger_error\(([^,)]*)([,\)])#si' => '$mx_acp->mx_message_die_acp( GENERAL_MESSAGE, \1 \2 ', '#\$mx_acp->template->assign_vars#si' => 'foreach( $mx_user->lang as $key => $value) { ! $mx_acp->template->assign_var( \'L_\' . $key, $value); } $mx_acp->template->assign_vars', ! '#(' . implode( '|', $this->FUNCTION_REPLACE_PHPBB3_ARRAY) . ')\(#si' => 'phpBB3::\1(', ! ); ! $modulecode = preg_replace( array_keys( $preg_array), $preg_array, $modulecode); ! ! if ( 0 ) ! { ! print '<pre style="font:10pt normal;font-family:Courier New">' .preg_replace( array("#\n#esi", "#\t#si"), array("'\n' . sprintf('%4d ', \$i++)", ' '), htmlentities( $modulecode ) ); ! die(); ! } eval($modulecode); *************** *** 515,519 **** $this->module->main($this->p_name, $this->p_mode); } ! return; } --- 520,524 ---- $this->module->main($this->p_name, $this->p_mode); } ! return; } |