Skip to content

Commit

Permalink
#1560 Different avatars for members without avatars in the discussions
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTr committed Sep 12, 2018
1 parent 9402027 commit 9bc2499
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 29 deletions.
15 changes: 3 additions & 12 deletions modules/boonex/forum/classes/BxForumTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,9 @@ public function entryParticipants($aContentInfo, $iMaxVisible = 2, $sFloat = 'le
foreach ($aParticipants as $iProfileId => $iComments) {
$oProfile = BxDolProfile::getInstanceMagic($iProfileId);

$sInfo = '';
if ($iAuthorId == $iProfileId)
$sInfo = _t('_bx_forum_participant_author');
if ($aContentInfo['lr_profile_id'] == $iProfileId)
$sInfo .= ', ' . _t('_bx_forum_participant_last_replier');
$sInfo = trim($sInfo, ', ');
$sInfo = $sInfo ? _t('_bx_forum_participant_info', $oProfile->getDisplayName(), $sInfo) : $oProfile->getDisplayName();

$aParticipant = array (
'id' => $oProfile->id(),
'url' => $oProfile->getUrl(),
'thumb_url' => $oProfile->getThumb(),
'title' => $oProfile->getDisplayName(),
'title_attr' => bx_html_attribute($sInfo),
'unit' => $oProfile->getUnit(0, array('template' => 'unit_wo_info')),
'float' => $sFloat,
'class' => $iAuthorId == $iProfileId ? 'bx-forum-participant-author' : '',
'bx_if:replies_count' => array(
Expand All @@ -108,12 +97,14 @@ public function entryParticipants($aContentInfo, $iMaxVisible = 2, $sFloat = 'le
'condition' => ($aContentInfo['lr_profile_id'] == $iProfileId),
'content' => array (
'id' => $oProfile->id(),
'title' => bx_html_attribute(_t('_bx_forum_participant_last_replier')),
),
),
'bx_if:author' => array (
'condition' => $iAuthorId == $iProfileId,
'content' => array (
'id' => $oProfile->id(),
'title' => bx_html_attribute(_t('_bx_forum_participant_author')),
),
),
);
Expand Down
1 change: 0 additions & 1 deletion modules/boonex/forum/install/langs/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@

<string name="_bx_forum_err_not_found"><![CDATA[Discussion wasn't found.]]></string>
<string name="_bx_forum_more"><![CDATA[{0} more]]></string>
<string name="_bx_forum_participant_info"><![CDATA[{0} ({1})]]></string>
<string name="_bx_forum_participant_author"><![CDATA[author]]></string>
<string name="_bx_forum_participant_last_replier"><![CDATA[last replier]]></string>
<string name="_bx_forum_txt_entry_locked"><![CDATA[Locked discussion]]></string>
Expand Down
12 changes: 2 additions & 10 deletions modules/boonex/forum/template/css/main.css
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
@import url(../../../../base/text/template/css/main.css);

/*-- Participants --*/
.bx-forum-participants {
white-space: nowrap;
overflow: hidden;
}

.bx-popup-content .bx-forum-participants {
margin-right: 0px;
}

.bx-forum-participant {
display: inline;
display: inline-block;
}

.bx-forum-participant-author {
position:relative;
display: inline;
display: inline-block;
}
Expand Down Expand Up @@ -105,4 +97,4 @@
.bx-base-text-unit .bx-forum-grid-field-replies {
display: inline-block;
vertical-align: middle;
}
}
10 changes: 5 additions & 5 deletions modules/boonex/forum/template/participants.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<div class="bx-forum-participants bx-clearfix" style="float:__float__;">
<bx_repeat:participants>
<div class="bx-forum-participant bx-def-unit bx-def-margin-sec-__float__-auto __class__">
<a href="__url__" title="__title_attr__"><img class="bx-def-thumb bx-def-thumb-size" src="__thumb_url__" /></a>
<div class="bx-forum-participant bx-def-margin-sec-__float__-auto __class__">
__unit__
<bx_if:replies_count>
<div class="bx-def-unit-alert bg-col-red2-dark" style="top:0; bottom:auto;">__count__</div>
</bx_if:replies_count>
<bx_if:last_replier>
<div class="bx-def-unit-alert bg-col-blue2-dark" style="left:0; right:auto;"><i class="sys-icon comments bx-def-font-contrasted"></i></div>
<div title="__title__" class="bx-def-unit-alert bg-col-blue2-dark" style="left:0; right:auto;"><i class="sys-icon comments bx-def-font-contrasted"></i></div>
</bx_if:last_replier>
<bx_if:author>
<div class="bx-def-unit-alert bg-col-blue2-dark"><i class="sys-icon user bx-def-font-contrasted"></i></div>
<div title="__title__" class="bx-def-unit-alert bg-col-blue2-dark"><i class="sys-icon user bx-def-font-contrasted"></i></div>
</bx_if:author>
</div>
</bx_repeat:participants>
Expand All @@ -19,4 +19,4 @@
</div>
<div id="__id__" style="display:none;">__popup__</div>
</bx_if:participants_more>
</div>
</div>
1 change: 0 additions & 1 deletion modules/boonex/russian/data/langs/bx_forum/ru.xml
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@

<string name="_bx_forum_err_not_found"><![CDATA[Обсуждение не найдено.]]></string>
<string name="_bx_forum_more"><![CDATA[{0} ещё]]></string>
<string name="_bx_forum_participant_info"><![CDATA[{0} ({1})]]></string>
<string name="_bx_forum_participant_author"><![CDATA[автор]]></string>
<string name="_bx_forum_participant_last_replier"><![CDATA[последний ответивший]]></string>
<string name="_bx_forum_txt_entry_locked"><![CDATA[Заблокированное обсуждение]]></string>
Expand Down

0 comments on commit 9bc2499

Please sign in to comment.