From 7f4b311d9a6ec2d76bf7581b4e587cb493bcd0cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Arag=C3=B3n?= Date: Mon, 4 Feb 2019 11:03:32 -0500 Subject: [PATCH] fix icons forums and perfil - refs BT#15175 --- .../public/css/themes/rainbow/default.css | 6 +++++ main/forum/viewforum.php | 21 ++++++++++++++++- main/inc/lib/social.lib.php | 23 ++++++++++++++++--- 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/app/Resources/public/css/themes/rainbow/default.css b/app/Resources/public/css/themes/rainbow/default.css index a347fa379a..7b81fa0ed3 100755 --- a/app/Resources/public/css/themes/rainbow/default.css +++ b/app/Resources/public/css/themes/rainbow/default.css @@ -2139,3 +2139,9 @@ blockquote p { #personal_data .panel-default .panel-heading a { color: #666; } +.user-data .username{ + display: inline-block; +} +.user-data img.pull-left{ + margin-right: 0.5em; +} \ No newline at end of file diff --git a/main/forum/viewforum.php b/main/forum/viewforum.php index 5abf1bbd98..115dad48a8 100755 --- a/main/forum/viewforum.php +++ b/main/forum/viewforum.php @@ -469,6 +469,25 @@ if (is_array($threads)) { ); } + $_user = api_get_user_info($row['user_id']); + $urlImg = api_get_path(WEB_IMG_PATH); + $iconStatus = null; + $isAdmin = UserManager::is_admin($row['user_id']); + + if($_user['status']==5) { + if($_user['has_certificates']){ + $iconStatus = ''; + }else{ + $iconStatus = ''; + } + }else if($_user['status'] == 1){ + if($isAdmin){ + $iconStatus = ''; + }else{ + $iconStatus = ''; + } + } + $html .= '
'.display_user_image($row['user_id'], $name, $origin).'
'; $html .= ''; $html .= '
'; @@ -479,7 +498,7 @@ if (is_array($threads)) { 'class' => 'title', ] ); - $html .= '

'.get_lang('By').' '.$authorName.'

'; + $html .= '

'.get_lang('By').' '.$iconStatus.' '.$authorName.'

'; $html .= '

'.api_convert_and_format_date($row['insert_date']).'

'; if ($current_forum['moderated'] == 1 && api_is_allowed_to_edit(false, true)) { diff --git a/main/inc/lib/social.lib.php b/main/inc/lib/social.lib.php index 140127e892..44516c34aa 100755 --- a/main/inc/lib/social.lib.php +++ b/main/inc/lib/social.lib.php @@ -1774,11 +1774,30 @@ class SocialManager extends UserManager $currentUserId = api_get_user_id(); $userIdLoop = $message['user_sender_id']; $receiverId = $message['user_receiver_id']; + $iconStatus = null; + $userStatus = $users[$userIdLoop]['status']; + $urlImg = api_get_path(WEB_IMG_PATH); + $isAdmin = self::is_admin($users[$userIdLoop]['id']); if (!isset($users[$userIdLoop])) { $users[$userIdLoop] = api_get_user_info($userIdLoop); } + if($userStatus==5) { + if($users[$userIdLoop]['has_certificates']){ + $iconStatus = ''; + }else{ + $iconStatus = ''; + } + }else if($userStatus == 1){ + if($isAdmin){ + $iconStatus = ''; + }else{ + $iconStatus = ''; + } + } + + $nameComplete = $users[$userIdLoop]['complete_name']; $url = api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$userIdLoop; @@ -1791,6 +1810,7 @@ class SocialManager extends UserManager $comment .= '
'; $comment .= '
'; $comment .= '
'; + $comment .= $iconStatus; $comment .= '
'.''.$nameComplete.' '.Security::remove_XSS($message['content']).'
'; @@ -2509,12 +2529,9 @@ class SocialManager extends UserManager } $html .= '
'; - - $html .= ' '.$nameCompleteAuthor.''; $html .= '
'; - $html .= '
'; $html .= $iconStatus; $html .= '
'.$nameCompleteAuthor.''.$htmlReceiver.'
';