diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-02-23 17:54:32 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-02-23 17:54:32 +0000 |
commit | 1ac0497ea020adee05e71408fce4a8d1241d3c0c (patch) | |
tree | 6a5bf23b10c42bb2e5d2727e52e5cb43426da268 | |
parent | aca19b4d0d77061f6502b3b48e239b10c927f785 (diff) | |
download | forums-1ac0497ea020adee05e71408fce4a8d1241d3c0c.tar forums-1ac0497ea020adee05e71408fce4a8d1241d3c0c.tar.gz forums-1ac0497ea020adee05e71408fce4a8d1241d3c0c.tar.bz2 forums-1ac0497ea020adee05e71408fce4a8d1241d3c0c.tar.xz forums-1ac0497ea020adee05e71408fce4a8d1241d3c0c.zip |
Fixed updating of user post count on deletion
git-svn-id: file:///svn/phpbb/trunk@2203 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/includes/post.php | 8 | ||||
-rw-r--r-- | phpBB/posting.php | 1 |
2 files changed, 9 insertions, 0 deletions
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'] ) diff --git a/phpBB/posting.php b/phpBB/posting.php index 2e429407ec..d009f9a804 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -234,6 +234,7 @@ if ( $result = $db->sql_query($sql) ) $post_data['last_topic'] = ( $post_info['forum_last_post_id'] == $post_id ) ? true : false; $post_data['has_poll'] = ( $post_info['topic_vote'] ) ? true : false; $post_data['topic_type'] = $post_info['topic_type']; + $post_data['poster_id'] = $post_info['poster_id']; if ( $post_data['first_post'] && $post_data['has_poll'] ) { |