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

XF 1.4 Remove the "view" capability of soft-deleted threads

Discussion in 'Styling and Customization Questions' started by jauburn, Jan 12, 2015.

  1. jauburn

    jauburn Well-Known Member

    On my board, users have the ability to delete their own threads. However, we have recently found it important also to allow members to see the soft deletions (the greyed-out thread text, etc.) so that they know who deleted the thread--i.e., that it was not a heavy-handed admin.

    However, understandably the person who deleted the thread does not want the content to remain visible, even to members. So I would like to know how to remove the View capability for registered users (although not for moderators or admins) so that deleted thread content cannot be viewed by members.

    The graphic below has an arrow pointing to the text that I would like to remove for all but moderators and admins. Would someone be so kind as to tell me which template I would edit and what conditional code I would use to make this happen?


  2. Brogan

    Brogan XenForo Moderator Staff Member

    The thread_list_item_deleted template:

    <a href="{xen:link threads, $thread}" class="viewLink">{xen:phrase view}</a>
    <xen:if is="{$visitor.is_admin} OR {$visitor.is_moderator}">
        <a href="{xen:link threads, $thread}" class="viewLink">{xen:phrase view}</a>
    Adam K M and jauburn like this.
  3. jauburn

    jauburn Well-Known Member

    This worked superbly, Brogan. Thank you so much!
  4. jauburn

    jauburn Well-Known Member

    Brogan, following up on this, I'm told by a user that although deleted threads can no longer be viewed by members and guests using the method above, deleted posts can still be viewed. Would you be so kind as to provide the code necessary for me to implement a similar change so that when a member deleted his/her own post, it can no longer be viewed by other members but by admins and moderators?

    Thanks again!
  5. Adam K M

    Adam K M Active Member

    Users have permission to see deleted posts (ie. messages) contained within threads, for the same reason?

    If you're familiar with template edits, you could start off by finding the appropriate template/loop which handles post render, and wrap the content with the xen syntax that Brogan provided above.

Share This Page