XF 2.1 Possible to view a users reactions received

Mr Lucky

Well-known member
I see in a users profile the reactions score, but is there a way to see which reactions they received and e.g. how many positives vs neutrals or negatives?

Thanks
 
Yes, open the template member_macros and search for the line:


Code:
<dd>
            {$user.reaction_score|number}
</dd>

Then insert the link tag as shown in the example:

Code:
<dd>
    <a href="{{ link('account/reactions') }}" class="fauxBlockLink-linkRow u-concealed">
            {$user.reaction_score|number}
    </a>
</dd>

After that you can see the score with a link as you can see on the pictures.

197484

197485
 
HTML:
<dd>
    <a href="{{ link('account/reactions', $xf.visitor)  }}" class="fauxBlockLink-linkRow u-concealed">
            {$user.reaction_score|number}
    </a>
</dd>

Somehow I feel like that will work. If not then let me know. It's worth a shot. I use that type of link for the member profile page medals.
 
HTML:
<dd>
    <a href="{{ link('account/reactions', $xf.visitor)  }}" class="fauxBlockLink-linkRow u-concealed">
            {$user.reaction_score|number}
    </a>
</dd>

Somehow I feel like that will work. If not then let me know. It's worth a shot. I use that type of link for the member profile page medals.
$xf.visitor is just the account of the user viewing the page, not of the person who made the post etc.

The /account/reactions route will only display your own ratings. You cannot view another's with this. It'd require an add-on or suggestion since there's no action in the members controller to view detailed ratings information for another user.
 
$xf.visitor is just the account of the user viewing the page, not of the person who made the post etc.

The /account/reactions route will only display your own ratings. You cannot view another's with this. It'd require an add-on or suggestion since there's no action in the members controller to view detailed ratings information for another user.

By your own ratings that means on anothers profile you can't view it? And yea wasn't sure if it would work. But it would work on anyones profile right? I'm not sure what you mean by not being able to view others ratings. I suppose you mean on your own profile right. Wheras you could view anyones ratings on their own profile? Or am I wrong
 
By your own ratings that means on anothers profile you can't view it? And yea wasn't sure if it would work. But it would work on anyones profile right? I'm not sure what you mean by not being able to view others ratings. I suppose you mean on your own profile right. Wheras you could view anyones ratings on their own profile? Or am I wrong
I mean it doesn't matter what page you put that template code you listed on, it'll always redirect to your own reaction page. You cannot view that page for a different user. You cannot view the breakdown for a user other than yourself.
 
I mean it doesn't matter what page you put that template code you listed on, it'll always redirect to your own reaction page. You cannot view that page for a different user. You cannot view the breakdown for a user other than yourself.

Quite, this is one of the great things I found with Post Ratings on xf1 and subsequently Content Ratings on xf2
 
Did you make a suggestion for this @Mr Lucky?

For anyone that wants to add a link you can use this code. It will only activate as a link if you're looking at your own profile or membercard, seeing as you can't see reactions of other users

Code:
    <!--[XF:stat_pairs:above_reactions]-->
    <dl class="pairs pairs--rows pairs--rows--centered">
        <dt>{{ phrase('reaction_score') }}</dt>
        <dd data-xf-init="tooltip" data-original-title="Reaction Score">
            <xf:if is ="$xf.visitor.user_id == $user.user_id">
                <a href="{{ link('account/reactions') }}">{$user.reaction_score|number}</a>
            <xf:else />
                {$user.reaction_score|number}
            </xf:if>
        </dd>
    </dl>
 
If your using Xon's content ratings, I also came up with a neat way to do this for other users, not just yourself. Apparently it required the $user variable and not $visitor. It's working on my site right now in posts and pulls up each users reaction list in the post bit. I setup a link for the reactions per user in their post bit to show it. By default the ones on profile already do that with content ratings.

Go to the template message_macros

Find:


PHP:
    <xf:if is="$extras.reaction_score">
                        <dl class="pairs pairs--justified">
                            <dt>{{ phrase('reaction_score') }}</dt> 
                                <dd>{$user.reaction_score|number}</dd>

Replace with:

PHP:
<xf:if is="$extras.reaction_score">
                        <dl class="pairs pairs--justified">
                            <dt>{{ phrase('reaction_score') }}</dt> 
<dd><a href="{{ link('members', $user) . 'ratings' }}" data-xf-click="overlay">{$user.reaction_score|number}</a></dd>
 
Looks like what you were looking for:

And 50% discount for the first customer with one-time promo code:
B36ABF4C0D414404
 
Hello, something like this ?

Regards, SyTry
 
If your using Xon's content ratings, I also came up with a neat way to do this for other users, not just yourself. Apparently it required the $user variable and not $visitor. It's working on my site right now in posts and pulls up each users reaction list in the post bit. I setup a link for the reactions per user in their post bit to show it. By default the ones on profile already do that with content ratings.

Go to the template message_macros

Find:


PHP:
    <xf:if is="$extras.reaction_score">
                        <dl class="pairs pairs--justified">
                            <dt>{{ phrase('reaction_score') }}</dt>
                                <dd>{$user.reaction_score|number}</dd>

Replace with:

PHP:
<xf:if is="$extras.reaction_score">
                        <dl class="pairs pairs--justified">
                            <dt>{{ phrase('reaction_score') }}</dt>
<dd><a href="{{ link('members', $user) . 'ratings' }}" data-xf-click="overlay">{$user.reaction_score|number}</a></dd>

I get an invalid action and controller error with the standard system with this.

Code:
The requested page could not be found. (Code: invalid_action, controller: XF:Member, action: Ratings)
 
Top Bottom