Please, hide reactions of ignored members.

rafass

Well-known member
Scenario: User(s) who abuse of the like system.
This user(s) are permanently clicking the like button absolutely all the time and everywhere in all the board.
is super annoying. if a thread contain 20 replies, you will see 15-18 times:
Screen shot 2015-06-23 at 9.33.35 PM.webp
That user(s) are already in the ignore list. but unfortunately even if this user(s) are ignored you will see that likes all the time and everywhere, there is a clear abuse of the likes. kind of flood.

They're not trolls or bad users. they're just kind of "addicts" to click in the "like" button.

That's happening in some communities, and is happening here too with 1 user. (I'll not say with who)
but is VERY annoying. Seriously.

Would be great if once ignored that likes are ignored too.

Many thanks.
 
Upvote 47
I believe that this problem is solved with this code:

open /library/XenForo/Template/Helper/Core.php

find:
$user1 = $user2 = $user3 = '';

before it put:
PHP:
foreach ($users as $key => $user)
        {
            if (XenForo_Visitor::getInstance()->isIgnoring($user['user_id']))
            {
                unset($users[$key]);
            }
        }

        if (empty($users))
        {
            return;
        }

        $users = array_values($users);

replace template "likes_summary" with:
Code:
<xen:if is="{$message.likes}">
    <xen:require css="likes_summary.css" />
    <xen:if hascontent="true">
    <div class="likesSummary secondaryContent">
        <span class="LikeText">
            <xen:contentcheck><xen:likes number="$message.likes" users="$message.likeUsers" url="$likesUrl" liked="$message.like_date" /></xen:contentcheck>
        </span>
    </div>
    </xen:if>
</xen:if>
Will this code work with XF2?
 
Just got a request about this from another user.
Are there any workarounds for XF2.1 available?

I started building an addon for this, but it is impossible to do so generically within Xenforo's structure as of 2.1. You need to edit the trait file for a clean solution.

I could probably do so and put it up as a general resource, though.
 
Correct, but I think there are two things, the reactions/likes summary below every post, and the summary in your account (/accounts/reactions).

The example from Daniel Hood still seems to work in XF2.1 with a few adjustments:

In srx/XF/Template/Templater.php, find:
Code:
$user1 = $user2 = $user3 = '';
note: you will find this two times, adjust both.

Add above:
Code:
        $visitor = \XF::visitor();
        foreach ($users as $key => $user)
        {
            if ($visitor->isIgnoring($user['user_id']))
            {
                unset($users[$key]);
            }
        }

        if (empty($users))
        {
            return;
        }

        $users = array_values($users);

It will hide the reactions from ignored users in posts, not the summary in your account.
 
@Vekseid You can just extend XF\Template\Templater:fnReactionsSummary() without having to edit the trait file or using template modifications.

There's also the Summary page, but this is uglier than it looks when you have multiple people reacting to a post and only want to remove a subset. @Mr. Jinx 's code doesn't affect the reactions getting passed, for example.
 
Up-voting this, hope it's going to be considered for an upcoming update.

My use case: A user ignores another user. So he doesn't see that other users' content. But he sees his reactions. That feels odd. It would make a lot more sense to hide that other user's reactions as well, from the first member.
 
Top Bottom