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.
 
Solution
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>
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>
 
Solution
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.
 
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?
 
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.
 
I made a full-fledged add-on (paid) which adds a special permission to see reacted users and full reaction list page:
 
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>
Thank you Brogan,

it works great. I'm looking for another solution which shows just how many people react to a post.

Something like this " A.B, C, D and X others liked" except the author of the post no one can click on for opening the overlay to know which Members reacted to that post.


Some of my members using reacts for trolling each other. :|
 
Back
Top Bottom