|
From: Jon O. <jon...@us...> - 2008-07-09 20:47:57
|
Update of /cvsroot/mxbb/core In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv16665 Modified Files: common.php index.php Log Message: Cleaning up common.php, and moving some backend init methods to the cache class (where all load methods are defined) Removed the template "border graphics" feature, since it has never been used. Js bug in 2 adminCP files. Index: common.php =================================================================== RCS file: /cvsroot/mxbb/core/common.php,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** common.php 16 Jun 2008 10:46:37 -0000 1.93 --- common.php 9 Jul 2008 20:47:51 -0000 1.94 *************** *** 213,272 **** // - // Get MX-Publisher config settings - // - $portal_config = $mx_cache->obtain_mxbb_config(); - - if ($portal_config['portal_version'] == '') - { - $portal_config = $mx_cache->obtain_mxbb_config(false); - } - - // // Define Users/Group/Sessions backend, and validate // ! $table_prefix = ''; ! switch ($portal_config['portal_backend']) ! { ! case 'internal': ! $phpbb_root_path = $mx_root_path . 'includes/shared/phpbb2/'; ! str_replace("//", "/", $phpbb_root_path); ! $portal_backend_valid_file = true; ! $table_prefix = 'phpBB_'; ! $tplEx = 'tpl'; ! break; ! case 'phpbb2': ! $phpbb_root_path = $mx_root_path . $portal_config['portal_backend_path']; ! str_replace("//", "/", $phpbb_root_path); ! $portal_backend_valid_file = @file_exists($phpbb_root_path . "modcp.$phpEx"); ! @include_once($phpbb_root_path . 'config.' . $phpEx); ! $tplEx = 'tpl'; ! $_result = $db->sql_query( "SELECT config_value from " . $table_prefix . "config WHERE config_name = 'cookie_domain'" ); ! $portal_backend_valid_db = $db->sql_numrows( $_result ) != 0; ! break; ! case 'phpbb3': ! $phpbb_root_path = $mx_root_path . $portal_config['portal_backend_path']; ! str_replace("//", "/", $phpbb_root_path); ! $portal_backend_valid_file = @file_exists($phpbb_root_path . "mcp.$phpEx"); ! @include_once($phpbb_root_path . 'config.' . $phpEx); ! $tplEx = 'html'; ! $_result = $db->sql_query( "SELECT config_value from " . $table_prefix . "config WHERE config_name = 'cookie_domain'" ); ! $portal_backend_valid_db = $db->sql_numrows( $_result ) != 0; ! break; ! } ! ! if (!$portal_backend_valid_file || empty($table_prefix) || !$portal_backend_valid_db) ! { ! // ! // If phpBB setup is bad, revert to standalone. Thus we can access the adminCP ;) ! // ! define('PORTAL_BACKEND', 'internal'); ! $phpbb_root_path = $mx_root_path . 'includes/shared/phpbb2/'; ! str_replace("//", "/", $phpbb_root_path); ! $tplEx = 'tpl'; ! } ! else ! { ! define('PORTAL_BACKEND', $portal_config['portal_backend']); ! } // --- 213,220 ---- // // Define Users/Group/Sessions backend, and validate + // Set $portal_config, $phpbb_root_path, $tplEx, $table_prefix & PORTAL_BACKEND // ! $mx_cache->load_backend(); // *************** *** 285,300 **** // Instantiate the mx_mod_rewrite class (if activated) // ! if ($portal_config['mod_rewrite']) ! { ! if ( file_exists( $mx_root_path . 'modules/mx_mod_rewrite/includes/rewrite_functions.' . $phpEx ) ) ! { ! include_once( $mx_root_path . 'modules/mx_mod_rewrite/includes/rewrite_functions.' . $phpEx ); ! ! if (class_exists('mx_mod_rewrite')) ! { ! $mx_mod_rewrite = new mx_mod_rewrite(); ! } ! } ! } // --- 233,237 ---- // Instantiate the mx_mod_rewrite class (if activated) // ! $mx_cache->init_mod_rewrite(); // *************** *** 313,322 **** $mx_block = new mx_block(); - // Obtain and encode users IP // ! // I'm removing HTTP_X_FORWARDED_FOR ... this may well cause other problems such as ! // private range IP's appearing instead of the guilty routable IP, tough, don't ! // even bother complaining ... go scream and shout at the idiots out there who feel ! // "clever" is doing harm rather than good ... karma is a great thing ... :) // $client_ip = ( !empty($_SERVER['REMOTE_ADDR']) ) ? $_SERVER['REMOTE_ADDR'] : ( ( !empty($_ENV['REMOTE_ADDR']) ) ? $_ENV['REMOTE_ADDR'] : getenv('REMOTE_ADDR') ); --- 250,255 ---- $mx_block = new mx_block(); // ! // Obtain and encode users IP // $client_ip = ( !empty($_SERVER['REMOTE_ADDR']) ) ? $_SERVER['REMOTE_ADDR'] : ( ( !empty($_ENV['REMOTE_ADDR']) ) ? $_ENV['REMOTE_ADDR'] : getenv('REMOTE_ADDR') ); *************** *** 324,379 **** // ! // Define some general Defs ! // ! $script_name = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($portal_config['script_path'])); ! $server_name = trim($portal_config['server_name']); ! $server_protocol = ( $portal_config['cookie_secure'] ) ? 'https://' : 'http://'; ! $server_port = ( $portal_config['server_port'] <> 80 ) ? ':' . trim($portal_config['server_port']) . '/' : '/'; ! ! $server_url = $server_protocol . str_replace("//", "/", $server_name . $server_port . $script_name . '/'); //On some server the slash is not added and this trick will fix it ! ! define('PORTAL_URL', $server_url); ! define('PORTAL_VERSION', $portal_config['portal_version']); ! ! // ! // Setup forum wide options, if this fails ! // then we output a CRITICAL_ERROR since ! // basic forum information is not available // ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! $board_config = array(); ! $script_name_phpbb = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim('includes/shared/phpbb2/')) . '/'; ! break; ! ! case 'phpbb2': ! if( @file_exists($phpbb_root_path . 'includes/class_config.' . $phpEx) && @file_exists($phpbb_root_path . 'includes/class_groups.' . $phpEx) ) ! { ! include($mx_root_path . 'includes/mx_functions_ch.'.$phpEx); ! } ! else ! { ! // ! // Grab phpBB global variables, re-cache if necessary ! // - optional parameter to enable/disable cache for config data. If enabled, remember to refresh the MX-Publisher cache whenever updating phpBB config settings ! // - true: enable cache, false: disable cache ! $board_config = $mx_cache->obtain_phpbb_config(false); ! } ! $script_name_phpbb = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($board_config['script_path'])) . '/'; ! break; ! ! case 'phpbb3': ! // ! // Grab phpBB global variables, re-cache if necessary ! // - optional parameter to enable/disable cache for config data. If enabled, remember to refresh the MX-Publisher cache whenever updating phpBB config settings ! // - true: enable cache, false: disable cache ! $board_config = $mx_cache->obtain_phpbb_config(false); ! $script_name_phpbb = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($board_config['script_path'])) . '/'; ! break; ! } ! ! $server_url_phpbb = $server_protocol . $server_name . $server_port . $script_name_phpbb; ! define('PHPBB_URL', $server_url_phpbb); // --- 257,264 ---- // ! // Define some general backend definitions ! // PORTAL_URL, PHPBB_URL, PORTAL_VERSION & $board_config // ! $mx_cache->setup_backend(); // Index: index.php =================================================================== RCS file: /cvsroot/mxbb/core/index.php,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** index.php 15 Jun 2008 09:15:42 -0000 1.77 --- index.php 9 Jul 2008 20:47:52 -0000 1.78 *************** *** 220,231 **** // - // Switch: Block border graphics? - // - if ( $mx_page->block_border_graphics && $mx_block->module_root_path != 'modules/mx_phpbb/') - { - $mx_block->output_border_graphics(); - } - - // // Output Block stats // --- 220,223 ---- |