aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2012-12-05 12:21:25 -0500
committerOleg Pudeyev <oleg@bsdpower.com>2012-12-05 12:21:25 -0500
commitb07ae3fe59c336c7880d5af40166a1a2413fede0 (patch)
treec2fa37b6bad3d94d5a9f3fe9d8d7be64812bb92e
parent4f947ebb47e4236c4bc3e2474eb49069d67d91e1 (diff)
parent0f7cdfe9f416ed8cdc1f4373bac32e28c44b2549 (diff)
downloadforums-b07ae3fe59c336c7880d5af40166a1a2413fede0.tar
forums-b07ae3fe59c336c7880d5af40166a1a2413fede0.tar.gz
forums-b07ae3fe59c336c7880d5af40166a1a2413fede0.tar.bz2
forums-b07ae3fe59c336c7880d5af40166a1a2413fede0.tar.xz
forums-b07ae3fe59c336c7880d5af40166a1a2413fede0.zip
Merge PR #1053 branch 'develop-olympus' into develop
* develop-olympus: [ticket/10841] Revert more whitespace changes. [ticket/10841] Revert whitespace changes. [ticket/10841] adding space after if [ticket/10841] removing unnecessary spacing [ticket/10841] changing affectedrows check to COUNT in sql [ticket/10841] Modifying style and language selectors in UCP Conflicts: phpBB/includes/ucp/ucp_prefs.php phpBB/styles/prosilver/template/ucp_prefs_personal.html
-rw-r--r--phpBB/includes/ucp/ucp_prefs.php33
-rw-r--r--phpBB/styles/prosilver/template/ucp_prefs_personal.html12
-rw-r--r--phpBB/styles/subsilver2/template/ucp_prefs_personal.html4
3 files changed, 43 insertions, 6 deletions
diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php
index 2228bc7931..23892c2c8c 100644
--- a/phpBB/includes/ucp/ucp_prefs.php
+++ b/phpBB/includes/ucp/ucp_prefs.php
@@ -132,6 +132,36 @@ class ucp_prefs
$dateformat_options .= '>' . $user->lang['CUSTOM_DATEFORMAT'] . '</option>';
$timezone_selects = phpbb_timezone_select($user, $data['tz'], true);
+
+ // check if there are any user-selectable languages
+ $sql = 'SELECT COUNT(lang_id) as languages_count
+ FROM ' . LANG_TABLE;
+ $result = $db->sql_query($sql);
+ if ($db->sql_fetchfield('languages_count') > 1)
+ {
+ $s_more_languages = true;
+ }
+ else
+ {
+ $s_more_languages = false;
+ }
+ $db->sql_freeresult($result);
+
+ // check if there are any user-selectable styles
+ $sql = 'SELECT COUNT(style_id) as styles_count
+ FROM ' . STYLES_TABLE . '
+ WHERE style_active = 1';
+ $result = $db->sql_query($sql);
+ if ($db->sql_fetchfield('styles_count') > 1)
+ {
+ $s_more_styles = true;
+ }
+ else
+ {
+ $s_more_styles = false;
+ }
+ $db->sql_freeresult($result);
+
$template->assign_vars(array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
@@ -152,6 +182,9 @@ class ucp_prefs
'DEFAULT_DATEFORMAT' => $config['default_dateformat'],
'A_DEFAULT_DATEFORMAT' => addslashes($config['default_dateformat']),
+ 'S_MORE_LANGUAGES' => $s_more_languages,
+ 'S_MORE_STYLES' => $s_more_styles,
+
'S_LANG_OPTIONS' => language_select($data['lang']),
'S_STYLE_OPTIONS' => ($config['override_user_style']) ? '' : style_select($data['style']),
'S_TZ_OPTIONS' => $timezone_selects['tz_select'],
diff --git a/phpBB/styles/prosilver/template/ucp_prefs_personal.html b/phpBB/styles/prosilver/template/ucp_prefs_personal.html
index 4382e891fd..50ade02acd 100644
--- a/phpBB/styles/prosilver/template/ucp_prefs_personal.html
+++ b/phpBB/styles/prosilver/template/ucp_prefs_personal.html
@@ -63,11 +63,13 @@
<label for="popuppm0"><input type="radio" name="popuppm" id="popuppm0" value="0"<!-- IF not S_POPUP_PM --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
- <dl>
- <dt><label for="lang">{L_BOARD_LANGUAGE}{L_COLON}</label></dt>
- <dd><select name="lang" id="lang">{S_LANG_OPTIONS}</select></dd>
- </dl>
- <!-- IF S_STYLE_OPTIONS -->
+ <!-- IF S_MORE_LANGUAGES -->
+ <dl>
+ <dt><label for="lang">{L_BOARD_LANGUAGE}{L_COLON}</label></dt>
+ <dd><select name="lang" id="lang">{S_LANG_OPTIONS}</select></dd>
+ </dl>
+ <!-- ENDIF -->
+ <!-- IF S_STYLE_OPTIONS and S_MORE_STYLES -->
<dl>
<dt><label for="style">{L_BOARD_STYLE}{L_COLON}</label></dt>
<dd><select name="style" id="style">{S_STYLE_OPTIONS}</select></dd>
diff --git a/phpBB/styles/subsilver2/template/ucp_prefs_personal.html b/phpBB/styles/subsilver2/template/ucp_prefs_personal.html
index 5a169763fb..9ebc045608 100644
--- a/phpBB/styles/subsilver2/template/ucp_prefs_personal.html
+++ b/phpBB/styles/subsilver2/template/ucp_prefs_personal.html
@@ -61,11 +61,13 @@
<td class="row1" width="50%"><b class="genmed">{L_POPUP_ON_PM}{L_COLON}</b></td>
<td class="row2"><input type="radio" class="radio" name="popuppm" value="1"<!-- IF S_POPUP_PM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span>&nbsp;&nbsp;<input type="radio" class="radio" name="popuppm" value="0"<!-- IF not S_POPUP_PM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td>
</tr>
+<!-- IF S_MORE_LANGUAGES -->
<tr>
<td class="row1" width="50%"><b class="genmed">{L_BOARD_LANGUAGE}{L_COLON}</b></td>
<td class="row2"><select name="lang">{S_LANG_OPTIONS}</select></td>
</tr>
-<!-- IF S_STYLE_OPTIONS -->
+<!-- ENDIF -->
+<!-- IF S_STYLE_OPTIONS and S_MORE_STYLES -->
<tr>
<td class="row1" width="50%"><b class="genmed">{L_BOARD_STYLE}{L_COLON}</b></td>
<td class="row2"><select name="style">{S_STYLE_OPTIONS}</select></td>