diff options
Diffstat (limited to 'phpBB/includes/ucp/ucp_pm_viewfolder.php')
-rw-r--r-- | phpBB/includes/ucp/ucp_pm_viewfolder.php | 73 |
1 files changed, 1 insertions, 72 deletions
diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php index b2ceb30f9e..f947518ba8 100644 --- a/phpBB/includes/ucp/ucp_pm_viewfolder.php +++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php @@ -115,78 +115,7 @@ function view_folder($id, $mode, $folder_id, $folder) // Build Recipient List if in outbox/sentbox - max two additional queries if ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) { - $recipient_list = $address = array(); - - foreach ($folder_info['rowset'] as $message_id => $row) - { - $address[$message_id] = rebuild_header(array('to' => $row['to_address'], 'bcc' => $row['bcc_address'])); - $_save = array('u', 'g'); - foreach ($_save as $save) - { - if (isset($address[$message_id][$save]) && sizeof($address[$message_id][$save])) - { - foreach (array_keys($address[$message_id][$save]) as $ug_id) - { - $recipient_list[$save][$ug_id] = array('name' => $user->lang['NA'], 'colour' => ''); - } - } - } - } - - $_types = array('u', 'g'); - foreach ($_types as $ug_type) - { - if (!empty($recipient_list[$ug_type])) - { - if ($ug_type == 'u') - { - $sql = 'SELECT user_id as id, username as name, user_colour as colour - FROM ' . USERS_TABLE . ' - WHERE '; - } - else - { - $sql = 'SELECT group_id as id, group_name as name, group_colour as colour, group_type - FROM ' . GROUPS_TABLE . ' - WHERE '; - } - $sql .= $db->sql_in_set(($ug_type == 'u') ? 'user_id' : 'group_id', array_map('intval', array_keys($recipient_list[$ug_type]))); - - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - if ($ug_type == 'g') - { - $row['name'] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['name']] : $row['name']; - } - - $recipient_list[$ug_type][$row['id']] = array('name' => $row['name'], 'colour' => $row['colour']); - } - $db->sql_freeresult($result); - } - } - - foreach ($address as $message_id => $adr_ary) - { - foreach ($adr_ary as $type => $id_ary) - { - foreach ($id_ary as $ug_id => $_id) - { - if ($type == 'u') - { - $address_list[$message_id][] = get_username_string('full', $ug_id, $recipient_list[$type][$ug_id]['name'], $recipient_list[$type][$ug_id]['colour']); - } - else - { - $user_colour = ($recipient_list[$type][$ug_id]['colour']) ? ' style="font-weight: bold; color:#' . $recipient_list[$type][$ug_id]['colour'] . '"' : ''; - $link = '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $ug_id) . '"' . $user_colour . '>'; - $address_list[$message_id][] = $link . $recipient_list[$type][$ug_id]['name'] . (($link) ? '</a>' : ''); - } - } - } - } - unset($recipient_list, $address); + $address_list = get_recipient_strings($folder_info['rowset']); } $data = array(); |