aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/ucp/ucp_prefs.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2012-12-09 21:02:31 +0100
committerMarc Alexander <admin@m-a-styles.de>2012-12-09 21:02:31 +0100
commit1aae72961a3205a8487218b6d69361c43a1297d6 (patch)
tree3096a599c14c88084f782022f002ed84224ccf8b /phpBB/includes/ucp/ucp_prefs.php
parent26bde05a30c7111b57621a37d86425aa69d74263 (diff)
parent3fe381eed561e724700b21789e28ea3efb1f7ef9 (diff)
downloadforums-1aae72961a3205a8487218b6d69361c43a1297d6.tar
forums-1aae72961a3205a8487218b6d69361c43a1297d6.tar.gz
forums-1aae72961a3205a8487218b6d69361c43a1297d6.tar.bz2
forums-1aae72961a3205a8487218b6d69361c43a1297d6.tar.xz
forums-1aae72961a3205a8487218b6d69361c43a1297d6.zip
Merge branch 'develop' into feature/avatars
Conflicts: phpBB/install/database_update.php
Diffstat (limited to 'phpBB/includes/ucp/ucp_prefs.php')
-rw-r--r--phpBB/includes/ucp/ucp_prefs.php33
1 files changed, 33 insertions, 0 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'],