diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2012-10-22 14:21:44 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2012-10-22 14:22:56 +0200 |
commit | 168dd29f24843e97182c894a5d43a7d38f8a195c (patch) | |
tree | eef3459b51f0fbb95bc9ee5988a9f5c0ddf40c72 /phpBB/includes/acp/acp_users.php | |
parent | 9945561b4b58e4825fd2290ae1fbbb3d49fd3e7c (diff) | |
download | forums-168dd29f24843e97182c894a5d43a7d38f8a195c.tar forums-168dd29f24843e97182c894a5d43a7d38f8a195c.tar.gz forums-168dd29f24843e97182c894a5d43a7d38f8a195c.tar.bz2 forums-168dd29f24843e97182c894a5d43a7d38f8a195c.tar.xz forums-168dd29f24843e97182c894a5d43a7d38f8a195c.zip |
[feature/soft-delete] Fix sync() and some more functions to use the new fields
PHPBB3-9567
Diffstat (limited to 'phpBB/includes/acp/acp_users.php')
-rw-r--r-- | phpBB/includes/acp/acp_users.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 304027df45..1a3511bc50 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -621,29 +621,31 @@ class acp_users $topic_id_ary = $move_topic_ary = $move_post_ary = $new_topic_id_ary = array(); $forum_id_ary = array($new_forum_id); - $sql = 'SELECT topic_id, COUNT(post_id) AS total_posts + $sql = 'SELECT topic_id, post_visibility, COUNT(post_id) AS total_posts FROM ' . POSTS_TABLE . " WHERE poster_id = $user_id AND forum_id <> $new_forum_id - GROUP BY topic_id"; + GROUP BY topic_id, post_visibility"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { - $topic_id_ary[$row['topic_id']] = $row['total_posts']; + $topic_id_ary[$row['topic_id']][$row['post_visibility']] = $row['total_posts']; } $db->sql_freeresult($result); if (sizeof($topic_id_ary)) { - $sql = 'SELECT topic_id, forum_id, topic_title, topic_replies, topic_replies_real, topic_attachment + $sql = 'SELECT topic_id, forum_id, topic_title, topic_posts, topic_posts_unapproved, topic_posts_softdeleted, topic_attachment FROM ' . TOPICS_TABLE . ' WHERE ' . $db->sql_in_set('topic_id', array_keys($topic_id_ary)); $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { - if (max($row['topic_replies'], $row['topic_replies_real']) + 1 == $topic_id_ary[$row['topic_id']]) + if ($topic_id_ary[$row['topic_id']][ITEM_APPROVED] == $row['topic_posts'] + && $topic_id_ary[$row['topic_id']][ITEM_UNAPPROVED] == $row['topic_posts_unapproved'] + && $topic_id_ary[$row['topic_id']][ITEM_DELETED] == $row['topic_posts_softdeleted']) { $move_topic_ary[] = $row['topic_id']; } |