From 6e6636fbd2df117d47515f5e38d3881fa9f139e7 Mon Sep 17 00:00:00 2001 From: David M Date: Tue, 10 Jul 2007 03:14:17 +0000 Subject: [PATCH] #13167 git-svn-id: file:///svn/phpbb/trunk@7856 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/functions_posting.php | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 7f6fc30540..825c289d42 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -195,6 +195,7 @@ p a {
  • [Fix] Account for the forum id not being part of the request uri in prosilver (Bug #13121)
  • [Fix] Properly alter PostgreSQL tables
  • [Fix] Properly cache template files that were stored in the database (Bug #12675)
  • +
  • [Fix] Do not count the deletion of an unapproved topic as a decrease in normally viewable posts (Bug #13167)
  • diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 21b2677483..c3190cdee8 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1368,8 +1368,8 @@ function delete_post($forum_id, $topic_id, $post_id, &$data) if ($data['topic_type'] != POST_GLOBAL) { - $sql_data[FORUMS_TABLE] .= 'forum_posts = forum_posts - 1, forum_topics_real = forum_topics_real - 1'; - $sql_data[FORUMS_TABLE] .= ($data['topic_approved']) ? ', forum_topics = forum_topics - 1' : ''; + $sql_data[FORUMS_TABLE] .= 'forum_topics_real = forum_topics_real - 1'; + $sql_data[FORUMS_TABLE] .= ($data['topic_approved']) ? ', forum_posts = forum_posts - 1, forum_topics = forum_topics - 1' : ''; } $update_sql = update_post_information('forum', $forum_id, true); @@ -1392,7 +1392,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data) if ($data['topic_type'] != POST_GLOBAL) { - $sql_data[FORUMS_TABLE] = 'forum_posts = forum_posts - 1'; + $sql_data[FORUMS_TABLE] = ($data['post_approved']) ? 'forum_posts = forum_posts - 1' : ''; } $sql_data[TOPICS_TABLE] = 'topic_first_post_id = ' . intval($row['post_id']) . ", topic_first_poster_colour = '" . $db->sql_escape($row['user_colour']) . "', topic_first_poster_name = '" . (($row['poster_id'] == ANONYMOUS) ? $db->sql_escape($row['post_username']) : $db->sql_escape($row['username'])) . "'"; @@ -1406,7 +1406,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data) case 'delete_last_post': if ($data['topic_type'] != POST_GLOBAL) { - $sql_data[FORUMS_TABLE] = 'forum_posts = forum_posts - 1'; + $sql_data[FORUMS_TABLE] = ($data['post_approved']) ? 'forum_posts = forum_posts - 1' : ''; } $update_sql = update_post_information('forum', $forum_id, true); @@ -1451,7 +1451,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data) if ($data['topic_type'] != POST_GLOBAL) { - $sql_data[FORUMS_TABLE] = 'forum_posts = forum_posts - 1'; + $sql_data[FORUMS_TABLE] = ($data['post_approved']) ? 'forum_posts = forum_posts - 1' : ''; } $sql_data[TOPICS_TABLE] = 'topic_replies_real = topic_replies_real - 1' . (($data['post_approved']) ? ', topic_replies = topic_replies - 1' : ''); @@ -2231,7 +2231,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - // salvation, a post is found! jam it into the forums table + // salvation, a post is found! jam it into the topics table $sql_data[TOPICS_TABLE]['stat'][] = 'topic_last_post_id = ' . (int) $row['post_id']; $sql_data[TOPICS_TABLE]['stat'][] = "topic_last_post_subject = '" . $db->sql_escape($row['post_subject']) . "'"; $sql_data[TOPICS_TABLE]['stat'][] = 'topic_last_post_time = ' . (int) $row['post_time'];