diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index 4920a1167f..a42701877b 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -918,9 +918,10 @@ phpbb.toggleDropdown = function() { // Check dimensions when showing dropdown // !visible because variable shows state of dropdown before it was toggled if (!visible) { + var windowWidth = $(window).width(); + options.dropdown.find('.dropdown-contents').each(function() { - var $this = $(this), - windowWidth = $(window).width(); + var $this = $(this); $this.css({ marginLeft: 0, @@ -938,6 +939,13 @@ phpbb.toggleDropdown = function() { $this.css('margin-left', (windowWidth - offset - width - 2) + 'px'); } }); + var freeSpace = parent.offset().left - 4; + + if (direction == 'left') { + options.dropdown.css('margin-left', '-' + freeSpace + 'px'); + } else { + options.dropdown.css('margin-right', '-' + (windowWidth + freeSpace) + 'px'); + } } // Prevent event propagation diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 364d0caf25..8a60a7e680 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -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'], @@ -264,6 +276,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' => $u_pm, + ), + 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'])) { @@ -272,6 +310,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'], + )); + } } } diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 569ec776f5..4d4a955aa3 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -167,6 +167,7 @@ $lang = array_merge($lang, array( 'CONGRATULATIONS' => 'Congratulations to', 'CONNECTION_FAILED' => 'Connection failed.', 'CONNECTION_SUCCESS' => 'Connection was successful!', + 'CONTACT_USER' => 'Contact', 'COOKIES_DELETED' => 'All board cookies successfully deleted.', 'CURRENT_TIME' => 'It is currently %s', diff --git a/phpBB/language/en/memberlist.php b/phpBB/language/en/memberlist.php index 95efe35b7d..f92286a092 100644 --- a/phpBB/language/en/memberlist.php +++ b/phpBB/language/en/memberlist.php @@ -47,7 +47,6 @@ $lang = array_merge($lang, array( 'BEFORE' => 'Before', 'CC_EMAIL' => 'Send a copy of this email to yourself.', - 'CONTACT_USER' => 'Contact', 'DEST_LANG' => 'Language', 'DEST_LANG_EXPLAIN' => 'Select an appropriate language (if available) for the recipient of this message.', diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html index f14e4708e7..627b5aa6ed 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html +++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html @@ -34,25 +34,30 @@ - -
- -
+ +
+ {L_CONTACT_USER}{L_COLON} +
diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index 01a49d6888..485083a2ba 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -143,26 +143,32 @@ - - +
- + {L_CONTACT_USER}{L_COLON} +
- diff --git a/phpBB/styles/prosilver/theme/buttons.css b/phpBB/styles/prosilver/theme/buttons.css index 3422af8b64..9ca04516cc 100644 --- a/phpBB/styles/prosilver/theme/buttons.css +++ b/phpBB/styles/prosilver/theme/buttons.css @@ -214,20 +214,53 @@ ul.profile-icons.responsive a.responsive-menu-link:before { max-width: 40%; } +.contact-icons.dropdown-contents { + min-width: 0; + padding: 0; +} + +.contact-icon { + background-repeat: no-repeat; + display: block; + height: 16px; + width: 16px; +} +.contact-icons a { + border-bottom: 1px dotted; + border-right: 1px dotted; + display: block; + float: left; + padding: 8px; +} + +.contact-icons .last-cell { + border-right: none; +} + +.contact-icons div:last-child a { + border-bottom: none; +} + +.contact-icons div { + clear: left; +} + + /* Profile & navigation icons */ -.email-icon, .email-icon a { background: none top left no-repeat; } -.aim-icon, .aim-icon a { background: none top left no-repeat; } -.phpbb_aol-icon, .phpbb_aol-icon a { background: none top left no-repeat; } -.yahoo-icon, .yahoo-icon a { background: none top left no-repeat; } -.phpbb_yahoo-icon, .phpbb_yahoo-icon a { background: none top left no-repeat; } -.web-icon, .web-icon a { background: none top left no-repeat; } -.phpbb_website-icon, .phpbb_website-icon a { background: none top left no-repeat; } -.msnm-icon, .msnm-icon a { background: none top left no-repeat; } -.phpbb_wlm-icon, .phpbb_wlm-icon a { background: none top left no-repeat; } -.icq-icon, .icq-icon a { background: none top left no-repeat; } -.phpbb_icq-icon, .phpbb_icq-icon a { background: none top left no-repeat; } -.jabber-icon, .jabber-icon a { background: none top left no-repeat; } -.pm-icon, .pm-icon a { background: none top left no-repeat; } +.pm-icon { background-position: 0 0; } +.email-icon { background-position: -21px 0; } +.jabber-icon { background-position: -80px 0; } +.phpbb_icq-icon { background-position: -61px 0 ; } +.phpbb_wlm-icon { background-position: -182px 0; } +.phpbb_aol-icon { background-position: -244px 0; } +.phpbb_website-icon { background-position: -40px 0; } +.phpbb_youtube-icon { background-position: -98px 0; } +.phpbb_facebook-icon { background-position: -119px 0; } +.phpbb_google_plus-icon { background-position: -140px 0; } +.phpbb_skype-icon { background-position: -161px 0; } +.phpbb_twitter-icon { background-position: -203px 0; } +.phpbb_yahoo-icon { background-position: -224px 0; } + .quote-icon, .quote-icon a { background: none top left no-repeat; } /* Moderator icons */ diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css index 30650e7411..39f28b4774 100644 --- a/phpBB/styles/prosilver/theme/colours.css +++ b/phpBB/styles/prosilver/theme/colours.css @@ -710,6 +710,14 @@ Colours and backgrounds for buttons.css background-image: url("images/buttons.png"); } +.contact-icons a { + border-color: #DCDCDC; +} + +.contact-icons a:hover { + background-color: #F2F6F9; +} + /* Icon images ---------------------------------------- */ .icon-faq { background-image: url("./images/icon_faq.gif"); } @@ -732,19 +740,8 @@ Colours and backgrounds for buttons.css .icon-print { background-image: url("./images/icon_print.gif"); } /* Profile & navigation icons */ -.email-icon, .email-icon a { background-image: url("./images/icon_contact_email.gif"); } -.phpbb_aol-icon, .phpbb_aol-icon a { background-image: url("./images/icon_contact_aim.gif"); } -.aim-icon, .aim-icon a { background-image: url("./images/icon_contact_aim.gif"); } -.yahoo-icon, .yahoo-icon a { background-image: url("./images/icon_contact_yahoo.gif"); } -.phpbb_yahoo-icon, .phpbb_yahoo-icon a { background-image: url("./images/icon_contact_yahoo.gif"); } -.web-icon, .web-icon a { background-image: url("./images/icon_contact_www.gif"); } -.phpbb_website-icon, .phpbb_website-icon a { background-image: url("./images/icon_contact_www.gif"); } -.msnm-icon, .msnm-icon a { background-image: url("./images/icon_contact_msnm.gif"); } -.phpbb_wlm-icon, .phpbb_wlm-icon a { background-image: url("./images/icon_contact_msnm.gif"); } -.icq-icon, .icq-icon a { background-image: url("./images/icon_contact_icq.gif"); } -.phpbb_icq-icon, .phpbb_icq-icon a { background-image: url("./images/icon_contact_icq.gif"); } -.jabber-icon, .jabber-icon a { background-image: url("./images/icon_contact_jabber.gif"); } -.pm-icon, .pm-icon a { background-image: url("./en/icon_contact_pm.gif"); } +.contact-icon { background-image: url("./images/icons_contact.png"); } + .quote-icon, .quote-icon a { background-image: url("./en/icon_post_quote.gif"); } ul.profile-icons.responsive a.responsive-menu-link { background-image: url("./images/icon_post_menu.png"); } diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index 3d5a0a433d..0e0f847328 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -470,6 +470,7 @@ ul.linklist.bulletin li.no-bulletin:before { border: 1px solid transparent; border-radius: 5px; padding: 9px 0 0; + margin-right: -500px; } .dropdown-container.topic-tools { @@ -485,6 +486,8 @@ ul.linklist.bulletin li.no-bulletin:before { .dropdown-left .dropdown, .nojs .rightside .dropdown { left: auto; right: 0; + margin-left: -500px; + margin-right: 0; } .dropdown-button-control .dropdown { diff --git a/phpBB/styles/prosilver/theme/content.css b/phpBB/styles/prosilver/theme/content.css index d27fb81fee..dc6ab9aef3 100644 --- a/phpBB/styles/prosilver/theme/content.css +++ b/phpBB/styles/prosilver/theme/content.css @@ -731,6 +731,20 @@ fieldset.polls dd div { height: auto !important; } +dd.profile-contact { + overflow: visible; +} + +.profile-contact .dropdown-container { + display: inline-block; + text-align: left; + width: 30px; +} + +.profile-contact .icon_contact { + vertical-align: middle; +} + .online { background-image: none; background-position: 100% 0; diff --git a/phpBB/styles/prosilver/theme/en/stylesheet.css b/phpBB/styles/prosilver/theme/en/stylesheet.css index 82b7df0830..d8ca2558e5 100644 --- a/phpBB/styles/prosilver/theme/en/stylesheet.css +++ b/phpBB/styles/prosilver/theme/en/stylesheet.css @@ -7,16 +7,10 @@ ul.profile-icons li.edit-icon { width: 42px; height: 20px; } .online { background-image: url("./icon_user_online.gif"); } /* Icon images */ -.pm-icon, .pm-icon a { background-image: url("./icon_contact_pm.gif"); } .quote-icon, .quote-icon a { background-image: url("./icon_post_quote.gif"); } .edit-icon, .edit-icon a { background-image: url("./icon_post_edit.gif"); } /* EN Language Pack */ -.imageset.icon_contact_pm { - background-image: url("./icon_contact_pm.gif"); - padding-left: 28px; - padding-top: 20px; -} .imageset.icon_post_edit { background-image: url("./icon_post_edit.gif"); padding-left: 42px; diff --git a/phpBB/styles/prosilver/theme/images/icon_contact.png b/phpBB/styles/prosilver/theme/images/icon_contact.png new file mode 100644 index 0000000000..04e4d9ad17 Binary files /dev/null and b/phpBB/styles/prosilver/theme/images/icon_contact.png differ diff --git a/phpBB/styles/prosilver/theme/images/icon_contact_aim.gif b/phpBB/styles/prosilver/theme/images/icon_contact_aim.gif deleted file mode 100644 index be039fcde2..0000000000 Binary files a/phpBB/styles/prosilver/theme/images/icon_contact_aim.gif and /dev/null differ diff --git a/phpBB/styles/prosilver/theme/images/icon_contact_email.gif b/phpBB/styles/prosilver/theme/images/icon_contact_email.gif deleted file mode 100644 index caa3683005..0000000000 Binary files a/phpBB/styles/prosilver/theme/images/icon_contact_email.gif and /dev/null differ diff --git a/phpBB/styles/prosilver/theme/images/icon_contact_icq.gif b/phpBB/styles/prosilver/theme/images/icon_contact_icq.gif deleted file mode 100644 index 48a09373eb..0000000000 Binary files a/phpBB/styles/prosilver/theme/images/icon_contact_icq.gif and /dev/null differ diff --git a/phpBB/styles/prosilver/theme/images/icon_contact_jabber.gif b/phpBB/styles/prosilver/theme/images/icon_contact_jabber.gif deleted file mode 100644 index e335433e97..0000000000 Binary files a/phpBB/styles/prosilver/theme/images/icon_contact_jabber.gif and /dev/null differ diff --git a/phpBB/styles/prosilver/theme/images/icon_contact_msnm.gif b/phpBB/styles/prosilver/theme/images/icon_contact_msnm.gif deleted file mode 100644 index e25469c3a5..0000000000 Binary files a/phpBB/styles/prosilver/theme/images/icon_contact_msnm.gif and /dev/null differ diff --git a/phpBB/styles/prosilver/theme/images/icon_contact_www.gif b/phpBB/styles/prosilver/theme/images/icon_contact_www.gif deleted file mode 100644 index 83cee9728d..0000000000 Binary files a/phpBB/styles/prosilver/theme/images/icon_contact_www.gif and /dev/null differ diff --git a/phpBB/styles/prosilver/theme/images/icon_contact_yahoo.gif b/phpBB/styles/prosilver/theme/images/icon_contact_yahoo.gif deleted file mode 100644 index 305f297fdb..0000000000 Binary files a/phpBB/styles/prosilver/theme/images/icon_contact_yahoo.gif and /dev/null differ diff --git a/phpBB/styles/prosilver/theme/images/icons_contact.png b/phpBB/styles/prosilver/theme/images/icons_contact.png new file mode 100644 index 0000000000..f84abd36a5 Binary files /dev/null and b/phpBB/styles/prosilver/theme/images/icons_contact.png differ diff --git a/phpBB/styles/prosilver/theme/imageset.css b/phpBB/styles/prosilver/theme/imageset.css index e6d306c7fd..6bc345889e 100644 --- a/phpBB/styles/prosilver/theme/imageset.css +++ b/phpBB/styles/prosilver/theme/imageset.css @@ -356,13 +356,14 @@ span.imageset { padding-top: 20px; } +.imageset.icon_contact { + background-image: url("./images/icon_contact.png"); + padding-left: 16px; + padding-top: 12px; +} + /* English images for fallback */ -.imageset.icon_contact_pm { - background-image: url("./en/icon_contact_pm.gif"); - padding-left: 28px; - padding-top: 20px; -} .imageset.icon_post_edit { background-image: url("./en/icon_post_edit.gif"); padding-left: 42px; diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index fc40dd65bb..0691355563 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1621,6 +1621,13 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) (($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || $data['user_allow_pm']) ); + $u_pm = ''; + + if ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && $can_receive_pm) + { + $u_pm = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&action=quotepost&p=' . $row['post_id']); + } + // $post_row = array( 'POST_AUTHOR_FULL' => ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_full'] : get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), @@ -1660,7 +1667,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'U_DELETE' => ($delete_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&f=$forum_id&p={$row['post_id']}") : '', 'U_SEARCH' => $user_cache[$poster_id]['search'], - 'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && $can_receive_pm) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&action=quotepost&p=' . $row['post_id']) : '', + 'U_PM' => $u_pm, 'U_EMAIL' => $user_cache[$poster_id]['email'], 'U_JABBER' => $user_cache[$poster_id]['jabber'], @@ -1744,11 +1751,46 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) // Dump vars into template $template->assign_block_vars('postrow', $post_row); + $contact_fields = array( + array( + 'ID' => 'pm', + 'NAME' => $user->lang['PRIVATE_MESSAGES'], + 'U_CONTACT' => $u_pm, + ), + array( + 'ID' => 'email', + 'NAME' => $user->lang['SEND_EMAIL'], + 'U_CONTACT' => $user_cache[$poster_id]['email'], + ), + array( + 'ID' => 'jabber', + 'NAME' => $user->lang['JABBER'], + 'U_CONTACT' => $user_cache[$poster_id]['jabber'], + ), + ); + + foreach ($contact_fields as $field) + { + if ($field['U_CONTACT']) + { + $template->assign_block_vars('postrow.contact', $field); + } + } + if (!empty($cp_row['blockrow'])) { foreach ($cp_row['blockrow'] as $field_data) { $template->assign_block_vars('postrow.custom_fields', $field_data); + + if ($field_data['S_PROFILE_CONTACT']) + { + $template->assign_block_vars('postrow.contact', array( + 'ID' => $field_data['PROFILE_FIELD_IDENT'], + 'NAME' => $field_data['PROFILE_FIELD_NAME'], + 'U_CONTACT' => $field_data['PROFILE_FIELD_CONTACT'], + )); + } } }