XF 2.0 Show likes as percentage of postcount

Mr Lucky

Well-known member
Obviously we can see total likes and total posts, but I thought it would be possible to list what percentage of a users' posts received likes, but maybe not. At least I can't find a way to show that.

Is this possible? Thanks
 
In message_macros template add to <xf:contentcheck> block
HTML:
                    <xf:if is="$extras.like_count && $extras.message_count">
                        <dl class="pairs pairs--justified">
                            <dt>Avg</dt>
                            <dd>{{floor({$user.like_count|number} / {$user.message_count|number}) * 100}}%</dd>
                        </dl>
                    </xf:if>
Create a phrase if you want.
 
Top Bottom