• 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
Hello,

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

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>
 
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
 
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?
 
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.
 
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.
 
Top Bottom