• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • 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.
  • 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)

Vincent

Well-known member
#1
Hello,

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

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
Code:
'deleted' => XenForo_Permission::hasContentPermission($nodePermissions, 'viewDeleted'),
to

Code:
'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:
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>
to

Code:
<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>
 
R

ragtek

Guest
#2
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:
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..

AND
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

Well-known member
#3
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..

AND
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
Is there any good tutorial on the xf event listener?
 

dieketzer

Well-known member
#4
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.
 

Ingenious

Well-known member
#5
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.