From ab9586a7f388aa82b567a677224c52fc9258cb0b Mon Sep 17 00:00:00 2001 From: David M Date: Mon, 30 Apr 2007 16:18:59 +0000 Subject: [PATCH] #10295 git-svn-id: file:///svn/phpbb/trunk@7441 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_posting.php | 14 ++++++++++++-- phpBB/includes/mcp/mcp_main.php | 12 +++++++----- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 4b7d8ff8c0..333dac8b56 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1534,6 +1534,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u break; } + $post_approved = $sql_data[POSTS_TABLE]['sql']['post_approved']; + // And the topic ladies and gentlemen switch ($post_mode) { @@ -1879,14 +1881,22 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u { if ($topic_type != POST_GLOBAL) { - $update_sql = update_post_information('forum', $data['forum_id'], true, $data['post_id']); + if ($post_approved) + { + $update_sql = update_post_information('forum', $data['forum_id'], true, $data['post_id']); + } + if (sizeof($update_sql)) { $sql_data[FORUMS_TABLE]['stat'][] = implode(', ', $update_sql[$data['forum_id']]); } } - $update_sql = update_post_information('topic', $data['topic_id'], true, $data['post_id']); + if ($post_approved) + { + $update_sql = update_post_information('topic', $data['topic_id'], true, $data['post_id']); + } + if (sizeof($update_sql)) { $sql_data[TOPICS_TABLE]['stat'][] = implode(', ', $update_sql[$data['topic_id']]); diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 6457204508..0cf90a7ad2 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -546,11 +546,12 @@ function mcp_move_topic($topic_ids) $db->sql_freeresult($result); $forum_sync_data[$forum_id]['forum_posts'] -= (int) $row_data['topic_posts']; + $forum_sync_data[$forum_id]['forum_topics'] -= (int) $topics_authed_moved; + $forum_sync_data[$forum_id]['forum_topics_real'] -= (int) $topics_moved; + $forum_sync_data[$to_forum_id]['forum_posts'] += (int) $row_data['topic_posts']; - $forum_sync_data[$forum_id]['forum_topics'] -= (int) $topics_moved; - $forum_sync_data[$to_forum_id]['forum_topics'] += (int) $topics_moved; - $forum_sync_data[$forum_id]['forum_topics_real'] -= (int) $topics_authed_moved; - $forum_sync_data[$to_forum_id]['forum_topics_real'] += (int) $topics_authed_moved; + $forum_sync_data[$to_forum_id]['forum_topics'] += (int) $topics_authed_moved; + $forum_sync_data[$to_forum_id]['forum_topics_real'] += (int) $topics_moved; $db->sql_transaction('begin'); @@ -613,6 +614,7 @@ function mcp_move_topic($topic_ids) $db->sql_query('INSERT INTO ' . TOPICS_TABLE . $db->sql_build_array('INSERT', $shadow)); $forum_sync_data[(int) $row['forum_id']]['forum_topics']++; + $forum_sync_data[(int) $row['forum_id']]['forum_topics_real']++; } } unset($topic_data); @@ -620,7 +622,7 @@ function mcp_move_topic($topic_ids) $success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_MOVED_SUCCESS' : 'TOPICS_MOVED_SUCCESS'; // we must update the info, this post is being moved and is not the newest anymore - if ($forum_sync_data[$forum_id]['forum_last_post_id'] == $row_data['last_post_id']) + if ($forum_sync_data[$forum_id]['forum_last_post_id'] == $row_data['last_post_id'] && $row_data['']) { $forum_sync_data[$forum_id]['forum_last_post_id'] = 0; $forum_sync_data[$forum_id]['forum_last_post_subject'] = '';