diff options
Diffstat (limited to 'phpBB/includes')
| -rw-r--r-- | phpBB/includes/acp/acp_main.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/functions_install.php | 52 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_warn.php | 4 | 
3 files changed, 55 insertions, 3 deletions
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index e529ae0e5a..cffe296651 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -201,7 +201,7 @@ class acp_main  						// No maximum post id? :o  						if (!$max_post_id)  						{ -							$sql = 'SELECT MAX(post_id) +							$sql = 'SELECT MAX(post_id) as max_post_id  								FROM ' . POSTS_TABLE;  							$result = $db->sql_query($sql);  							$max_post_id = (int) $db->sql_fetchfield('max_post_id'); diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index 6caa5c943f..633b2755f0 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -512,4 +512,56 @@ function adjust_language_keys_callback($matches)  	}  } +/** +* Creates the output to be stored in a phpBB config.php file +* +* @param	array	$data Array containing the database connection information +* @param	string	$dbms The name of the DBAL class to use +* @param	array	$load_extensions Array of additional extensions that should be loaded +* @param	bool	$debug If the debug constants should be enabled by default or not +* +* @return	string	The output to write to the file +*/ +function phpbb_create_config_file_data($data, $dbms, $load_extensions, $debug = false) +{ +	$load_extensions = implode(',', $load_extensions); + +	$config_data = "<?php\n"; +	$config_data .= "// phpBB 3.0.x auto-generated configuration file\n// Do not change anything in this file!\n"; + +	$config_data_array = array( +		'dbms'			=> $dbms, +		'dbhost'		=> $data['dbhost'], +		'dbport'		=> $data['dbport'], +		'dbname'		=> $data['dbname'], +		'dbuser'		=> $data['dbuser'], +		'dbpasswd'		=> htmlspecialchars_decode($data['dbpasswd']), +		'table_prefix'	=> $data['table_prefix'], +		'acm_type'		=> 'file', +		'load_extensions'	=> $load_extensions, +	); + +	foreach ($config_data_array as $key => $value) +	{ +		$config_data .= "\${$key} = '" . str_replace("'", "\\'", str_replace('\\', '\\\\', $value)) . "';\n"; +	} + +	$config_data .= "\n@define('PHPBB_INSTALLED', true);\n"; + +	if ($debug) +	{ +		$config_data .= "@define('DEBUG', true);\n"; +		$config_data .= "@define('DEBUG_EXTRA', true);\n"; +	} +	else +	{ +		$config_data .= "// @define('DEBUG', true);\n"; +		$config_data .= "// @define('DEBUG_EXTRA', true);\n"; +	} + +	$config_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused! + +	return $config_data; +} +  ?>
\ No newline at end of file diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index 63e5b19155..1016204ff8 100644 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -308,7 +308,7 @@ class mcp_warn  			include($phpbb_root_path . 'includes/functions_display.' . $phpEx);  		} -		$rank_title = $rank_img = ''; +		get_user_rank($user_row['user_rank'], $user_row['user_posts'], $rank_title, $rank_img, $rank_img_src);  		$avatar_img = get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']);  		$template->assign_vars(array( @@ -413,7 +413,7 @@ class mcp_warn  			include($phpbb_root_path . 'includes/functions_display.' . $phpEx);  		} -		$rank_title = $rank_img = ''; +		get_user_rank($user_row['user_rank'], $user_row['user_posts'], $rank_title, $rank_img, $rank_img_src);  		$avatar_img = get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']);  		// OK, they didn't submit a warning so lets build the page for them to do so  | 
