diff --git a/main/inc/lib/social.lib.php b/main/inc/lib/social.lib.php
index 3d9e3a9c80..2392e137e7 100755
--- a/main/inc/lib/social.lib.php
+++ b/main/inc/lib/social.lib.php
@@ -1724,6 +1724,7 @@ class SocialManager extends UserManager
$template->assign('chat_enabled', $chatEnabled);
$template->assign('user_relation', $userRelationType);
$template->assign('user_relation_type_friend', USER_RELATION_TYPE_FRIEND);
+ $template->assign('show_full_profile', $show_full_profile);
$templateName = $template->get_template('social/user_block.tpl');
if (in_array($groupBlock, ['groups', 'group_edit', 'member_list'])) {
diff --git a/main/social/profile.php b/main/social/profile.php
index 687b7daad1..3b42cebabb 100755
--- a/main/social/profile.php
+++ b/main/social/profile.php
@@ -347,6 +347,9 @@ if ($show_full_profile) {
$extra_information_value = '
';
$extraField = new ExtraField('user');
foreach ($extra_user_data as $key => $data) {
+ if (empty($data)) {
+ continue;
+ }
// Avoiding parameters
if (in_array(
$key,
@@ -365,6 +368,10 @@ if ($show_full_profile) {
$field_variable
);
+ if (in_array($extraFieldInfo['variable'], ['skype', 'linkedin_url'])) {
+ break;
+ }
+
if ($extraFieldInfo['visible'] != 1) {
continue;
}
@@ -421,15 +428,7 @@ if ($show_full_profile) {
$extra_information_value .= '- '.$data.'
';
break;
default:
- if (!empty($data)) {
- $extra_field_title = ucfirst($extraFieldInfo['display_text']);
- if ($extra_field_title == 'Skype') {
- $data = '' . get_lang('Chat') . '';
- $extra_information_value .= '- '.Display::return_icon('skype.png', $extraFieldInfo['display_text'], null, ICON_SIZE_TINY, false) . ' ' . $data.'
';
- } else {
- $extra_information_value .= '- '.ucfirst($extraFieldInfo['display_text']).':
- '.$data.'
';
- }
- }
+ $extra_information_value .= '- '.ucfirst($extraFieldInfo['display_text']) . ': ' . $data . '
';
break;
}
}
diff --git a/main/template/default/social/user_block.tpl b/main/template/default/social/user_block.tpl
index 607e74f4bb..731ff2af67 100644
--- a/main/template/default/social/user_block.tpl
+++ b/main/template/default/social/user_block.tpl
@@ -17,7 +17,7 @@
-
{{ user.complete_name }}
- {% if vcard_user_link %}
+ {% if show_full_profile %}
-
@@ -30,6 +30,34 @@
{{ "BusinessCard" | get_lang }}
+
+ {% set skype_account = '' %}
+ {% set linkedin_url = '' %}
+ {% for extra in user.extra %}
+ {% if extra.value.getField().getVariable() == 'skype' %}
+ {% set skype_account = extra.value.getValue() %}
+ {% endif %}
+
+ {% if extra.value.getField().getVariable() == 'linkedin_url' %}
+ {% set linkedin_url = extra.value.getValue() %}
+ {% endif %}
+ {% endfor %}
+
+ {% if 'allow_show_skype_account'|get_setting == 'true' and not skype_account is empty %}
+ -
+
+ {{ 'Skype'|get_lang }}
+
+
+ {% endif %}
+
+ {% if 'allow_show_linkedin_url'|get_setting == 'true' and not linkedin_url is empty %}
+ -
+
+ {{ 'LinkedIn'|get_lang }}
+
+
+ {% endif %}
{% endif %}
{% if chat_enabled == 1 %}
{% if user.user_is_online_in_chat != 0 %}
@@ -49,7 +77,7 @@
{% if not profile_edition_link is empty %}
-
-
+
{{ "EditProfile" | get_lang }}