aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_posting.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2012-10-22 17:34:37 +0200
committerJoas Schilling <nickvergessen@gmx.de>2012-10-22 17:34:37 +0200
commiteb9c39971bfe7c11d62466b8fab239a8fcbc8952 (patch)
treeb49b4c695f8a4a32c5d32b24f906cc51d85e8cd3 /phpBB/includes/functions_posting.php
parent0a07635329b149ddf500f29f3363f2e9a94fb022 (diff)
downloadforums-eb9c39971bfe7c11d62466b8fab239a8fcbc8952.tar
forums-eb9c39971bfe7c11d62466b8fab239a8fcbc8952.tar.gz
forums-eb9c39971bfe7c11d62466b8fab239a8fcbc8952.tar.bz2
forums-eb9c39971bfe7c11d62466b8fab239a8fcbc8952.tar.xz
forums-eb9c39971bfe7c11d62466b8fab239a8fcbc8952.zip
[feature/soft-delete] Fix forum syncing in ACP and deleting posts
PHPBB3-9567
Diffstat (limited to 'phpBB/includes/functions_posting.php')
-rw-r--r--phpBB/includes/functions_posting.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 02b6b0e697..7962690ca8 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -1507,9 +1507,18 @@ function delete_post($forum_id, $topic_id, $post_id, &$data, $is_soft = false, $
{
delete_topics('topic_id', array($topic_id), false);
-
- $sql_data[FORUMS_TABLE] .= 'forum_topics_real = forum_topics_real - 1';
- $sql_data[FORUMS_TABLE] .= ($data['topic_visibility'] == ITEM_APPROVED) ? ', forum_posts = forum_posts - 1, forum_topics = forum_topics - 1' : '';
+ if ($data['topic_visibility'] == ITEM_APPROVED)
+ {
+ $sql_data[FORUMS_TABLE] .= 'forum_posts = forum_posts - 1, forum_topics = forum_topics - 1';
+ }
+ else if ($data['topic_visibility'] == ITEM_UNAPPROVED)
+ {
+ $sql_data[FORUMS_TABLE] .= 'forum_posts_unapproved = forum_posts_unapproved - 1, forum_topics_unapproved = forum_topics_unapproved - 1';
+ }
+ else if ($data['topic_visibility'] == ITEM_DELETED)
+ {
+ $sql_data[FORUMS_TABLE] .= 'forum_posts_softdeleted = forum_posts_softdeleted - 1, forum_topics_softdeleted = forum_topics_softdeleted - 1';
+ }
$update_sql = update_post_information('forum', $forum_id, true);
if (sizeof($update_sql))