|
From: Jon O. <jon...@us...> - 2008-02-15 23:46:31
|
Update of /cvsroot/mxbb/mx_kb In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31614 Modified Files: Tag: core28x kb.php Log Message: updated sync code... Index: kb.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb.php,v retrieving revision 1.42.2.1 retrieving revision 1.42.2.2 diff -C2 -d -r1.42.2.1 -r1.42.2.2 *** kb.php 28 Jan 2008 03:09:27 -0000 1.42.2.1 --- kb.php 15 Feb 2008 23:46:26 -0000 1.42.2.2 *************** *** 9,13 **** */ ! if ( file_exists( './viewtopic.php' ) ) // -------------------------------------------- phpBB MOD MODE { define( 'MXBB_MODULE', false ); --- 9,15 ---- */ ! $phpEx = substr(strrchr(__FILE__, '.'), 1); ! ! if ( !defined('PORTAL_BACKEND') && @file_exists( './viewtopic.' . $phpEx ) ) // -------------------------------------------- phpBB MOD MODE { define( 'MXBB_MODULE', false ); *************** *** 19,36 **** $mx_mod_path = $phpbb_root_path . 'mx_mod/'; ! $phpEx = substr(strrchr(__FILE__, '.'), 1); include( $phpbb_root_path . 'common.' . $phpEx ); ! //include_once( $phpbb_root_path . 'includes/bbcode.' . $phpEx ); ! //include_once( $phpbb_root_path . 'includes/functions_post.' . $phpEx ); include_once( $mx_mod_path . 'includes/functions_required.' . $phpEx ); include_once( $mx_mod_path . 'includes/functions_core.' . $phpEx ); ! define( 'PAGE_KB', -503 ); // If this id generates a conflict with other mods, change it ;) ! ! // Start session management ! $userdata = session_pagestart( $user_ip, PAGE_KB ); ! init_userprefs( $userdata ); ! // End session management // --- 21,39 ---- $mx_mod_path = $phpbb_root_path . 'mx_mod/'; ! //Check for cash mod ! if (file_exists($phpbb_root_path . 'includes/functions_cash.'.$phpEx)) ! { ! define('IN_CASHMOD', true); ! } ! include( $phpbb_root_path . 'common.' . $phpEx ); ! @ini_set( 'display_errors', '1' ); ! error_reporting (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables ! include_once( $mx_mod_path . 'includes/functions_required.' . $phpEx ); include_once( $mx_mod_path . 'includes/functions_core.' . $phpEx ); ! define( 'PAGE_KB', -502 ); // If this id generates a conflict with other mods, change it ;) // *************** *** 48,58 **** // $mx_request_vars = new mx_request_vars(); - - // - // instatiate the mx_block class - // - $mx_block = new mx_block(); $is_block = false; } else // --------------------------------------------------------------------------------- mxBB Module MODE --- 51,99 ---- // $mx_request_vars = new mx_request_vars(); $is_block = false; + + if ( file_exists("./modcp.$phpEx") ) // phpBB2 + { + define('PORTAL_BACKEND', 'phpbb2'); + $tplEx = 'tpl'; + + include_once( $phpbb_root_path . 'includes/bbcode.' . $phpEx ); + include_once( $phpbb_root_path . 'includes/functions_post.' . $phpEx ); + + // Start session management + $userdata = session_pagestart( $user_ip, PAGE_DOWNLOAD ); + init_userprefs( $userdata ); + // End session management + + + } + else if ( @file_exists("./mcp.$phpEx") ) // phpBB3 + { + define('PORTAL_BACKEND', 'phpbb3'); + $tplEx = 'html'; + + //include_once( $mx_mod_path . 'includes/shared/phpbb2/includes/bbcode.' . $phpEx ); + //include_once( $mx_mod_path . 'includes/shared/phpbb2/includes/functions_post.' . $phpEx ); + + // + // Start session management + // + $user->session_begin(); + $userdata = $user->data; + $user->setup(); + // + // End session management + // + + // + // Get phpBB config settings + // + $board_config = $config; + } + else + { + die('Copy this file in phpbb_root_path were is your viewtopic.php file!!!'); + } } else // --------------------------------------------------------------------------------- mxBB Module MODE *************** *** 135,140 **** } - define( 'MXBB_27x', file_exists( $mx_root_path . 'mx_login.' . $phpEx ) ); - // // Read Block Settings (default mode) --- 176,179 ---- *************** *** 150,156 **** --- 189,202 ---- $kb_type_select_data = ( !empty( $kb_type_select_var ) ) ? unserialize( $kb_type_select_var ) : array(); + //Check for cash mod + if (file_exists($phpbb_root_path . 'includes/functions_cash.'.$phpEx)) + { + define('IN_CASHMOD', true); + } + $is_block = true; global $images, $mx_images; } + define( 'MXBB_27x', @file_exists( $mx_root_path . 'mx_login.'.$phpEx ) ); } *************** *** 186,190 **** // Is admin? // =================================================== ! $is_admin = ( ( $userdata['user_level'] == ADMIN ) && $userdata['session_logged_in'] ) ? true : 0; // =================================================== --- 232,245 ---- // Is admin? // =================================================== ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! case 'phpbb2': ! $is_admin = ( ( $userdata['user_level'] == ADMIN ) && $userdata['session_logged_in'] ) ? true : 0; ! break; ! case 'phpbb3': ! $is_admin = ( $userdata['user_type'] == USER_FOUNDER ) ? true : 0; ! break; ! } // =================================================== |