{assign var='topReaction' value=$__wcf->getReactionHandler()->getTopReaction($cachedReactions)}
{if $topReaction}
- {if $render === 'icon'}
- <span class="jsTooltip" title="{lang reaction=$topReaction[reaction] count=$topReaction[count]}wcf.like.reaction.topReaction{/lang}">{@$topReaction[reaction]->renderIcon()}</span>
- {elseif $render === 'tiny'}
- <span class="topReactionTiny jsTooltip" title="{lang reaction=$topReaction[reaction] count=$topReaction[count]}wcf.like.reaction.topReaction{/lang}">
+ {if $render === 'tiny'}
+ <span class="topReactionTiny jsTooltip" title="{lang reaction=$topReaction[reaction] count=$topReaction[count] other=$topReaction[other]}wcf.like.reaction.topReaction{/lang}">
{@$topReaction[reaction]->renderIcon()} {#$topReaction[count]}
</span>
{elseif $render === 'short'}
- <span class="topReactionShort jsTooltip" title="{lang reaction=$topReaction[reaction] count=$topReaction[count]}wcf.like.reaction.topReaction{/lang}">
+ <span class="topReactionShort jsTooltip" title="{lang reaction=$topReaction[reaction] count=$topReaction[count] other=$topReaction[other]}wcf.like.reaction.topReaction{/lang}">
{@$topReaction[reaction]->renderIcon()} × {#$topReaction[count]}
</span>
{elseif $render === 'full'}
<span class="topReactionFull">
- {@$topReaction[reaction]->renderIcon()} {lang reaction=$topReaction[reaction] count=$topReaction[count]}wcf.like.reaction.topReaction{/lang}
+ {@$topReaction[reaction]->renderIcon()} {lang reaction=$topReaction[reaction] count=$topReaction[count] other=$topReaction[other]}wcf.like.reaction.topReaction{/lang}
</span>
{/if}
{/if}
$cachedReactions = @unserialize($cachedReactions);
if (is_array($cachedReactions) && !empty($cachedReactions)) {
- asort($cachedReactions, SORT_NUMERIC);
+ $allReactions = array_sum($cachedReactions);
+ arsort($cachedReactions, SORT_NUMERIC);
+
+ $count = current($cachedReactions);
return [
- 'count' => current($cachedReactions),
+ 'count' => $count,
+ 'other' => $allReactions - $count,
'reaction' => ReactionTypeCache::getInstance()->getReactionTypeByID(key($cachedReactions)),
];
}
<item name="wcf.like.reaction.label"><![CDATA[{#$reactions} Reaktion{if $reactions != 1}en{/if}]]></item>
<item name="wcf.like.reaction.more"><![CDATA[Weitere Reaktionen]]></item>
<item name="wcf.like.reaction.noMoreEntries"><![CDATA[Keine weiteren Reaktionen]]></item>
- <item name="wcf.like.reaction.topReaction"><![CDATA[{$reaction->getTitle()} × {#$count}]]></item>
+ <item name="wcf.like.reaction.topReaction"><![CDATA[{$reaction->getTitle()} × {#$count}{if $other} und {if $other == 1}eine weitere Reaktion{else}{#$other} weitere Reaktionen{/if}{/if}]]></item>
<item name="wcf.like.reactionsReceived"><![CDATA[Erhaltene Reaktionen]]></item>
<item name="wcf.like.reactionsGiven"><![CDATA[Vergebene Reaktionen]]></item>
</category>
<item name="wcf.like.reaction.label"><![CDATA[{#$reactions} reaction{if $reactions != 1}s{/if}]]></item>
<item name="wcf.like.reaction.more"><![CDATA[More Reactions]]></item>
<item name="wcf.like.reaction.noMoreEntries"><![CDATA[There are no new reactions at the moment.]]></item>
- <item name="wcf.like.reaction.topReaction"><![CDATA[{$reaction->getTitle()} × {#$count}]]></item>
+ <item name="wcf.like.reaction.topReaction"><![CDATA[{$reaction->getTitle()} × {#$count}{if $other} and {if $other == 1}one other reaction{else}{#$other} other reactions{/if}{/if}]]></item>
<item name="wcf.like.reactionsReceived"><![CDATA[Reactions Received]]></item>
<item name="wcf.like.reactionsGiven"><![CDATA[Reactions Given]]></item>
</category>