Skip to content

Commit 5dd27ec

Browse files
committed
Issues-475: Hide zero down votes
1 parent 7494447 commit 5dd27ec

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Voting/class.voting.plugin.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,11 @@ function generateVoterBox($id, $VoteType, $pScore, $nScore, $currentUserVote)
361361
$voteDownUrl = '/discussion/vote' . strtolower($VoteType) . '/' . $id . '/votedown/' . Gdn::session()->TransientKey() . '/';
362362
$result = '<span id="' . $voterBoxID . '" class="Voter">';
363363
$result .= Anchor(Wrap('', 'span', array('class' => 'icon ' . $cssClassVoteUp, 'rel' => 'nofollow')), $voteUpUrl, 'VoteUp');
364-
$result .= Wrap(formattedPScore($pScore) . '<span class="VoiceDivider">/</span>' . formattedNScore($nScore), 'span', array('class' => 'CountVoices'));
364+
$counts = formattedPScore($pScore);
365+
if(!StringIsNullOrEmpty($nScore) && $nScore != 0) {
366+
$counts .= '<span class="VoiceDivider">/</span>' . formattedNScore($nScore);
367+
}
368+
$result .= Wrap($counts, 'span', array('class' => 'CountVoices'));
365369
$result .= Anchor(Wrap('', 'span', array('class' => 'icon ' . $cssClassVoteDown, 'rel' => 'nofollow')), $voteDownUrl, 'VoteDown');
366370
$result .= '</span>';
367371

0 commit comments

Comments
 (0)