MyBB Community Forums

Full Version: Soft Delete Posts Hidden
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In MyBB 1.8.10, it seems some soft deleted posts are not showing up. The posts are being soft-deleted correctly but are hidden with display: none.

in functions_post.php
// Has this post been deleted but can be viewed? Hide this post
if($post['visible'] == -1 && is_moderator($fid, "canviewdeleted"))
{ 
$deleted_message = $lang->sprintf($lang->postbit_deleted_post_user, $post['username']);
eval("\$deleted_bit = \"".$templates->get("postbit_deleted")."\";");
$post_visibility = "display: none;";
}


Shouldn't this line
is_moderator($fid, "canviewdeleted")

Be negated (not)
!is_moderator($fid, "canviewdeleted")

Or am I reading that incorrectly? "If the post is -1 visibility (soft deleted) and the moderator canviewdeleted, then hide it". It should be "If the post is -1 visibility (soft deleted) and the moderator CANNOT canviewdeleted, then hide it"

Or am I being totally oblivious to something else going on here? I searched and didn't see any reports on this yet.
I don't know if this is the same issue but it's worth trying/taking a look.

Read this: https://community.mybb.com/thread-207536...pid1262225
Thanks, I will check. I still believe the logic is incorrect though.
Make sure your postbit and postbit_classic templates actually have $deleted_bit in them on the first line - the functionality works correctly here, and the issues people have had with it have generally been with outdated templates, so I think the logic is correct. It sets it to display:none if you can view it, because as of 1.8.9 (I think?) the soft deleted posts are toggled with a button, whereas before they were displayed with a coloured background - they are then shown again with javascript. We've had users with things working backwards if the templates weren't updated.
Ah, I think I understand. I will check, thank you.
(2017-02-13, 09:47 PM)spork985 Wrote: [ -> ]......I still believe the logic is incorrect though.

The logic is correct:

If the post is soft deleted (visible -1) and if it's a moderator which can see deleted posts
if($post['visible'] == -1 && is_moderator($fid, "canviewdeleted"))

then show the template with "show" button
$deleted_message = $lang->sprintf($lang->postbit_deleted_post_user, $post['username']);
eval("\$deleted_bit = \"".$templates->get("postbit_deleted")."\";");

but not the whole post.
$post_visibility = "display: none;";