aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-08-09 17:33:44 +0200
committerTristan Darricau <github@nicofuma.fr>2014-08-09 17:33:44 +0200
commit86f94f922ce53b58d27a4f294248f5aa32fc97f8 (patch)
tree18f0cf6bdc5f1d1283358832fd0e17562655af4d /phpBB/includes
parent02801dee7c92d80705f64f3a1773cd39bc41a682 (diff)
parent15afaafcb67298ff7fabf3b1b4326bbc2a5975ba (diff)
downloadforums-86f94f922ce53b58d27a4f294248f5aa32fc97f8.tar
forums-86f94f922ce53b58d27a4f294248f5aa32fc97f8.tar.gz
forums-86f94f922ce53b58d27a4f294248f5aa32fc97f8.tar.bz2
forums-86f94f922ce53b58d27a4f294248f5aa32fc97f8.tar.xz
forums-86f94f922ce53b58d27a4f294248f5aa32fc97f8.zip
Merge pull request #2624 from dhruvgoel92/ticket/12718
[ticket/12718] Use remove_topic_from_statistic() for delete_topic * dhruvgoel92/ticket/12718: [ticket/12718] Use a separate variable for sql query [ticket/12718] Fix spacing and type casting [ticket/12718] Fix docblocks [ticket/12718] Add tests to check user_posts on post deletion [ticket/12718] Update docblock [ticket/12718] Use remove_topic_from_statistic() for delete_topic
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions_posting.php13
1 files changed, 1 insertions, 12 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index fb09bc7057..624ce187b9 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -1324,18 +1324,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data, $is_soft = false, $
{
delete_topics('topic_id', array($topic_id), false);
- if ($data['topic_visibility'] == ITEM_APPROVED)
- {
- $sql_data[FORUMS_TABLE] .= 'forum_posts_approved = forum_posts_approved - 1, forum_topics_approved = forum_topics_approved - 1';
- }
- else if ($data['topic_visibility'] == ITEM_UNAPPROVED || $data['post_visibility'] == ITEM_REAPPROVE)
- {
- $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';
- }
+ $phpbb_content_visibility->remove_topic_from_statistic($data, $sql_data);
$update_sql = update_post_information('forum', $forum_id, true);
if (sizeof($update_sql))