Fixed updating of user post count on deletion

git-svn-id: file:///svn/phpbb/trunk@2203 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2002-02-23 17:54:32 +00:00
parent aca19b4d0d
commit 1ac0497ea0
2 changed files with 9 additions and 0 deletions

View file

@ -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'] )

View file

@ -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'] )
{