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

Prevent last post quoting

Discussion in 'Styling and Customization Questions' started by AndreaMarucci, Nov 7, 2013.

  1. AndreaMarucci

    AndreaMarucci Well-Known Member

    Some time ago I've installed an addon in XF 1.1 that hide the quote button on the last post avoiding users replying using the quote button. Problem is that that addon hide the quote button on the last post of every thread page and this is not the correct behaviour since the button should be hidden only on the discussion's last post and not on the other pages.

    Someone know if such an addon exist for Xenforo?
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    Was it an add-on or a conditional you used?
  3. AndreaMarucci

    AndreaMarucci Well-Known Member

    My mistake. Was not an addon but probably a conditional or something like that. Problem was that the behaviour was erratic as I've explained so I'm searching a way to make it works as it should. I'll try to search what I've implemented in 1.1...
  4. Syndol

    Syndol Guest

    Do you mean hiding the "Reply" link on the last post?
    If so then you need to change the following line in post template:
    <xen:if is="{$canReply}">
    <xen:if is="{$canReply} AND {$post.post_id} != {$thread.last_post_id}">
    AndreaMarucci likes this.
  5. AndreaMarucci

    AndreaMarucci Well-Known Member

    Thanks Syndol, this hide the quote button on the thread's lastest post and not in the thread's last post of each page, isn't it?
  6. Syndol

    Syndol Guest

    That is correct.
  7. AndreaMarucci

    AndreaMarucci Well-Known Member

    Worked perfectly. Thank you!!!
  8. JackieChun

    JackieChun Active Member

    Could anyone verify if this conditional still works in XenForo 1.5 or is there a better way to do this? If so, which template needs to be modified?

    P.S. I would also be interested in preventing the first post in the thread from being quoted.
  9. Brogan

    Brogan XenForo Moderator Staff Member

    It should still work.
  10. JackieChun

    JackieChun Active Member

    @Brogan Thanks, so which template is it? Any idea how to hide the button in the first AND last post?
  11. Ingenious

    Ingenious Well-Known Member

    The same template as above, "post".

    Follow Syndol's instructions but change the code to:

    <xen:if is="{$canReply} AND {$post.post_id} != {$thread.last_post_id} AND {$post.post_id} != {$thread.first_post_id}">
    ..which adds an extra check to make sure it's not the first post, as well as the last post.

    I've tested this in 1.5 and it works.
    OperaManiac likes this.
  12. JackieChun

    JackieChun Active Member

    Thank you! Will this put additional overhead on the forum's engine or hinder the performance in any way?
  13. Brogan

    Brogan XenForo Moderator Staff Member

  14. JackieChun

    JackieChun Active Member

    Got the conditional installed, thanks. Unfortunately with this solution the quote button is hidden in the post before the last if you've just replied without refreshing the page.
  15. OperaManiac

    OperaManiac Well-Known Member

    Is this code also supposed to hide the multi-quote button?

Share This Page