Browse Source

! Further tweaks to db port option in installer

Signed-off-by: Michael Eshom <[email protected]>
Michael Eshom 10 years ago
parent
commit
cb54106e9e
2 changed files with 7 additions and 5 deletions
  1. 2 0
      Themes/default/languages/Install.english.php
  2. 5 5
      other/install.php

+ 2 - 0
Themes/default/languages/Install.english.php

@@ -130,6 +130,8 @@ $txt['db_settings_password_info'] = 'Here, put the password you need to connect
 $txt['db_settings_database'] = 'Database name';
 $txt['db_settings_database_info'] = 'Fill in the name of the database you want to use for SMF to store its data in.';
 $txt['db_settings_database_info_note'] = 'If this database does not exist, this installer will try to create it.';
+$txt['db_settings_port'] = 'Database port';
+$txt['db_settings_port_note'] = 'Leave blank to use the default';
 $txt['db_settings_database_file'] = 'Database filename';
 $txt['db_settings_database_file_info'] = 'This is the name of the file in which to store the SMF data. We recommend you use the randomly generated name for this and set the path of this file to be outside of the public area of your webserver.';
 $txt['db_settings_prefix'] = 'Table prefix';

+ 5 - 5
other/install.php

@@ -778,10 +778,9 @@ function DatabaseSettings()
 				}
 				if (isset($db['default_password']))
 					$incontext['db']['pass'] = ini_get($db['default_password']);
-				if (isset($db['default_port']))
-					$incontext['db']['port'] = ini_get($db['default_port']);
-				elseif ($key == 'postgresql')
-					$incontext['db']['port'] = 5432;
+
+				// For simplicity and less confusion, leave the port blank by default
+				$incontext['db']['port'] = '';
 
 				$incontext['db']['type'] = $key;
 				$foundOne = true;
@@ -2431,7 +2430,8 @@ function template_database_settings()
 			</tr><tr id="db_port_contain">
 				<td width="20%" valign="top" class="textbox"><label for="db_port_input">', $txt['db_settings_port'], ':</label></td>
 				<td>
-					<input type="text" name="db_port" id="db_port_input" value="', $incontext['db']['port'], '</div>
+					<input type="text" name="db_port" id="db_port_input" value="', $incontext['db']['port'], '"><br>
+					<div style="font-size: smaller; margin-bottom: 2ex;">', $txt['db_settings_port_info'], '</div>
 				</td>
 			</tr><tr id="db_user_contain">
 				<td valign="top" class="textbox"><label for="db_user_input">', $txt['db_settings_username'], ':</label></td>