1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum is for release discussion only. Discussions that do not relate specifically to the resource release should be discussed in another, more appropriate forum.
    Dismiss Notice
  3. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Allow the "Message is deleted by X placeholder" to Everyone (Not just staff)

Discussion in 'Code Modifications [Archive]' started by Vincent, Aug 6, 2011.

  1. Vincent

    Vincent Well-Known Member


    If you want to show this message: (There's a fix for the "Show" button too ;) )

    To everyone, not just the Moderators and Administrators this can be done by editing one line of code ;)

    Go to /library/XenForo/Model/Post.php and change
    'deleted' => XenForo_Permission::hasContentPermission($nodePermissions, 'viewDeleted'),

    'deleted' => true,
    Now, everyone will be able to see the message I posted above + they will be able to click the "Show" button and view the post. I personally don't want them to be able to view the post, so I changed, in the template post_deleted_placeholder, this line of code:
    <a href="{xen:link threads/show-posts, $thread, 'post_id={$post.post_id}'}" class="MessageLoader control item show" data-messageSelector="#post-{$post.post_id}"><span></span>{xen:phrase show}</a>

    <xen:if is="{$post.canInlineMod}"><a href="{xen:link threads/show-posts, $thread, 'post_id={$post.post_id}'}" class="MessageLoader control item show" data-messageSelector="#post-{$post.post_id}"><span></span>{xen:phrase show}</a></xen:if>
    lasertits and Ingenious like this.
  2. ragtek

    ragtek Guest

    hiding the link doesn't mean that it can't be accessed,so even after your template change, "everybody" (who's familiar with this) will be able to see the posts..

    changing the original files sucks! you'll need to do the same change on every xf upgrade, ....
    It's better to use the xf event listener system for this
    Vincent likes this.
  3. Vincent

    Vincent Well-Known Member

    Is there any good tutorial on the xf event listener?
  4. dieketzer

    dieketzer Well-Known Member

    i have to maintain a similar change to my board. i really wish this was an option available to those that dont subscribe to the stealth moderation philosophy.
  5. Ingenious

    Ingenious Well-Known Member

    Thanks VincentU for that useful post - although modifications to files are not always the best answer, sometimes it's just easier to do this especially if you don't know how to code an add-on.

    I do like the deleted posts options I have in vB because quite often it's actually less hassle to show that a post has been deleted and why.
    Vincent likes this.
  6. lasertits

    lasertits Active Member

    I too would really like to find one.

Share This Page