1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-19 07:08:09 +01:00

"Real" post and topic counts now updated correctly. Mass-resync your topics/forums.

git-svn-id: file:///svn/phpbb/trunk@3762 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Ludovic Arnaud 2003-03-30 21:01:01 +00:00
parent d29495c6c3
commit 36011792e6

View File

@ -819,7 +819,7 @@ function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_
$forum_ids .= ', ' . $parent_forum_id;
}
$forum_topics_sql = ($mode == 'post') ? ', forum_topics = forum_topics + 1' : '';
$forum_topics_sql = ($mode == 'post') ? ', forum_topics = forum_topics + 1, forum_topics_real = forum_topics_real + 1' : '';
$forum_sql = array(
'forum_last_post_id' => $post_data['post_id'],
'forum_last_post_time' => $current_time,
@ -845,7 +845,7 @@ function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_
));
}
$topic_replies_sql = ($mode == 'reply') ? ', topic_replies = topic_replies + 1' : '';
$topic_replies_sql = ($mode == 'reply') ? ', topic_replies = topic_replies + 1, topic_replies_real = topic_replies_real + 1' : '';
$sql = 'UPDATE ' . TOPICS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $topic_sql) . $topic_replies_sql . ' WHERE topic_id = ' . $post_data['topic_id'];
$db->sql_query($sql);
@ -952,7 +952,7 @@ function delete_post($mode, $post_id, $topic_id, $forum_id, $post_data)
$forum_update_sql = '';
$user_update_sql = '';
$topic_update_sql = 'topic_replies = topic_replies - 1';
$topic_update_sql = 'topic_replies = topic_replies - 1, topic_replies_real = topic_replies_real - 1, ';
// Only one post... delete topic
if ($post_data['topic_first_post_id'] == $post_data['topic_last_post_id'])
@ -967,7 +967,7 @@ function delete_post($mode, $post_id, $topic_id, $forum_id, $post_data)
$db->sql_query($sql);
$forum_update_sql .= ($forum_update_sql != '') ? ', ' : '';
$forum_update_sql .= 'forum_topics = forum_topics - 1';
$forum_update_sql .= 'forum_topics = forum_topics - 1, forum_topics_real = forum_topics_real - 1';
}
// Update Post Statistics