1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

[ticket/12265] Define a loop for contact icons.

PHPBB3-12265
This commit is contained in:
Cesar G
2014-04-15 08:55:39 -07:00
parent 161b610a94
commit 975c5655f0
4 changed files with 117 additions and 66 deletions

View File

@@ -177,6 +177,18 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
}
}
$u_pm = $u_jabber = '';
if ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($user_info['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')))
{
$u_pm = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&u=' . $author_id);
}
if ($user_info['user_jabber'] && $auth->acl_get('u_sendim'))
{
$u_jabber = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=jabber&u=' . $author_id);
}
$msg_data = array(
'MESSAGE_AUTHOR_FULL' => get_username_string('full', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']),
'MESSAGE_AUTHOR_COLOUR' => get_username_string('colour', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']),
@@ -208,8 +220,8 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
'EDITED_MESSAGE' => $l_edited_by,
'MESSAGE_ID' => $message_row['msg_id'],
'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($user_info['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&u=' . $author_id) : '',
'U_JABBER' => ($user_info['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=jabber&u=' . $author_id) : '',
'U_PM' => $u_pm,
'U_JABBER' => $u_jabber,
'U_DELETE' => ($auth->acl_get('u_pm_delete')) ? "$url&mode=compose&action=delete&f=$folder_id&p=" . $message_row['msg_id'] : '',
'U_EMAIL' => $user_info['email'],
@@ -255,6 +267,32 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
$template->assign_vars($msg_data);
$contact_fields = array(
array(
'ID' => 'pm',
'NAME' => $user->lang['PRIVATE_MESSAGE'],
'U_CONTACT' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&u=' . $author_id)
),
array(
'ID' => 'email',
'NAME' => $user->lang['SEND_EMAIL'],
'U_CONTACT' => $user_info['email'],
),
array(
'ID' => 'jabber',
'NAME' => $user->lang['JABBER'],
'U_CONTACT' => $u_jabber,
),
);
foreach ($contact_fields as $field)
{
if ($field['U_CONTACT'])
{
$template->assign_block_vars('contact', $field);
}
}
// Display the custom profile fields
if (!empty($cp_row['row']))
{
@@ -263,6 +301,15 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
foreach ($cp_row['blockrow'] as $cp_block_row)
{
$template->assign_block_vars('custom_fields', $cp_block_row);
if ($cp_block_row['S_PROFILE_CONTACT'])
{
$template->assign_block_vars('contact', array(
'ID' => $cp_block_row['PROFILE_FIELD_IDENT'],
'NAME' => $cp_block_row['PROFILE_FIELD_NAME'],
'U_CONTACT' => $cp_block_row['PROFILE_FIELD_CONTACT'],
));
}
}
}