|
From: OryNider <ory...@us...> - 2008-01-18 10:39:16
|
Update of /cvsroot/mxbb/core/includes/shared/phpbb3/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv20338 Modified Files: functions.php functions_admin.php functions_hook.php functions_module.php Log Message: Index: functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/shared/phpbb3/includes/functions.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** functions.php 15 Jan 2008 22:27:09 -0000 1.3 --- functions.php 18 Jan 2008 10:39:05 -0000 1.4 *************** *** 4515,4524 **** * Cool function name, eh? We might want to add operations to it later */ ! function garbage_collection() { global $mx_cache, $db; // Unload cache, must be done before the DB connection if closed ! if (!empty($cache)) { $mx_cache->unload(); --- 4515,4524 ---- * Cool function name, eh? We might want to add operations to it later */ ! function garbage_collection($unload_cache = true, $close_db = true) { global $mx_cache, $db; // Unload cache, must be done before the DB connection if closed ! if (!empty($cache) && ($unload_cache)) { $mx_cache->unload(); *************** *** 4526,4530 **** // Close our DB connection. ! if (!empty($db)) { $db->sql_close(); --- 4526,4530 ---- // Close our DB connection. ! if (!empty($db) && ($close_db)) { $db->sql_close(); Index: functions_hook.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/shared/phpbb3/includes/functions_hook.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** functions_hook.php 15 Jan 2008 22:27:09 -0000 1.3 --- functions_hook.php 18 Jan 2008 10:39:05 -0000 1.4 *************** *** 1,12 **** <?php /** ! * ! * @package Functions_phpBB3 ! * @version $Id$ ! * @copyright (c) 2002-2006 mxBB Project Team ! * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 ! * @link http://www.mxbb.net ! * ! */ if ( !defined( 'IN_PORTAL' ) ) --- 1,11 ---- <?php /** ! * ! * @package Functions_phpBB3 ! * @version $Id$ ! * @copyright (c) 2002-2006 mxBB Project Team ! * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 ! * @link http://www.mxbb.net ! */ if ( !defined( 'IN_PORTAL' ) ) *************** *** 14,27 **** die( "Hacking attempt" ); } ! ! //error_reporting( E_ALL | !E_NOTICE); ! ! //include_once( $phpbb_root_path . 'adm/index.'. $phpEx); include_once( $mx_root_path . 'includes/shared/phpbb3/includes/functions.' . $phpEx ); 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); ! if ( !function_exists( 'function phpbb_user_session_handler')) { function phpbb_user_session_handler() --- 13,24 ---- die( "Hacking attempt" ); } ! // error_reporting( E_ALL | !E_NOTICE); ! // include_once( $phpbb_root_path . 'adm/index.'. $phpEx); include_once( $mx_root_path . 'includes/shared/phpbb3/includes/functions.' . $phpEx ); 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 ); ! if ( !function_exists( 'function phpbb_user_session_handler' ) ) { function phpbb_user_session_handler() *************** *** 29,37 **** global $phpbb_hook; ! if (!empty($phpbb_hook) && $phpbb_hook->call_hook(__FUNCTION__)) { ! if ($phpbb_hook->hook_return(__FUNCTION__)) { ! return $phpbb_hook->hook_return_result(__FUNCTION__); } } --- 26,34 ---- global $phpbb_hook; ! if ( !empty( $phpbb_hook ) && $phpbb_hook->call_hook( __FUNCTION__ ) ) { ! if ( $phpbb_hook->hook_return( __FUNCTION__ ) ) { ! return $phpbb_hook->hook_return_result( __FUNCTION__ ); } } *************** *** 41,128 **** } ! if ( !function_exists( 'request_var')) { ! function request_var( $p1, $p2 = '', $p3 = false, $p4=false) { global $mx_request_vars; ! return $mx_request_vars->request( $p1, $p2, $p3, $p4); } } ! if ( !function_exists( 'append_sid')) { ! function append_sid( $url) { ! return mx_append_sid( $url); } } ! if ( !function_exists( 'adm_page_header')) { ! function adm_page_header($page_title) { global $board_config, $db, $user, $template; global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID; ! if (defined('HEADER_INC')) { return; } ! define('HEADER_INC', true); ! // gzip_compression ! if ($board_config['gzip_compress']) { ! if (@extension_loaded('zlib') && !headers_sent()) { ! ob_start('ob_gzhandler'); } } ! $template->assign_vars(array( ! 'PAGE_TITLE' => $page_title, ! 'USERNAME' => $user->data['username'], ! ! 'SID' => $SID, ! '_SID' => $_SID, ! 'SESSION_ID' => $user->session_id, ! 'ROOT_PATH' => $phpbb_admin_path, ! 'U_LOGOUT' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout'), ! 'U_ADM_INDEX' => append_sid("{$phpbb_admin_path}index.$phpEx"), ! 'U_INDEX' => append_sid("{$phpbb_root_path}index.$phpEx"), ! 'T_IMAGES_PATH' => "{$phpbb_root_path}images/", ! 'T_SMILIES_PATH' => "{$phpbb_root_path}{$board_config['smilies_path']}/", ! 'T_AVATAR_PATH' => "{$phpbb_root_path}{$board_config['avatar_path']}/", ! 'T_AVATAR_GALLERY_PATH' => "{$phpbb_root_path}{$board_config['avatar_gallery_path']}/", ! 'T_ICONS_PATH' => "{$phpbb_root_path}{$board_config['icons_path']}/", ! 'T_RANKS_PATH' => "{$phpbb_root_path}{$board_config['ranks_path']}/", ! 'T_UPLOAD_PATH' => "{$phpbb_root_path}{$board_config['upload_path']}/", ! 'ICON_MOVE_UP' => '<img src="' . $phpbb_admin_path . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />', ! 'ICON_MOVE_UP_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_up_disabled.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />', ! 'ICON_MOVE_DOWN' => '<img src="' . $phpbb_admin_path . 'images/icon_down.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />', ! 'ICON_MOVE_DOWN_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_down_disabled.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />', ! 'ICON_EDIT' => '<img src="' . $phpbb_admin_path . 'images/icon_edit.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />', ! 'ICON_EDIT_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_edit_disabled.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />', ! 'ICON_DELETE' => '<img src="' . $phpbb_admin_path . 'images/icon_delete.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />', ! 'ICON_DELETE_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_delete_disabled.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />', ! 'ICON_SYNC' => '<img src="' . $phpbb_admin_path . 'images/icon_sync.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />', ! 'ICON_SYNC_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_sync_disabled.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />', ! 'S_USER_LANG' => $user->lang['USER_LANG'], ! 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'], ! 'S_CONTENT_ENCODING' => 'UTF-8', ! 'S_CONTENT_FLOW_BEGIN' => ($user->lang['DIRECTION'] == 'ltr') ? 'left' : 'right', ! 'S_CONTENT_FLOW_END' => ($user->lang['DIRECTION'] == 'ltr') ? 'right' : 'left', ! )); // application/xhtml+xml not used because of IE ! header('Content-type: text/html; charset=UTF-8'); ! header('Cache-Control: private, no-cache="set-cookie"'); ! header('Expires: 0'); ! header('Pragma: no-cache'); return; --- 38,122 ---- } ! if ( !function_exists( 'request_var' ) ) { ! function request_var( $p1, $p2 = '', $p3 = false, $p4 = false ) { global $mx_request_vars; ! return $mx_request_vars->request( $p1, $p2, $p3, $p4 ); } } ! if ( !function_exists( 'append_sid' ) ) { ! function append_sid( $url ) { ! return mx_append_sid( $url ); } } ! if ( !function_exists( 'adm_page_header' ) ) { ! function adm_page_header( $page_title ) { global $board_config, $db, $user, $template; global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID; ! if ( defined( 'HEADER_INC' ) ) { return; } ! define( 'HEADER_INC', true ); // gzip_compression ! if ( $board_config['gzip_compress'] ) { ! if ( @extension_loaded( 'zlib' ) && !headers_sent() ) { ! ob_start( 'ob_gzhandler' ); } } ! $template->assign_vars( array( 'PAGE_TITLE' => $page_title, ! 'USERNAME' => $user->data['username'], ! 'SID' => $SID, ! '_SID' => $_SID, ! 'SESSION_ID' => $user->session_id, ! 'ROOT_PATH' => $phpbb_admin_path, ! 'U_LOGOUT' => append_sid( "{$phpbb_root_path}ucp.$phpEx", 'mode=logout' ), ! 'U_ADM_INDEX' => append_sid( "{$phpbb_admin_path}index.$phpEx" ), ! 'U_INDEX' => append_sid( "{$phpbb_root_path}index.$phpEx" ), ! 'T_IMAGES_PATH' => "{$phpbb_root_path}images/", ! 'T_SMILIES_PATH' => "{$phpbb_root_path}{$board_config['smilies_path']}/", ! 'T_AVATAR_PATH' => "{$phpbb_root_path}{$board_config['avatar_path']}/", ! 'T_AVATAR_GALLERY_PATH' => "{$phpbb_root_path}{$board_config['avatar_gallery_path']}/", ! 'T_ICONS_PATH' => "{$phpbb_root_path}{$board_config['icons_path']}/", ! 'T_RANKS_PATH' => "{$phpbb_root_path}{$board_config['ranks_path']}/", ! 'T_UPLOAD_PATH' => "{$phpbb_root_path}{$board_config['upload_path']}/", ! 'ICON_MOVE_UP' => '<img src="' . $phpbb_admin_path . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />', ! 'ICON_MOVE_UP_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_up_disabled.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />', ! 'ICON_MOVE_DOWN' => '<img src="' . $phpbb_admin_path . 'images/icon_down.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />', ! 'ICON_MOVE_DOWN_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_down_disabled.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />', ! 'ICON_EDIT' => '<img src="' . $phpbb_admin_path . 'images/icon_edit.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />', ! 'ICON_EDIT_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_edit_disabled.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />', ! 'ICON_DELETE' => '<img src="' . $phpbb_admin_path . 'images/icon_delete.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />', ! 'ICON_DELETE_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_delete_disabled.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />', ! 'ICON_SYNC' => '<img src="' . $phpbb_admin_path . 'images/icon_sync.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />', ! 'ICON_SYNC_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_sync_disabled.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />', + 'S_USER_LANG' => $user->lang['USER_LANG'], + 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'], + 'S_CONTENT_ENCODING' => 'UTF-8', + 'S_CONTENT_FLOW_BEGIN' => ( $user->lang['DIRECTION'] == 'ltr' ) ? 'left' : 'right', + 'S_CONTENT_FLOW_END' => ( $user->lang['DIRECTION'] == 'ltr' ) ? 'right' : 'left', + ) ); // application/xhtml+xml not used because of IE ! header( 'Content-type: text/html; charset=UTF-8' ); ! header( 'Cache-Control: private, no-cache="set-cookie"' ); ! header( 'Expires: 0' ); ! header( 'Pragma: no-cache' ); return; *************** *** 130,162 **** } ! if ( !function_exists( 'adm_page_footer')) { ! function adm_page_footer($copyright_html = true) { global $db, $board_config, $template, $user, $auth, $cache; global $starttime, $phpbb_root_path, $phpbb_admin_path, $phpEx; - // Output page creation time ! if (defined('DEBUG')) { ! $mtime = explode(' ', microtime()); $totaltime = $mtime[0] + $mtime[1] - $starttime; ! if (!empty($_REQUEST['explain']) && $auth->acl_get('a_') && defined('DEBUG_EXTRA') && method_exists($db, 'sql_report')) { ! $db->sql_report('display'); } ! $debug_output = sprintf('Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . (($board_config['gzip_compress']) ? 'On' : 'Off') . (($user->load) ? ' | Load : ' . $user->load : ''), $totaltime); ! if ($auth->acl_get('a_') && defined('DEBUG_EXTRA')) { ! if (function_exists('memory_get_usage')) { ! if ($memory_usage = memory_get_usage()) { global $base_memory_usage; $memory_usage -= $base_memory_usage; ! $memory_usage = ($memory_usage >= 1048576) ? round((round($memory_usage / 1048576 * 100) / 100), 2) . ' ' . $user->lang['MB'] : (($memory_usage >= 1024) ? round((round($memory_usage / 1024 * 100) / 100), 2) . ' ' . $user->lang['KB'] : $memory_usage . ' ' . $user->lang['BYTES']); $debug_output .= ' | Memory Usage: ' . $memory_usage; --- 124,155 ---- } ! if ( !function_exists( 'adm_page_footer' ) ) { ! function adm_page_footer( $copyright_html = true ) { global $db, $board_config, $template, $user, $auth, $cache; global $starttime, $phpbb_root_path, $phpbb_admin_path, $phpEx; // Output page creation time ! if ( defined( 'DEBUG' ) ) { ! $mtime = explode( ' ', microtime() ); $totaltime = $mtime[0] + $mtime[1] - $starttime; ! if ( !empty( $_REQUEST['explain'] ) && $auth->acl_get( 'a_' ) && defined( 'DEBUG_EXTRA' ) && method_exists( $db, 'sql_report' ) ) { ! $db->sql_report( 'display' ); } ! $debug_output = sprintf( 'Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . ( ( $board_config['gzip_compress'] ) ? 'On' : 'Off' ) . ( ( $user->load ) ? ' | Load : ' . $user->load : '' ), $totaltime ); ! if ( $auth->acl_get( 'a_' ) && defined( 'DEBUG_EXTRA' ) ) { ! if ( function_exists( 'memory_get_usage' ) ) { ! if ( $memory_usage = memory_get_usage() ) { global $base_memory_usage; $memory_usage -= $base_memory_usage; ! $memory_usage = ( $memory_usage >= 1048576 ) ? round( ( round( $memory_usage / 1048576 * 100 ) / 100 ), 2 ) . ' ' . $user->lang['MB'] : ( ( $memory_usage >= 1024 ) ? round( ( round( $memory_usage / 1024 * 100 ) / 100 ), 2 ) . ' ' . $user->lang['KB'] : $memory_usage . ' ' . $user->lang['BYTES'] ); $debug_output .= ' | Memory Usage: ' . $memory_usage; *************** *** 168,189 **** } ! $template->assign_vars(array( ! 'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '', ! 'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '', ! 'S_COPYRIGHT_HTML' => $copyright_html, ! 'VERSION' => $board_config['version']) ! ); ! $template->display('body'); phpBB3::garbage_collection(); ! //phpBB3::exit_handler(); } } - class phpbb3_hook { - var $main_part = ''; var $current_tab = ''; --- 161,179 ---- } ! $template->assign_vars( array( 'DEBUG_OUTPUT' => ( defined( 'DEBUG' ) ) ? $debug_output : '', ! 'TRANSLATION_INFO' => ( !empty( $user->lang['TRANSLATION_INFO'] ) ) ? $user->lang['TRANSLATION_INFO'] : '', ! 'S_COPYRIGHT_HTML' => $copyright_html, ! 'VERSION' => $board_config['version'] ) ! ); ! $template->display( 'body' ); phpBB3::garbage_collection(); ! // phpBB3::exit_handler(); } } class phpbb3_hook { var $main_part = ''; var $current_tab = ''; *************** *** 191,225 **** function phpbb3_hook() { - } ! function hook( $part, $curr_tab = '', $mode = '') { global $lang, $mx_user, $phpEx; ! switch( $part) { case 'forum': case 'admin': $this->main_part = $part; ! ! //print_r( $mx_user);die(); ! //include_once( $mx_user->lang_path . 'acp/common.'.$phpEx); break; case 'tabs': ! if ( $this->main_part == 'admin') { ! return $this->admin_tabs( $curr_tab); } break; case 'menu': ! if( $this->main_part == 'admin') { ! return $this->admin_menu( $curr_tab); } break; case 'panel': ! if ( $this->main_part == 'admin') { ! return $this->admin_panel( $curr_tab, $mode); } break; --- 181,213 ---- function phpbb3_hook() { } ! function hook( $part, $curr_tab = '', $mode = '' ) { global $lang, $mx_user, $phpEx; ! switch ( $part ) { case 'forum': case 'admin': $this->main_part = $part; ! // print_r( $mx_user);die(); ! // include_once( $mx_user->lang_path . 'acp/common.'.$phpEx); break; case 'tabs': ! if ( $this->main_part == 'admin' ) { ! return $this->admin_tabs( $curr_tab ); } break; case 'menu': ! if ( $this->main_part == 'admin' ) { ! return $this->admin_menu( $curr_tab ); } break; case 'panel': ! if ( $this->main_part == 'admin' ) { ! return $this->admin_panel( $curr_tab, $mode ); } break; *************** *** 227,233 **** } ! function admin_menu( $part) { ! if ( $this->main_part != 'admin') { return false; --- 215,221 ---- } ! function admin_menu( $part ) { ! if ( $this->main_part != 'admin' ) { return false; *************** *** 241,255 **** ORDER BY m1.left_id "; ! if( !( $rs=$db->sql_query( $sql))) { ! mx_message_die( GENERAL_ERROR, 'Could not obtain menu data form phpbb3 modules', 'Error', __LINE__, __FILE__, $sql); } ! $header= ''; $menu_ary = array(); ! while( $row = $db->sql_fetchrow( $rs) ) { ! if ( $header != $row['m1_langname']) { $header = $row['m1_langname']; --- 229,243 ---- ORDER BY m1.left_id "; ! if ( !( $rs = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Could not obtain menu data form phpbb3 modules', 'Error', __LINE__, __FILE__, $sql ); } ! $header = ''; $menu_ary = array(); ! while ( $row = $db->sql_fetchrow( $rs ) ) { ! if ( $header != $row['m1_langname'] ) { $header = $row['m1_langname']; *************** *** 262,268 **** } ! function admin_tabs($curr_tab) { ! if ( $this->main_part != 'admin') { return false; --- 250,256 ---- } ! function admin_tabs( $curr_tab ) { ! if ( $this->main_part != 'admin' ) { return false; *************** *** 272,277 **** $this->current_tab = $curr_tab; ! ! //This sintax is not correct /* $sql = "SELECT m1.*, count(m2.module_id) AS subcount --- 260,264 ---- $this->current_tab = $curr_tab; ! // This sintax is not correct /* $sql = "SELECT m1.*, count(m2.module_id) AS subcount *************** *** 283,312 **** "; */ ! $sql = "SELECT m1.*, count(m1.module_id) AS subcount ! FROM " . MODULES_TABLE . " AS m1 ! WHERE m1.parent_id = 0 AND m1.module_class = 'acp' ! AND m1.module_enabled = 1 ! AND m1.module_display = 1 ! GROUP BY m1.module_id ! HAVING count(m1.module_id) > 0 ! ORDER BY m1.left_id ! "; ! if ( !($rs = $db->sql_query( $sql)) ) { ! mx_message_die( GENERAL_ERROR, 'Could not obtain data form phpbb3 modules', 'Error', __LINE__, __FILE__, $sql); } $return_category = ''; ! while ( $row = $db->sql_fetchrow( $rs)) { ! if( $row['module_id']==$curr_tab) { ! $return_category = isset( $lang[$row['module_langname']])?$lang[$row['module_langname']]:$row['module_langname']; } ! $template->assign_block_vars( 'module_phpbb', array( // ! 'ACTIVETAB' => $row['module_id']==$curr_tab?' id="activetab"':'', ! 'CATEGORY' => PORTAL_BACKEND, ! 'PARAMS' => '&i=' . $row['module_id'], ! 'L_MX_PHPBB' => (isset( $mx_user->lang[$row['module_langname']])?$mx_user->lang[$row['module_langname']]:$row['module_langname']), ! )); } --- 270,326 ---- "; */ ! $sql = 'SELECT * ! FROM ' . MODULES_TABLE . " ! WHERE module_class = '" . $db->sql_escape('acp') . "' ! AND module_enabled = 1 ! AND module_display = 1 ! GROUP BY module_id ! ORDER BY left_id ASC"; ! ! /* ! $sql_array = array(); ! $sql_array['SELECT'] = 'm1.*, count(m2.module_id) AS subcount'; ! $sql_array['FROM'][MODULES_TABLE] = 'AS m1'; ! $sql_array['LEFT_JOIN'][] = array( ! 'FROM' => array( MODULES_TABLE => 'AS m2' ), ! 'ON' => 'm1.module_id = m2.parent_id AND m2.module_enabled = 1 AND m2.module_display = 1', ! ); ! $sql_array['GROUP_BY'] = 'm1.module_id'; ! $sql_array['WHERE'] = "m1.parent_id = 0 AND m1.module_class = 'acp'"; ! $sql_array['ORDER_BY'] = 'm1.left_id ASC'; ! ! $sql = $db->sql_build_query( 'SELECT', $sql_array ); ! */ ! ! if ( !( $rs = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Could not obtain tabs data form phpbb3 modules', 'Error', __LINE__, __FILE__, $sql ); } $return_category = ''; ! while ( $row = $db->sql_fetchrow( $rs ) ) { ! if ( isset( $mx_user->lang[$row['module_langname']] ) ) { ! $l_mx_phpbb = $mx_user->lang[$row['module_langname']]; } ! else if ( isset( $lang[$row['module_langname']] ) ) ! { ! $l_mx_phpbb = $lang[$row['module_langname']]; ! } ! else ! { ! $l_mx_phpbb = $row['module_langname']; ! } ! ! if ( $row['module_id'] == $curr_tab ) ! { ! $return_category = $l_mx_phpbb; ! } ! $template->assign_block_vars( 'module_phpbb', array( ! 'ACTIVETAB' => $row['module_id'] == $curr_tab?' id="activetab"':'', ! 'CATEGORY' => PORTAL_BACKEND, ! 'PARAMS' => '&i=' . $row['module_id'], ! 'L_MX_PHPBB' => $l_mx_phpbb, ! ) ); } *************** *** 314,318 **** } ! function admin_panel( $acp_panel, $mode = '') { global $phpbb_root_path, $phpbb_admin_path, $phpEx, $user, $mx_user, $mx_cache, $cache, $template; --- 328,332 ---- } ! function admin_panel( $acp_panel, $mode = '' ) { global $phpbb_root_path, $phpbb_admin_path, $phpEx, $user, $mx_user, $mx_cache, $cache, $template; *************** *** 322,369 **** $phpbb_admin_html .= "<p>ACP Panel: <strong>$acp_panel</strong></p>"; ! include_once( $phpbb_root_path . 'includes/acp/acp_' . $acp_panel . '.'. $phpEx); $cache = $mx_cache; $user = $mx_user; $auth = $phpbb_auth; ! //$auth = new phpbb_auth_base(); ! //$user->session_begin(); ! //$auth->acl($user->data); ! //$user->setup('acp/common'); ! ! //$phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : 'adm/'; $module_id = $acp_panel; $user->theme['template_storedb'] = false; ! //$template->set_custom_template($phpbb_admin_path . 'style', 'admin'); $module = new p_master(); - // Instantiate new module $module = new p_master(); - // Instantiate module system and generate list of available modules ! $module->list_modules('acp'); $module->p_name = $acp_panel; // Select the active module ! $module->set_active($acp_panel, $mode); ! // Assign data to the template engine for the list of modules // We do this before loading the active module for correct menu display in trigger_error ! $module->assign_tpl_vars(append_sid("{$phpbb_admin_path}index.$phpEx")); ! // Load and execute the relevant module $module->load_active(); ! ob_start(); ! adm_page_header($module->get_page_title()); ! $template->set_filenames(array( ! 'body' => $phpbb_root_path . 'adm/style/acp_' . $acp_panel . '.html', ! )); adm_page_footer(); $phpbb_admin_html .= ob_get_contents(); ob_end_clean(); ! return $phpbb_admin_html; } } ?> \ No newline at end of file --- 336,378 ---- $phpbb_admin_html .= "<p>ACP Panel: <strong>$acp_panel</strong></p>"; ! include_once( $phpbb_root_path . 'includes/acp/acp_' . $acp_panel . '.' . $phpEx ); $cache = $mx_cache; $user = $mx_user; $auth = $phpbb_auth; ! // $auth = new phpbb_auth_base(); ! // $user->session_begin(); ! // $auth->acl($user->data); ! // $user->setup('acp/common'); ! // $phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : 'adm/'; $module_id = $acp_panel; $user->theme['template_storedb'] = false; ! // $template->set_custom_template($phpbb_admin_path . 'style', 'admin'); $module = new p_master(); // Instantiate new module $module = new p_master(); // Instantiate module system and generate list of available modules ! $module->list_modules( 'acp' ); $module->p_name = $acp_panel; // Select the active module ! $module->set_active( $acp_panel, $mode ); // Assign data to the template engine for the list of modules // We do this before loading the active module for correct menu display in trigger_error ! $module->assign_tpl_vars( append_sid( "{$phpbb_admin_path}index.$phpEx" ) ); // Load and execute the relevant module $module->load_active(); ! ob_start(); ! adm_page_header( $module->get_page_title() ); ! $template->set_filenames( array( 'body' => $phpbb_root_path . 'adm/style/acp_' . $acp_panel . '.html', ! ) ); adm_page_footer(); $phpbb_admin_html .= ob_get_contents(); ob_end_clean(); ! return $phpbb_admin_html; } } + ?> \ No newline at end of file |