diff options
author | Igor Wiedler <igor@wiedler.ch> | 2012-02-17 13:48:48 +0100 |
---|---|---|
committer | Igor Wiedler <igor@wiedler.ch> | 2012-02-17 13:48:48 +0100 |
commit | d70c3f1eb8c0ddc68d8eda1bd8708c4957c21182 (patch) | |
tree | c0081f9deac588982d2e00cf935daabb03af6605 /phpBB/includes/functions_user.php | |
parent | 7295e5824aed6f5ec32cfab0ad17cfa2c24855ac (diff) | |
parent | 9611b5ff83582d7bda22ab991e8d69786dab5b93 (diff) | |
download | forums-d70c3f1eb8c0ddc68d8eda1bd8708c4957c21182.tar forums-d70c3f1eb8c0ddc68d8eda1bd8708c4957c21182.tar.gz forums-d70c3f1eb8c0ddc68d8eda1bd8708c4957c21182.tar.bz2 forums-d70c3f1eb8c0ddc68d8eda1bd8708c4957c21182.tar.xz forums-d70c3f1eb8c0ddc68d8eda1bd8708c4957c21182.zip |
Merge branch 'develop' into ticket/10380
* develop: (325 commits)
[ticket/10641] Update MCP template with new plurality forms
[ticket/10637] Leftovers from implementation of extensions in convertor
[ticket/10637] Leftovers from implementation of extensions in develop tools
[ticket/10637] Leftovers from implementation of extensions in mcp_post
[ticket/10637] Leftovers from implementation of extensions in mcp_main
[ticket/10637] Leftovers from implementation of extensions
[ticket/10606] Also correctly use $s_search_hidden_fields in view(forum|topic).
[ticket/10606] Fix incorrect hidden fields array name in page_header().
[ticket/10633] Stop leaking filename of attachments when thumbnail is requested
[ticket/10636] Resolve variable name ($sql_ary) conflict in cache_moderators().
[ticket/10634] Specify module type when viewing profile
[ticket/10634] Changing p_master::is_full_class
[ticket/10569] Invalid string comparison in prosilver
[ticket/10495] Update request/type_cast_helper for PHP 5.4 magic_quotes_gpc drop
[ticket/10512] Call startup.php from tests/bootstrap.php
[ticket/10535] Delete no longer needed email confirm language entries.
[ticket/9914] Add backup warning to updater.
[ticket/10616] Add template inheritance to exported template
[ticket/10616] Ignore template inheritance that points to self
[ticket/10616] Add template inheritance to default styles
...
Diffstat (limited to 'phpBB/includes/functions_user.php')
-rw-r--r-- | phpBB/includes/functions_user.php | 46 |
1 files changed, 40 insertions, 6 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 930cd4625f..509e1a953c 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -2,9 +2,8 @@ /** * * @package phpBB3 -* @version $Id$ * @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ @@ -2039,7 +2038,7 @@ function avatar_remote($data, &$error) { if ($width > $config['avatar_max_width'] || $height > $config['avatar_max_height']) { - $error[] = sprintf($user->lang['AVATAR_WRONG_SIZE'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], $width, $height); + $error[] = phpbb_avatar_error_wrong_size($width, $height); return false; } } @@ -2048,7 +2047,7 @@ function avatar_remote($data, &$error) { if ($width < $config['avatar_min_width'] || $height < $config['avatar_min_height']) { - $error[] = sprintf($user->lang['AVATAR_WRONG_SIZE'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], $width, $height); + $error[] = phpbb_avatar_error_wrong_size($width, $height); return false; } } @@ -2388,7 +2387,7 @@ function avatar_process_user(&$error, $custom_userdata = false, $can_upload = nu { if ($data['width'] > $config['avatar_max_width'] || $data['height'] > $config['avatar_max_height']) { - $error[] = sprintf($user->lang['AVATAR_WRONG_SIZE'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], $data['width'], $data['height']); + $error[] = phpbb_avatar_error_wrong_size($data['width'], $data['height']); } } @@ -2398,7 +2397,7 @@ function avatar_process_user(&$error, $custom_userdata = false, $can_upload = nu { if ($data['width'] < $config['avatar_min_width'] || $data['height'] < $config['avatar_min_height']) { - $error[] = sprintf($user->lang['AVATAR_WRONG_SIZE'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], $data['width'], $data['height']); + $error[] = phpbb_avatar_error_wrong_size($data['width'], $data['height']); } } } @@ -2444,6 +2443,41 @@ function avatar_process_user(&$error, $custom_userdata = false, $can_upload = nu return (sizeof($error)) ? false : true; } +/** +* Returns a language string with the avatar size of the new avatar and the allowed maximum and minimum +* +* @param $width int The width of the new uploaded/selected avatar +* @param $height int The height of the new uploaded/selected avatar +* @return string +*/ +function phpbb_avatar_error_wrong_size($width, $height) +{ + global $config, $user; + + return $user->lang('AVATAR_WRONG_SIZE', + $user->lang('PIXELS', (int) $config['avatar_min_width']), + $user->lang('PIXELS', (int) $config['avatar_min_height']), + $user->lang('PIXELS', (int) $config['avatar_max_width']), + $user->lang('PIXELS', (int) $config['avatar_max_height']), + $user->lang('PIXELS', (int) $width), + $user->lang('PIXELS', (int) $height)); +} + +/** +* Returns an explanation string with maximum avatar settings +* +* @return string +*/ +function phpbb_avatar_explanation_string() +{ + global $config, $user; + + return $user->lang('AVATAR_EXPLAIN', + $user->lang('PIXELS', (int) $config['avatar_max_width']), + $user->lang('PIXELS', (int) $config['avatar_max_height']), + round($config['avatar_filesize'] / 1024)); +} + // // Usergroup functions // |