|
From: Jon O. <jon...@us...> - 2008-02-15 22:13:30
|
Update of /cvsroot/mxbb/mx_news In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv22594 Modified Files: mx_news.php Log Message: Updated, sync with phpBB2 standalone usage Trailing newlines Index: mx_news.php =================================================================== RCS file: /cvsroot/mxbb/mx_news/mx_news.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mx_news.php 8 Feb 2008 21:57:46 -0000 1.1 --- mx_news.php 15 Feb 2008 22:13:26 -0000 1.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 ); *************** *** 18,34 **** // When run as a phpBB mod these paths are identical ;) $phpbb_root_path = $module_root_path = $mx_root_path = './'; - $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 ); define( 'PAGE_DOWNLOAD', -501 ); // If this id generates a conflict with other mods, change it ;) ! // Start session management ! $userdata = session_pagestart( $user_ip, PAGE_DOWNLOAD ); ! init_userprefs( $userdata ); ! // End session management } else --- 20,100 ---- // When run as a phpBB mod these paths are identical ;) $phpbb_root_path = $module_root_path = $mx_root_path = './'; + $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_DOWNLOAD', -501 ); // If this id generates a conflict with other mods, change it ;) ! // ! // Instatiate the mx_cache class ! // ! $mx_cache = new mx_cache(); ! ! // ! // Get mxBB config settings ! // ! $portal_config = $mx_cache->obtain_mxbb_config(); ! ! // ! // instatiate the mx_request_vars class ! // ! $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 *************** *** 79,86 **** $block_size = ( isset( $block_size ) && !empty( $block_size ) ? $block_size : '100%' ); $is_block = true; global $images; } ! define( 'MXBB_27x', file_exists( $mx_root_path . 'mx_login.php' ) ); } --- 145,158 ---- $block_size = ( isset( $block_size ) && !empty( $block_size ) ? $block_size : '100%' ); + //Check for cash mod + if (file_exists($phpbb_root_path . 'includes/functions_cash.'.$phpEx)) + { + define('IN_CASHMOD', true); + } + $is_block = true; global $images; } ! define( 'MXBB_27x', @file_exists( $mx_root_path . 'mx_login.'.$phpEx ) ); } *************** *** 105,114 **** // Get action variable other wise set it to the main // ! $action = ( isset( $_REQUEST['action'] ) ) ? htmlspecialchars( $_REQUEST['action'] ) : 'news'; // =================================================== // Is admin? // =================================================== ! $is_admin = ( ( $userdata['user_level'] == ADMIN ) && $userdata['session_logged_in'] ) ? true : 0; // =================================================== --- 177,195 ---- // Get action variable other wise set it to the main // ! $action = $mx_request_vars->request('action', MX_TYPE_NO_TAGS, 'news'); // =================================================== // 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; ! } // =================================================== *************** *** 154,157 **** include( $mx_root_path . 'includes/page_tail.' . $phpEx ); } - ?> \ No newline at end of file --- 235,237 ---- |