From 1ac0497ea020adee05e71408fce4a8d1241d3c0c Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sat, 23 Feb 2002 17:54:32 +0000 Subject: Fixed updating of user post count on deletion git-svn-id: file:///svn/phpbb/trunk@2203 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/post.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'phpBB/includes/post.php') diff --git a/phpBB/includes/post.php b/phpBB/includes/post.php index c9b21eb8fa..f927001578 100644 --- a/phpBB/includes/post.php +++ b/phpBB/includes/post.php @@ -484,6 +484,14 @@ function delete_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_ { message_die(GENERAL_ERROR, "Error in deleting post", "", __LINE__, __FILE__, $sql); } + + $sql = "UPDATE " . USERS_TABLE . " + SET user_posts = user_posts - 1 + WHERE user_id = " . $post_data['poster_id']; + if ( !($db->sql_query($sql)) ) + { + message_die(GENERAL_ERROR, "Error in deleting post", "", __LINE__, __FILE__, $sql); + } } if( $mode == "poll_delete" || ( $mode == "delete" && $post_data['first_post'] && $post_data['last_post'] ) && $post_data['has_poll'] && $post_data['edit_poll'] ) -- cgit v1.2.1