mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-11 05:48:51 +00:00
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:
parent
aca19b4d0d
commit
1ac0497ea0
2 changed files with 9 additions and 0 deletions
|
@ -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);
|
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'] )
|
if( $mode == "poll_delete" || ( $mode == "delete" && $post_data['first_post'] && $post_data['last_post'] ) && $post_data['has_poll'] && $post_data['edit_poll'] )
|
||||||
|
|
|
@ -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['last_topic'] = ( $post_info['forum_last_post_id'] == $post_id ) ? true : false;
|
||||||
$post_data['has_poll'] = ( $post_info['topic_vote'] ) ? true : false;
|
$post_data['has_poll'] = ( $post_info['topic_vote'] ) ? true : false;
|
||||||
$post_data['topic_type'] = $post_info['topic_type'];
|
$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'] )
|
if ( $post_data['first_post'] && $post_data['has_poll'] )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue