• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.4 "Ignore user" under post, next to "report"

#1
Is this something that's possible? I'd like to have a duplicate "ignore user" alongside the "report" button below posts. Not sure how to do it or if it's possible?
 
#4
Code:
                        <xen:if is="{$canIgnore}">
                            <a href="{xen:link members/ignore, $visitor}" class="FollowLink">{xen:phrase ignore}</a>
                        </xen:if>
You would need to do some editing, but the code you want to add is something like that^
You would also need to make the ignore button not show to already ignored users. I found the following in the member_view template.
Code:
<xen:follow user="$user" title="" tag="li" />
                        <xen:if is="{xen:helper isIgnored, $user.user_id}">
                            <li><a href="{xen:link members/unignore, $user}" class="FollowLink">{xen:phrase unignore}</a></li>
                        <xen:elseif is="{$canIgnore}" />
                            <li><a href="{xen:link members/ignore, $user}" class="FollowLink">{xen:phrase ignore}</a></li>
                        </xen:if>
Note $user isn't apart of the post template(I tried and I got errors)
 
#5
I can get $post_userid (id of poster) and $visitor_userid (my id) and check if logged in, but not sure who to get the $post_user (or whatever) for the post username. I thought with that combination I would be able to make it work, no luck so far but still plugging away and will share if I crack it.
 
#6
This is what I have conjured up, as it seems the username isn't required for the ignore links to works, just userid (standard format is username.userid in the URL). But this doesn't show anything?

Code:
<xen:if is="{$visitor.user_id} AND {$post.user_id} != {$visitor.user_id}">
                    <xen:if is="{xen:helper isIgnored, $post.user_id}"><a href="{xen:link members/unignore, $post.user_id}">{xen:phrase unignore}</a>
                    <xen:elseif is="{$canIgnore}" /><a href="{xen:link members/ignore, $post.user_id}">{xen:phrase ignore}</a></xen:if>
                </xen:if>
So what I'm doing there (in theory) is checking if the poster is the viewer, if not checking if they are or can ignore the poster, and providing the link to do so. Just... nothing?
 

Liam W

Well-known member
#7
What template are you adding it to (and where).

Liam

EDIT: It won't work, because you're checking the canIgnore variable which isn't available in the post template.
 
Last edited:
#8
EDIT: It won't work, because you're checking the canIgnore variable which isn't available in the post template.
Ah. That explains that then. Damn, without that being available that pretty much puts an end to my mission doesn't it?

And yes to be clear it is the "post" template I'm editing as I wanted it next to "report".
 

Liam W

Well-known member
#9
Ah. That explains that then. Damn, without that being available that pretty much puts an end to my mission doesn't it?

And yes to be clear it is the "post" template I'm editing as I wanted it next to "report".
You could remove that check, and display it to all users, or ask someone make an add-on to do all of this for you :)

Liam
 
#10
You could remove that check, and display it to all users, or ask someone make an add-on to do all of this for you :)

Liam
I don't think it's smart to show people links they can't effectively use so I'll pass for now, it's not worth paying for but I may have a go in the future at working this all out properly.