We can not use the replies vs replies_real anymore, as we need to be able to
determinate whether the posts are unapproved or softdeleted. So we need to add
a new field and there by change the second one for consistency.
We also add the posts_* fields for forums, which are a missing feature.
PHPBB3-9567
If a topic is soft deleted through a moderator, the topic_delete_user is set.
If it is passively soft deleted (f.e. while the only approved post is deleted)
the topic_delete_user is not set. This way, we can distinguish between these
two cases. The same also applies to unapproved posts. So we need to set the
topic_delete_user when an unapproved topic is posted.
Topics that were soft deleted/unapproved by a user (rather then passive) are
going to be displayed in the Topics modules, while all others are in the posts
modules of the MCP queue.
PHPBB3-9567
Unapproved/soft deleted posts are posts, that have a different visibility than
the topic. All others will be hidden from the posts list and can be managed
with the topic modules.
PHPBB3-9567
- $post_visibility is not boolean, so we need to check for == ITEM_APPROVED
- sync() already updates the topic/forum info, so we don't need to do that again
- use set_post_visibility() when changing the posts visibility
Should be ready for testing.
PHPBB3-9567
We should discuss this in an RFC again, but for now, we just fix the old state.
So moderators can only reply, when the topic is approved.
Also fixes a bug in the visibility check. We need to check the posts visibility
rather then the visibility of the topic. Because when the post is visible, the
topic is as well, but not the other way round.
PHPBB3-9567
This also makes sync('topic_visibility') obsolete, but we keep it for now.
Also fix a unit test, because ITEM_DELETED overpowers ITEM_UNAPPROVED
PHPBB3-9567
The function can not rely on the first post anymore, as that one could be soft
deleted but the topic still has approved replies which are still visible.
PHPBB3-9567
Before soft delete this was much easier, as an unapproved topic could only
have one post, because no one could reply to unapproved topics. Now we need
to run multiple queries to correctly reduce the post counts.
PHPBB3-9567
The Logic of $forum_ary was inverted, so if the array is empty, we can skip
the queries. We also should not merge passworded forums into the $forum_ary
as we removed them from that array right before that.
PHPBB3-9567
This is an additional query in some rare cases,
but it makes it much easier to use and understand.
This is mostly a preparation for the restore case.
PHPBB3-9567