aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/download.php2
-rw-r--r--phpBB/includes/acp/acp_groups.php25
-rw-r--r--phpBB/includes/acp/acp_modules.php4
-rw-r--r--phpBB/includes/acp/acp_users.php25
-rw-r--r--phpBB/includes/db/mssql_odbc.php8
-rw-r--r--phpBB/includes/functions_admin.php6
-rw-r--r--phpBB/includes/functions_display.php39
-rwxr-xr-xphpBB/includes/mcp/mcp_notes.php24
-rwxr-xr-xphpBB/includes/mcp/mcp_warn.php48
-rw-r--r--phpBB/includes/message_parser.php13
-rw-r--r--phpBB/includes/session.php1
-rw-r--r--phpBB/includes/ucp/ucp_groups.php25
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php4
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewmessage.php54
-rw-r--r--phpBB/includes/ucp/ucp_profile.php24
-rw-r--r--phpBB/language/en/acp/email.php2
-rw-r--r--phpBB/language/en/acp/permissions.php2
-rw-r--r--phpBB/language/en/common.php2
-rw-r--r--phpBB/language/en/ucp.php2
-rw-r--r--phpBB/language/en/viewforum.php1
-rw-r--r--phpBB/memberlist.php38
-rw-r--r--phpBB/styles/prosilver/template/attachment.html4
-rw-r--r--phpBB/styles/prosilver/template/memberlist_email.html6
-rw-r--r--phpBB/styles/prosilver/template/posting_buttons.html2
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_email.html2
-rw-r--r--phpBB/styles/subsilver2/template/posting_body.html4
-rw-r--r--phpBB/styles/subsilver2/template/posting_smilies.html2
-rw-r--r--phpBB/styles/subsilver2/template/ucp_header.html6
-rw-r--r--phpBB/styles/subsilver2/template/viewforum_body.html2
-rw-r--r--phpBB/viewtopic.php21
30 files changed, 122 insertions, 276 deletions
diff --git a/phpBB/download.php b/phpBB/download.php
index 16b4bfa76e..b333023872 100644
--- a/phpBB/download.php
+++ b/phpBB/download.php
@@ -240,7 +240,7 @@ function send_file_to_browser($attachment, $upload_dir, $category)
// Send out the Headers. Do not set Content-Disposition to inline please, it is a security measure for users using the Internet Explorer.
header('Content-Type: ' . $attachment['mimetype']);
- header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename($attachment['real_filename']));
+ header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
if ($size)
{
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php
index cbf46a1dc1..29000b2c63 100644
--- a/phpBB/includes/acp/acp_groups.php
+++ b/phpBB/includes/acp/acp_groups.php
@@ -235,6 +235,8 @@ class acp_groups
case 'edit':
case 'add':
+ include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+
$data = $submit_ary = array();
if ($action == 'edit' && !$group_id)
@@ -486,28 +488,7 @@ class acp_groups
$type_closed = ($group_type == GROUP_CLOSED) ? ' checked="checked"' : '';
$type_hidden = ($group_type == GROUP_HIDDEN) ? ' checked="checked"' : '';
- if (isset($group_row['group_avatar']) && $group_row['group_avatar'])
- {
- $avatar_img = '';
-
- switch ($group_row['group_avatar_type'])
- {
- case AVATAR_UPLOAD:
- $avatar_img = $phpbb_root_path . $config['avatar_path'] . '/';
- break;
-
- case AVATAR_GALLERY:
- $avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
- break;
- }
-
- $avatar_img .= $group_row['group_avatar'];
- $avatar_img = '<img src="' . $avatar_img . '" width="' . $group_row['group_avatar_width'] . '" height="' . $group_row['group_avatar_height'] . '" alt="" />';
- }
- else
- {
- $avatar_img = '<img src="' . $phpbb_admin_path . 'images/no_avatar.gif" alt="" />';
- }
+ $avatar_img = (!empty($group_row['group_avatar'])) ? get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR') : '<img src="' . $phpbb_admin_path . 'images/no_avatar.gif" alt="" />';
$display_gallery = (isset($_POST['display_gallery'])) ? true : false;
diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php
index 585549fb99..8b54589707 100644
--- a/phpBB/includes/acp/acp_modules.php
+++ b/phpBB/includes/acp/acp_modules.php
@@ -741,6 +741,10 @@ class acp_modules
trigger_error($user->lang['PARENT_NO_EXIST'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
+ // Workaround
+ $row['left_id'] = (int) $row['left_id'];
+ $row['right_id'] = (int) $row['right_id'];
+
$sql = 'UPDATE ' . MODULES_TABLE . "
SET left_id = left_id + 2, right_id = right_id + 2
WHERE module_class = '" . $db->sql_escape($module_data['module_class']) . "'
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 54fa34677e..7312dd3bf0 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -1336,6 +1336,8 @@ class acp_users
case 'avatar':
+ include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+
$can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && is_writeable($phpbb_root_path . $config['avatar_path']) && $file_uploads) ? true : false;
if ($submit)
@@ -1350,28 +1352,7 @@ class acp_users
}
// Generate users avatar
- if ($user_row['user_avatar'])
- {
- $avatar_img = '';
-
- switch ($user_row['user_avatar_type'])
- {
- case AVATAR_UPLOAD:
- $avatar_img = $phpbb_root_path . $config['avatar_path'] . '/';
- break;
-
- case AVATAR_GALLERY:
- $avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
- break;
- }
-
- $avatar_img .= $user_row['user_avatar'];
- $avatar_img = '<img src="' . $avatar_img . '" width="' . $user_row['user_avatar_width'] . '" height="' . $user_row['user_avatar_height'] . '" alt="" />';
- }
- else
- {
- $avatar_img = '<img src="' . $phpbb_admin_path . 'images/no_avatar.gif" alt="" />';
- }
+ $avatar_img = ($user_row['user_avatar']) ? get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']) : '<img src="' . $phpbb_admin_path . 'images/no_avatar.gif" alt="" />';
$display_gallery = (isset($_POST['display_gallery'])) ? true : false;
$avatar_select = basename(request_var('avatar_select', ''));
diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php
index ab3bd2a164..5fa14a66b6 100644
--- a/phpBB/includes/db/mssql_odbc.php
+++ b/phpBB/includes/db/mssql_odbc.php
@@ -22,6 +22,11 @@ include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
* Unified ODBC functions
* Unified ODBC functions support any database having ODBC driver, for example Adabas D, IBM DB2, iODBC, Solid, Sybase SQL Anywhere...
* Here we only support MSSQL Server 2000+ because of the provided schema
+*
+* @note number of bytes returned for returning data depends on odbc.defaultlrl php.ini setting.
+* If it is limited to 4K for example only 4K of data is returned max, resulting in incomplete theme data for example.
+* @note odbc.defaultbinmode may affect UTF8 characters
+*
* @package dbal
*/
class dbal_mssql_odbc extends dbal
@@ -195,8 +200,9 @@ class dbal_mssql_odbc extends dbal
/**
* Fetch current row
+ * @note number of bytes returned depends on odbc.defaultlrl php.ini setting. If it is limited to 4K for example only 4K of data is returned max.
*/
- function sql_fetchrow($query_id = false)
+ function sql_fetchrow($query_id = false, $debug = false)
{
global $cache;
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 7437255f2f..07d0a5d4c2 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -1352,13 +1352,13 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
$post_ids = array();
while ($row = $db->sql_fetchrow($result))
{
- if (!isset($post_attachment[$row['post_id']]))
+ if (!isset($post_attachment[$row['post_msg_id']]))
{
- $post_ids[] = $row['post_id'];
+ $post_ids[] = $row['post_msg_id'];
}
else
{
- unset($post_attachment[$row['post_id']]);
+ unset($post_attachment[$row['post_msg_id']]);
}
}
$db->sql_freeresult($result);
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 23e2cd4106..01f694afd1 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -706,7 +706,7 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold
{
$topic_type = $user->lang['VIEW_TOPIC_MOVED'];
$folder_img = 'topic_moved';
- $folder_alt = 'VIEW_TOPIC_MOVED';
+ $folder_alt = 'TOPIC_MOVED';
}
else
{
@@ -1096,4 +1096,41 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank
}
}
+/**
+* Get user avatar
+*
+* @param string $avatar Users assigned avatar name
+* @param int $avatar_type Type of avatar
+* @param string $avatar_width Width of users avatar
+* @param string $avatar_height Height of users avatar
+* @param string $alt Optional language string for alt tag within image, can be a language key or text
+*
+* @return string Avatar image
+*/
+function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR')
+{
+ global $user, $config, $phpbb_root_path;
+
+ if (empty($avatar) || !$avatar_type)
+ {
+ return '';
+ }
+
+ $avatar_img = '';
+
+ switch ($avatar_type)
+ {
+ case AVATAR_UPLOAD:
+ $avatar_img = $phpbb_root_path . $config['avatar_path'] . '/';
+ break;
+
+ case AVATAR_GALLERY:
+ $avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
+ break;
+ }
+
+ $avatar_img .= $avatar;
+ return '<img src="' . $avatar_img . '" width="' . $avatar_width . '" height="' . $avatar_height . '" alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
+}
+
?> \ No newline at end of file
diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php
index 1b3c36ac22..9d4b522fe4 100755
--- a/phpBB/includes/mcp/mcp_notes.php
+++ b/phpBB/includes/mcp/mcp_notes.php
@@ -141,28 +141,14 @@ class mcp_notes
}
// Generate the appropriate user information for the user we are looking at
- $rank_title = $rank_img = '';
-// get_user_rank($userrow['user_rank'], $userrow['user_posts'], $rank_title, $rank_img);
-
- $avatar_img = '';
-
- if (!empty($userrow['user_avatar']))
+ if (!function_exists('get_user_avatar'))
{
- switch ($userrow['user_avatar_type'])
- {
- case AVATAR_UPLOAD:
- $avatar_img = $config['avatar_path'] . '/';
- break;
-
- case AVATAR_GALLERY:
- $avatar_img = $config['avatar_gallery_path'] . '/';
- break;
- }
-
- $avatar_img .= $userrow['user_avatar'];
- $avatar_img = '<img src="' . $avatar_img . '" width="' . $userrow['user_avatar_width'] . '" height="' . $userrow['user_avatar_height'] . '" alt="" />';
+ include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
}
+ $rank_title = $rank_img = '';
+ $avatar_img = get_user_avatar($userrow['user_avatar'], $userrow['user_avatar_type'], $userrow['user_avatar_width'], $userrow['user_avatar_height']);
+
$limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
$sort_by_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_DATE'], 'c' => $user->lang['SORT_IP'], 'd' => $user->lang['SORT_ACTION']);
$sort_by_sql = array('a' => 'u.username_clean', 'b' => 'l.log_time', 'c' => 'l.log_ip', 'd' => 'l.log_operation');
diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php
index ea414d2bfd..6d3961de2f 100755
--- a/phpBB/includes/mcp/mcp_warn.php
+++ b/phpBB/includes/mcp/mcp_warn.php
@@ -272,28 +272,14 @@ function mcp_warn_post_view($id, $mode, $action)
$message = smiley_text($message);
// Generate the appropriate user information for the user we are looking at
- $rank_title = $rank_img = '';
-// get_user_rank($user_row['user_rank'], $user_row['user_posts'], $rank_title, $rank_img);
-
- $avatar_img = '';
-
- if (!empty($user_row['user_avatar']))
+ if (!function_exists('get_user_avatar'))
{
- switch ($user_row['user_avatar_type'])
- {
- case AVATAR_UPLOAD:
- $avatar_img = $config['avatar_path'] . '/';
- break;
-
- case AVATAR_GALLERY:
- $avatar_img = $config['avatar_gallery_path'] . '/';
- break;
- }
-
- $avatar_img .= $user_row['user_avatar'];
- $avatar_img = '<img src="' . $avatar_img . '" width="' . $user_row['user_avatar_width'] . '" height="' . $user_row['user_avatar_height'] . '" alt="" />';
+ include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
}
+ $rank_title = $rank_img = '';
+ $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(
'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;mode=$mode&amp;p=$post_id"),
@@ -357,28 +343,14 @@ function mcp_warn_user_view($id, $mode, $action)
}
// Generate the appropriate user information for the user we are looking at
- $rank_title = $rank_img = '';
-// get_user_rank($user_row['user_rank'], $user_row['user_posts'], $rank_title, $rank_img);
-
- $avatar_img = '';
-
- if (!empty($user_row['user_avatar']))
+ if (!function_exists('get_user_avatar'))
{
- switch ($user_row['user_avatar_type'])
- {
- case AVATAR_UPLOAD:
- $avatar_img = $config['avatar_path'] . '/';
- break;
-
- case AVATAR_GALLERY:
- $avatar_img = $config['avatar_gallery_path'] . '/';
- break;
- }
-
- $avatar_img .= $user_row['user_avatar'];
- $avatar_img = '<img src="' . $avatar_img . '" width="' . $user_row['user_avatar_width'] . '" height="' . $user_row['user_avatar_height'] . '" alt="" />';
+ include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
}
+ $rank_title = $rank_img = '';
+ $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
$template->assign_vars(array(
'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;mode=$mode&amp;u=$user_id"),
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index 97e977a42b..44bebc20c6 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -200,6 +200,8 @@ class bbcode_firstpass extends bbcode
if ($config['max_' . $this->mode . '_font_size'] && $config['max_' . $this->mode . '_font_size'] < $stx)
{
$this->warn_msg[] = sprintf($user->lang['MAX_FONT_SIZE_EXCEEDED'], $config['max_' . $this->mode . '_font_size']);
+
+ return '[size=' . $stx . ']' . $in . '[/size]';
}
return '[size=' . $stx . ':' . $this->bbcode_uid . ']' . $in . '[/size:' . $this->bbcode_uid . ']';
@@ -270,6 +272,7 @@ class bbcode_firstpass extends bbcode
}
$in = trim($in);
+ $error = false;
if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width'])
{
@@ -277,23 +280,26 @@ class bbcode_firstpass extends bbcode
if ($stats === false)
{
+ $error = true;
$this->warn_msg[] = $user->lang['UNABLE_GET_IMAGE_SIZE'];
}
else
{
if ($config['max_' . $this->mode . '_img_height'] && $config['max_' . $this->mode . '_img_height'] < $stats[1])
{
+ $error = true;
$this->warn_msg[] = sprintf($user->lang['MAX_IMG_HEIGHT_EXCEEDED'], $config['max_' . $this->mode . '_img_height']);
}
if ($config['max_' . $this->mode . '_img_width'] && $config['max_' . $this->mode . '_img_width'] < $stats[0])
{
+ $error = true;
$this->warn_msg[] = sprintf($user->lang['MAX_IMG_WIDTH_EXCEEDED'], $config['max_' . $this->mode . '_img_width']);
}
}
}
- if ($this->path_in_domain($in))
+ if ($error || $this->path_in_domain($in))
{
return '[img]' . $in . '[/img]';
}
@@ -314,22 +320,25 @@ class bbcode_firstpass extends bbcode
}
$in = trim($in);
+ $error = false;
// Apply the same size checks on flash files as on images
if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width'])
{
if ($config['max_' . $this->mode . '_img_height'] && $config['max_' . $this->mode . '_img_height'] < $height)
{
+ $error = true;
$this->warn_msg[] = sprintf($user->lang['MAX_FLASH_HEIGHT_EXCEEDED'], $config['max_' . $this->mode . '_img_height']);
}
if ($config['max_' . $this->mode . '_img_width'] && $config['max_' . $this->mode . '_img_width'] < $width)
{
+ $error = true;
$this->warn_msg[] = sprintf($user->lang['MAX_FLASH_WIDTH_EXCEEDED'], $config['max_' . $this->mode . '_img_width']);
}
}
- if ($this->path_in_domain($in))
+ if ($error || $this->path_in_domain($in))
{
return '[flash=' . $width . ',' . $height . ']' . $in . '[/flash]';
}
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 1dfeb43fd3..bc608426b9 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -55,7 +55,6 @@ class session
if (strpos($argument, 'sid=') === 0 || strpos($argument, '_f_=') === 0)
{
unset($args[$key]);
- break;
}
}
diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php
index 5445d661b7..519c0220e7 100644
--- a/phpBB/includes/ucp/ucp_groups.php
+++ b/phpBB/includes/ucp/ucp_groups.php
@@ -419,6 +419,8 @@ class ucp_groups
{
case 'edit':
+ include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+
if (!$group_id)
{
trigger_error($user->lang['NO_GROUP'] . $return_page);
@@ -626,28 +628,7 @@ class ucp_groups
$type_closed = ($group_type == GROUP_CLOSED) ? ' checked="checked"' : '';
$type_hidden = ($group_type == GROUP_HIDDEN) ? ' checked="checked"' : '';
- if (isset($group_row['group_avatar']) && $group_row['group_avatar'])
- {
- $avatar_img = '';
-
- switch ($group_row['group_avatar_type'])
- {
- case AVATAR_UPLOAD:
- $avatar_img = $phpbb_root_path . $config['avatar_path'] . '/';
- break;
-
- case AVATAR_GALLERY:
- $avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
- break;
- }
-
- $avatar_img .= $group_row['group_avatar'];
- $avatar_img = '<img src="' . $avatar_img . '" width="' . $group_row['group_avatar_width'] . '" height="' . $group_row['group_avatar_height'] . '" alt="" />';
- }
- else
- {
- $avatar_img = '<img src="' . $phpbb_root_path . 'adm/images/no_avatar.gif" alt="" />';
- }
+ $avatar_img = (!empty($group_row['group_avatar'])) ? get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR') : '<img src="' . $phpbb_root_path . 'adm/images/no_avatar.gif" alt="" />';
$display_gallery = (isset($_POST['display_gallery'])) ? true : false;
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index b6f737ceb9..6c9bfdbdb3 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -91,8 +91,8 @@ function compose_pm($id, $mode, $action)
'S_SHOW_PM_BOX' => true,
'S_ALLOW_MASS_PM' => ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? true : false,
'S_GROUP_OPTIONS' => ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? $group_options : '',
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=searchuser&amp;form=post&amp;field=username_list&amp;select_single=$select_single"),
- 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=searchuser&form=post&field=username_list&select_single=$select_single", false))
+ 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=searchuser&amp;form=postform&amp;field=username_list&amp;select_single=$select_single"),
+ 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=searchuser&form=postform&field=username_list&select_single=$select_single", false))
);
}
diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php
index 056a84c8e7..ff760e9142 100644
--- a/phpBB/includes/ucp/ucp_pm_viewmessage.php
+++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php
@@ -390,8 +390,9 @@ function get_user_information($user_id, $user_row)
$db->sql_freeresult($result);
}
- // Grab ranks
- $ranks = $cache->obtain_ranks();
+ // Some standard values
+ $user_row['online'] = false;
+ $user_row['rank_title'] = $user_row['rank_image'] = $user_row['rank_image_src'] = $user_row['email'] = '';
// Generate online information for user
if ($config['load_onlinetrack'])
@@ -410,61 +411,20 @@ function get_user_information($user_id, $user_row)
$user_row['online'] = (time() - $update_time < $row['online_time'] && ($row['viewonline'] && $user_row['user_allow_viewonline'])) ? true : false;
}
}
- else
- {
- $user_row['online'] = false;
- }
- if ($user_row['user_avatar'] && $user->optionget('viewavatars'))
+ if (!function_exists('get_user_avatar'))
{
- $avatar_img = '';
-
- switch ($user_row['user_avatar_type'])
- {
- case AVATAR_UPLOAD:
- $avatar_img = $config['avatar_path'] . '/';
- break;
-
- case AVATAR_GALLERY:
- $avatar_img = $config['avatar_gallery_path'] . '/';
- break;
- }
-
- $avatar_img .= $user_row['user_avatar'];
- $user_row['avatar'] = '<img src="' . $avatar_img . '" width="' . $user_row['user_avatar_width'] . '" height="' . $user_row['user_avatar_height'] . '" alt="' . $user->lang['USER_AVATAR'] . '" />';
+ include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
}
- $user_row['rank_title'] = $user_row['rank_image'] = '';
+ $user_row['avatar'] = ($user->optionget('viewavatars')) ? get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']) : '';
- if (!empty($user_row['user_rank']))
- {
- $user_row['rank_title'] = (isset($ranks['special'][$user_row['user_rank']])) ? $ranks['special'][$user_row['user_rank']]['rank_title'] : '';
- $user_row['rank_image'] = (!empty($ranks['special'][$user_row['user_rank']]['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $ranks['special'][$user_row['user_rank']]['rank_image'] . '" alt="' . $ranks['special'][$user_row['user_rank']]['rank_title'] . '" title="' . $ranks['special'][$user_row['user_rank']]['rank_title'] . '" /><br />' : '';
- }
- else
- {
- if (isset($ranks['normal']))
- {
- foreach ($ranks['normal'] as $rank)
- {
- if ($user_row['user_posts'] >= $rank['rank_min'])
- {
- $user_row['rank_title'] = $rank['rank_title'];
- $user_row['rank_image'] = (!empty($rank['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $rank['rank_image'] . '" alt="' . $rank['rank_title'] . '" title="' . $rank['rank_title'] . '" /><br />' : '';
- break;
- }
- }
- }
- }
+ get_user_rank($user_row['user_rank'], $user_row['user_posts'], $user_row['rank_title'], $user_row['rank_image'], $user_row['rank_image_src']);
if (!empty($user_row['user_allow_viewemail']) || $auth->acl_get('a_email'))
{
$user_row['email'] = ($config['board_email_form'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=email&amp;u=$user_id") : ((($config['board_hide_emails'] && !$auth->acl_get('a_email')) || empty($user_row['user_email'])) ? '' : 'mailto:' . $user_row['user_email']);
}
- else
- {
- $user_row['email'] = '';
- }
return $user_row;
}
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 8c9a9bdccf..3cee288098 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -507,6 +507,8 @@ class ucp_profile
case 'avatar':
+ include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+
$display_gallery = request_var('display_gallery', '0');
$avatar_select = basename(request_var('avatar_select', ''));
$category = basename(request_var('category', ''));
@@ -526,29 +528,9 @@ class ucp_profile
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
}
- // Generate users avatar
- $avatar_img = '';
-
- if ($user->data['user_avatar'])
- {
- switch ($user->data['user_avatar_type'])
- {
- case AVATAR_UPLOAD:
- $avatar_img = $phpbb_root_path . $config['avatar_path'] . '/';
- break;
-
- case AVATAR_GALLERY:
- $avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
- break;
- }
-
- $avatar_img .= $user->data['user_avatar'];
- $avatar_img = '<img src="' . $avatar_img . '" width="' . $user->data['user_avatar_width'] . '" height="' . $user->data['user_avatar_height'] . '" alt="" />';
- }
-
$template->assign_vars(array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
- 'AVATAR' => $avatar_img,
+ 'AVATAR' => get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height']),
'AVATAR_SIZE' => $config['avatar_filesize'],
'U_GALLERY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=profile&amp;mode=avatar&amp;display_gallery=1'),
diff --git a/phpBB/language/en/acp/email.php b/phpBB/language/en/acp/email.php
index 14ee520b04..190fd7949e 100644
--- a/phpBB/language/en/acp/email.php
+++ b/phpBB/language/en/acp/email.php
@@ -32,7 +32,7 @@ if (empty($lang) || !is_array($lang))
// Email settings
$lang = array_merge($lang, array(
- 'ACP_MASS_EMAIL_EXPLAIN' => 'Here you can email a message to either all of your users or all users of a specific group <strong>having the option to receive mass emails enabled</strong>. To do this, an email will be sent out to the administrative email address supplied, with a blind carbon copy sent to all recipients. If you are emailing a large group of people please be patient after submitting and do not stop the page halfway through. It is normal for a mass emailing to take a long time, you will be notified when the script has completed',
+ 'ACP_MASS_EMAIL_EXPLAIN' => 'Here you can email a message to either all of your users or all users of a specific group <strong>having the option to receive mass emails enabled</strong>. To achive this an email will be sent out to the administrative email address supplied, with a blind carbon copy sent to all recipients. The default setting is to only include 50 recipients in such an email, for more recipients more emails will be sent. If you are emailing a large group of people please be patient after submitting and do not stop the page halfway through. It is normal for a mass emailing to take a long time, you will be notified when the script has completed.',
'ALL_USERS' => 'All users',
'COMPOSE' => 'Compose',
diff --git a/phpBB/language/en/acp/permissions.php b/phpBB/language/en/acp/permissions.php
index 31ded03e38..7880910d7e 100644
--- a/phpBB/language/en/acp/permissions.php
+++ b/phpBB/language/en/acp/permissions.php
@@ -110,7 +110,7 @@ $lang = array_merge($lang, array(
'DEFAULT' => 'Default',
'DELETE_ROLE' => 'Delete role',
- 'DELETE_ROLE_CONFIRM' => 'Are you sure you want to remove this role? Items having this role assigned will <strong>not</strong> loosing their permission settings.',
+ 'DELETE_ROLE_CONFIRM' => 'Are you sure you want to remove this role? Items having this role assigned will <strong>not</strong> loose their permission settings.',
'DISPLAY_ROLE_ITEMS' => 'View items using this role',
'EDIT_PERMISSIONS' => 'Edit permissions',
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index 17f4ae3378..1bf7d27d25 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -560,7 +560,7 @@ $lang = array_merge($lang, array(
'TOTAL_LOGS' => '%d logs',
'TOTAL_NO_PM' => '0 private messages in total',
'TOTAL_PM' => '1 private messages in total',
- 'TOTAL_PMS' => '$d private messages in total',
+ 'TOTAL_PMS' => '%d private messages in total',
'TOTAL_POSTS' => 'Total posts',
'TOTAL_POSTS_OTHER' => 'Total posts <strong>%d</strong>',
'TOTAL_POSTS_ZERO' => 'Total posts <strong>0</strong>',
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index 872c1a9d98..ca656b7a84 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -182,7 +182,7 @@ $lang = array_merge($lang, array(
'FIELD_INVALID_DATE' => 'The field ā€œ%sā€ has an invalid date.',
'FOE_MESSAGE' => 'Message from foe',
- 'FOES_EXPLAIN' => 'Foes are users which will be ignored by default. Posts by these users will not be fully visible and personal messages will not be permitted. Please note that you cannot ignore moderators or administrators.',
+ 'FOES_EXPLAIN' => 'Foes are users which will be ignored by default. Posts by these users will not be fully visible. Personal messages from foes are still permitted. Please note that you cannot ignore moderators or administrators.',
'FOES_UPDATED' => 'Your foes list has been updated successfully',
'FOLDER_ADDED' => 'Folder successfully added',
'FOLDER_MESSAGE_STATUS' => '%1$d from %2$d messages stored',
diff --git a/phpBB/language/en/viewforum.php b/phpBB/language/en/viewforum.php
index 8a1802b414..00c54d7137 100644
--- a/phpBB/language/en/viewforum.php
+++ b/phpBB/language/en/viewforum.php
@@ -42,7 +42,6 @@ $lang = array_merge($lang, array(
'LOGIN_NOTIFY_FORUM' => 'You have been notified about this forum, please login to view it.',
'MARK_TOPICS_READ' => 'Mark topics read',
- 'MOVED_TOPIC' => 'Moved topic',
'NEW_POSTS_HOT' => 'New posts [ Popular ]',
'NEW_POSTS_LOCKED' => 'New posts [ Locked ]',
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index 7177be0714..bad74fe12d 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -467,23 +467,7 @@ switch ($mode)
$member['user_sig'] = smiley_text($member['user_sig']);
}
- $poster_avatar = '';
- if (!empty($member['user_avatar']))
- {
- switch ($member['user_avatar_type'])
- {
- case AVATAR_UPLOAD:
- $poster_avatar = $config['avatar_path'] . '/';
- break;
-
- case AVATAR_GALLERY:
- $poster_avatar = $config['avatar_gallery_path'] . '/';
- break;
- }
- $poster_avatar .= $member['user_avatar'];
-
- $poster_avatar = '<img src="' . $poster_avatar . '" width="' . $member['user_avatar_width'] . '" height="' . $member['user_avatar_height'] . '" alt="" />';
- }
+ $poster_avatar = get_user_avatar($member['user_avatar'], $member['user_avatar_type'], $member['user_avatar_width'], $member['user_avatar_height']);
$template->assign_vars(show_profile($member));
@@ -1079,24 +1063,8 @@ switch ($mode)
break;
}
- $avatar_img = '';
-
- if ($group_row['group_avatar'])
- {
- switch ($group_row['group_avatar_type'])
- {
- case AVATAR_UPLOAD:
- $avatar_img = $phpbb_root_path . $config['avatar_path'] . '/';
- break;
-
- case AVATAR_GALLERY:
- $avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
- break;
- }
-
- $avatar_img .= $group_row['group_avatar'];
- $avatar_img = '<img src="' . $avatar_img . '" width="' . $group_row['group_avatar_width'] . '" height="' . $group_row['group_avatar_height'] . '" alt="" />';
- }
+ // Misusing the avatar function for displaying group avatars...
+ $avatar_img = get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR');
$rank_title = $rank_img = $rank_img_src = '';
if ($group_row['group_rank'])
diff --git a/phpBB/styles/prosilver/template/attachment.html b/phpBB/styles/prosilver/template/attachment.html
index 0ea4e35cae..7f6e403026 100644
--- a/phpBB/styles/prosilver/template/attachment.html
+++ b/phpBB/styles/prosilver/template/attachment.html
@@ -6,7 +6,7 @@
<!-- IF _file.S_THUMBNAIL -->
<dl class="thumbnail">
- <dt><a href="{_file.U_DOWNLOAD_LINK}"><img src="{_file.THUMB_IMAGE}" alt="{_file.DOWNLOAD_NAME}" title="{_file.DOWNLOAD_NAME} ({_file.FILESIZE} {_file.SIZE_LANG}) [ {_file.L_DOWNLOAD_COUNT} ]" /></a></dt>
+ <dt><a href="{_file.U_DOWNLOAD_LINK}"><img src="{_file.THUMB_IMAGE}" alt="{_file.DOWNLOAD_NAME}" title="{_file.DOWNLOAD_NAME} ({_file.FILESIZE} {_file.SIZE_LANG}) {_file.L_DOWNLOAD_COUNT}" /></a></dt>
<!-- IF _file.COMMENT --><dd> {_file.COMMENT}</dd><!-- ENDIF -->
</dl>
@@ -17,7 +17,7 @@
<img src="{_file.U_DOWNLOAD_LINK}" alt="{_file.DOWNLOAD_NAME}" onclick="viewableArea(this);" />
- <p>{_file.DOWNLOAD_NAME} ({_file.FILESIZE} {_file.SIZE_LANG}) {_file.L_DOWNLOAD_COUNT} ]</p>
+ <p>{_file.DOWNLOAD_NAME} ({_file.FILESIZE} {_file.SIZE_LANG}) {_file.L_DOWNLOAD_COUNT}</p>
<!-- ENDIF -->
<!-- IF _file.S_FILE -->
diff --git a/phpBB/styles/prosilver/template/memberlist_email.html b/phpBB/styles/prosilver/template/memberlist_email.html
index 355e067a65..614efa73ee 100644
--- a/phpBB/styles/prosilver/template/memberlist_email.html
+++ b/phpBB/styles/prosilver/template/memberlist_email.html
@@ -45,16 +45,16 @@ function checkForm(formObj)
</dl>
<dl>
<dt><label for="subject">{L_SUBJECT}:</label></dt>
- <dd><input class="inputbox auto" type="text" name="subject" id="subject" size="50" maxlength="100" tabindex="1" value="{SUBJECT}" /></dd>
+ <dd><input class="inputbox autowidth" type="text" name="subject" id="subject" size="50" maxlength="100" tabindex="1" value="{SUBJECT}" /></dd>
</dl>
<!-- ELSE -->
<dl>
<dt><label for="email">{L_EMAIL_ADDRESS}:</label></dt>
- <dd><input class="inputbox" type="text" name="email" id="email" size="50" maxlength="100" tabindex="2" value="{EMAIL}" /></dd>
+ <dd><input class="inputbox autowidth" type="text" name="email" id="email" size="50" maxlength="100" tabindex="2" value="{EMAIL}" /></dd>
</dl>
<dl>
<dt><label for="name">{L_REAL_NAME}:</label></dt>
- <dd><input class="inputbox" type="text" name="name" id="name" size="50" maxlength="100" tabindex="3" value="{NAME}" /></dd>
+ <dd><input class="inputbox autowidth" type="text" name="name" id="name" size="50" maxlength="100" tabindex="3" value="{NAME}" /></dd>
</dl>
<dl>
<dt><label for="lang">{L_DEST_LANG}:</label><br />
diff --git a/phpBB/styles/prosilver/template/posting_buttons.html b/phpBB/styles/prosilver/template/posting_buttons.html
index edf42f6a61..35356f2e84 100644
--- a/phpBB/styles/prosilver/template/posting_buttons.html
+++ b/phpBB/styles/prosilver/template/posting_buttons.html
@@ -1,7 +1,7 @@
<script type="text/javascript">
<!--
var form_name = 'postform';
- var text_name = 'message';
+ var text_name = <!-- IF $SIG_EDIT -->'signature'<!-- ELSE -->'message'<!-- ENDIF -->;
var load_draft = false;
var upload = false;
diff --git a/phpBB/styles/subsilver2/template/memberlist_email.html b/phpBB/styles/subsilver2/template/memberlist_email.html
index ba82dcfce1..ebea654f58 100644
--- a/phpBB/styles/subsilver2/template/memberlist_email.html
+++ b/phpBB/styles/subsilver2/template/memberlist_email.html
@@ -29,7 +29,7 @@ function checkForm(formObj)
<div id="pagecontent">
- <form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this)">
+ <form action="{S_POST_ACTION}" method="post" name="postform" onsubmit="return checkForm(this)">
<table class="tablebg" width="100%" cellspacing="1">
<tr>
diff --git a/phpBB/styles/subsilver2/template/posting_body.html b/phpBB/styles/subsilver2/template/posting_body.html
index 256bbdee5b..483d857f28 100644
--- a/phpBB/styles/subsilver2/template/posting_body.html
+++ b/phpBB/styles/subsilver2/template/posting_body.html
@@ -34,7 +34,7 @@
<!-- ENDIF -->
<!-- IF not S_SHOW_PM_BOX -->
- <form action="{S_POST_ACTION}" method="post" name="post"{S_FORM_ENCTYPE}>
+ <form action="{S_POST_ACTION}" method="post" name="postform"{S_FORM_ENCTYPE}>
<!-- ENDIF -->
<!-- IF S_DRAFT_LOADED -->
@@ -203,7 +203,7 @@
<script type="text/javascript">
<!--
- var form_name = 'post';
+ var form_name = 'postform';
var text_name = 'message';
//-->
</script>
diff --git a/phpBB/styles/subsilver2/template/posting_smilies.html b/phpBB/styles/subsilver2/template/posting_smilies.html
index f48ef66c19..01564c9694 100644
--- a/phpBB/styles/subsilver2/template/posting_smilies.html
+++ b/phpBB/styles/subsilver2/template/posting_smilies.html
@@ -3,7 +3,7 @@
<script type="text/javascript">
<!--
-var form_name = 'post';
+var form_name = 'postform';
var text_name = 'message';
//-->
</script>
diff --git a/phpBB/styles/subsilver2/template/ucp_header.html b/phpBB/styles/subsilver2/template/ucp_header.html
index 7fb507d403..ffbf1199e0 100644
--- a/phpBB/styles/subsilver2/template/ucp_header.html
+++ b/phpBB/styles/subsilver2/template/ucp_header.html
@@ -2,7 +2,7 @@
<!-- IF S_SHOW_PM_BOX and S_POST_ACTION -->
- <form action="{S_POST_ACTION}" method="post" name="post"{S_FORM_ENCTYPE}>
+ <form action="{S_POST_ACTION}" method="post" name="postform"{S_FORM_ENCTYPE}>
<!-- ENDIF -->
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
@@ -15,7 +15,7 @@
</tr>
<!-- IF not S_ALLOW_MASS_PM -->
<tr>
- <td class="row1"><b class="genmed">{L_USERNAME}:</b><br />[ <a href="{U_FIND_USERNAME}" onclick="find_username(); return false">{L_FIND_USERNAME}</a> ]</td>
+ <td class="row1"><b class="genmed">{L_USERNAME}:</b><br />[ <a href="{U_FIND_USERNAME}" onclick="find_username(); return false;">{L_FIND_USERNAME}</a> ]</td>
</tr>
<tr>
@@ -27,7 +27,7 @@
</tr>
<tr>
<td class="row2"><textarea name="username_list" rows="5" cols="22"></textarea><br />
- [ <a href="{U_FIND_USERNAME}" onclick="find_username(); return false">{L_FIND_USERNAME}</a> ]
+ [ <a href="{U_FIND_USERNAME}" onclick="find_username(); return false;">{L_FIND_USERNAME}</a> ]
</td>
</tr>
<!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/viewforum_body.html b/phpBB/styles/subsilver2/template/viewforum_body.html
index 0b724db8d2..5e56042dd1 100644
--- a/phpBB/styles/subsilver2/template/viewforum_body.html
+++ b/phpBB/styles/subsilver2/template/viewforum_body.html
@@ -300,7 +300,7 @@
<td class="gensmall">{L_NO_NEW_POSTS_LOCKED}</td>
<td>&nbsp;&nbsp;</td>
<td style="text-align: center;">{FOLDER_MOVED_IMG}</td>
- <td class="gensmall">{L_MOVED_TOPIC}</td>
+ <td class="gensmall">{L_TOPIC_MOVED}</td>
</tr>
</table>
</td>
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 214bc938e1..48ae70c7d6 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -1021,7 +1021,7 @@ while ($row = $db->sql_fetchrow($result))
'viewonline' => $row['user_allow_viewonline'],
'allow_pm' => $row['user_allow_pm'],
- 'avatar' => '',
+ 'avatar' => ($user->optionget('viewavatars')) ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'], $row['user_avatar_height']) : '',
'age' => '',
'rank_title' => '',
@@ -1041,25 +1041,6 @@ while ($row = $db->sql_fetchrow($result))
'search' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", 'search_author=' . urlencode($row['username']) .'&amp;showresults=posts') : '',
);
- if ($row['user_avatar'] && $user->optionget('viewavatars'))
- {
- $avatar_img = '';
-
- switch ($row['user_avatar_type'])
- {
- case AVATAR_UPLOAD:
- $avatar_img = $config['avatar_path'] . '/';
- break;
-
- case AVATAR_GALLERY:
- $avatar_img = $config['avatar_gallery_path'] . '/';
- break;
- }
-
- $avatar_img .= $row['user_avatar'];
- $user_cache[$poster_id]['avatar'] = '<img src="' . $avatar_img . '" width="' . $row['user_avatar_width'] . '" height="' . $row['user_avatar_height'] . '" alt="" />';
- }
-
get_user_rank($row['user_rank'], $row['user_posts'], $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);
if (!empty($row['user_allow_viewemail']) || $auth->acl_get('a_email'))