Skip to content

Commit

Permalink
Ticket #4223 - Comments: Add possibility to show commented users in d…
Browse files Browse the repository at this point in the history
…escending order
  • Loading branch information
AntonLV committed Feb 10, 2023
1 parent ec0961f commit 9c8b7f9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 10 additions & 1 deletion modules/boonex/forum/classes/BxForumTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,16 @@ function getEntryPreview($aRow, $aParams = [])
}

$oObject = isset($CNF['OBJECT_COMMENTS']) ? BxDolCmts::getObjectInstance($CNF['OBJECT_COMMENTS'], $aRow[$CNF['FIELD_ID']]) : null;
$sParticipants = $oObject ? $oObject->getCounter(['show_counter_empty' => true, 'show_counter' => false, 'show_counter_style' => 'simple', 'dynamic_mode' => true, 'caption' => '', 'show_icon' => false, 'caption_empty' => '']) : '';
$sParticipants = $oObject ? $oObject->getCounter([
'caption' => '',
'caption_empty' => '',
'show_icon' => false,
'show_counter' => false,
'show_counter_empty' => true,
'show_counter_style' => 'simple',
'show_counter_reversed' => true,
'dynamic_mode' => true
]) : '';

$sImage = '';
$mixedImage = $this->_getHeaderImage($aRow);
Expand Down
5 changes: 4 additions & 1 deletion template/scripts/BxBaseCmts.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function __construct( $sSystem, $iId, $iInit = true, $oTemplate = false)
'show_counter' => true,
'show_counter_only' => true,
'show_counter_empty' => false,
'show_counter_reversed' => false,
'recalculate_counter' => false
);

Expand Down Expand Up @@ -789,6 +790,7 @@ public function getCounter($aParams = [])
$bShowDoCommentAsButtonSmall = isset($aParams['show_do_comment_as_button_small']) && $aParams['show_do_comment_as_button_small'] == true;
$bShowDoCommentAsButton = !$bShowDoCommentAsButtonSmall && isset($aParams['show_do_comment_as_button']) && $aParams['show_do_comment_as_button'] == true;
$bShowEmpty = isset($aParams['show_counter_empty']) && $aParams['show_counter_empty'] == true;
$bShowReversed = isset($aParams['show_counter_reversed']) && $aParams['show_counter_reversed'] == true;
$bRecalculateCounter = isset($aParams['recalculate_counter']) && $aParams['recalculate_counter'] == true;

$sClass = 'sys-action-counter';
Expand All @@ -807,7 +809,8 @@ public function getCounter($aParams = [])

$iCmtsLimit = 5;
$aCmts = $this->_getCounterItems($iCmtsLimit);
$aCmts = array_reverse($aCmts);
if(!$bShowReversed)
$aCmts = array_reverse($aCmts);

$aTmplVarsProfiles = [];
foreach($aCmts as $aCmt) {
Expand Down

0 comments on commit 9c8b7f9

Please sign in to comment.