XF 2.1 hiding reactions from public view

boeing747

Active member
Hi

Is there any way for hiding reactions counter from public view in threads?
I want to hide it from members except author of post. it means just author can see his/her reactions that others gave to him.her.
 

Brogan

XenForo moderator
Staff member
Seems a bit weird but who am I to judge?

Oh wait, I just did.

Edit the reaction_list_row template and wrap it in a conditional statement like so:
HTML:
<xf:if is="$xf.visitor.user_id == $content.user_id">
    <xf:if is="$reactionIds">
        <xf:macro template="reactions_summary" name="summary" arg-reactionIds="{$reactionIds}" />
    </xf:if>
    <span class="u-srOnly">{{ phrase('reactions:') }}</span>
    <a class="reactionsBar-link" href="{{ link($link, $content, $linkParams) }}" data-xf-click="overlay" data-cache="false">{$reactions}</a>
</xf:if>
 

smozgur

Active member
Although I didn't check possible side effects, it might be possible in the post_macros template.

Find the following code:
HTML:
<div class="reactionsBar js-reactionsList {{ $post.reactions ? 'is-active' : '' }}">
    <xf:reactions content="{$post}" link="posts/reactions" />
</div>

Apply the condition (preferably not in the master but in the style or as a template modification):
HTML:
<xf:if is="$xf.visitor == $post.User">
    <div class="reactionsBar js-reactionsList {{ $post.reactions ? 'is-active' : '' }}">
        <xf:reactions content="{$post}" link="posts/reactions" />
    </div>
</xf:if>

Naturally, whoever reacted to the post will still see their reaction on the reaction icon, so they can change it or know they already reacted.
 

LordRahl

Member
Yes, I mean to people who can see that their message is still waiting for approval. I don't want them knowing that their message is still waiting for approval. I want them to think their message is live even if it is still waiting for approval.

Does this make any sense?
 

Ozzy47

Well-known member
Yes, I mean to people who can see that their message is still waiting for approval. I don't want them knowing that their message is still waiting for approval. I want them to think their message is live even if it is still waiting for approval.

Does this make any sense?

See my above post.
 
Top