# GPL v2.0 or later. See docs/COPYING. ############################################################## /** * phpBB2 Bridge Class * This class bridges phpBB2 with Rivals. */ class phpbb2_bridge { /** * Initilize the class. * * @param object $core */ function phpbb2_bridge ( &$core ) { global $usr; global $ses; global $config; // Include standard phpBB2 files. define ( 'IN_PHPBB', true ); define ( 'USERS_TABLE', $config[ 'table_prefix' ] . 'users' ); $phpbb_root_path = './'; include ( $phpbb_root_path . 'extension.inc' ); include ( $phpbb_root_path . 'common.' . $phpEx ); // Setup phpBB2's sessions. $userdata = session_pagestart ( $user_ip, PAGE_INDEX ); init_userprefs ( $userdata ); // Bridge phpBB2's sessions to Rivals' sessions. $usr->data[ 'user_id' ] = $userdata[ 'user_id' ]; $usr->data[ 'username' ] = $userdata[ 'username' ]; $usr->data[ 'user_level' ] = $userdata[ 'user_level' ]; include ( $phpbb_root_path . 'includes/page_header.' . $phpEx ); global $template; // Take the output from the module (&$core->tpl_content) and parse it. $template->set_rootdir ( 'templates/' ); $template->assign_var ( 'S_OUTPUT', $core->tpl_content ); $template->set_filenames ( array ( 'body' => 'rivals.tpl' ) ); $template->pparse ( 'body' ); include ( $phpbb_root_path . 'includes/page_footer.' . $phpEx ); } } ?>