diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2011-02-24 20:59:19 -0500 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2011-02-24 20:59:19 -0500 |
commit | ee0db1a1d5f0150016d0971057f889f2366f9856 (patch) | |
tree | b08d0b98244541ba8b31fc3e24f01e883b08bcd2 /phpBB/includes/functions_user.php | |
parent | 76ad7c938d7834c09c98b6759dca4a196eb3c29b (diff) | |
parent | 904bcb86a054ab6256da565098eb9bd8ab20414b (diff) | |
download | forums-ee0db1a1d5f0150016d0971057f889f2366f9856.tar forums-ee0db1a1d5f0150016d0971057f889f2366f9856.tar.gz forums-ee0db1a1d5f0150016d0971057f889f2366f9856.tar.bz2 forums-ee0db1a1d5f0150016d0971057f889f2366f9856.tar.xz forums-ee0db1a1d5f0150016d0971057f889f2366f9856.zip |
Merge branch 'develop-olympus' into develop
* develop-olympus:
[ticket/9874] view_log() performs unneeded count query over all log entries.
[ticket/7834] Topic time didn't update when first post was deleted
[ticket/9997] Fixed an inconsistency in the Moderator Control Panel
[ticket/9872] Removed some useless code that broke delete_posts
Diffstat (limited to 'phpBB/includes/functions_user.php')
-rw-r--r-- | phpBB/includes/functions_user.php | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 317578cd54..0a1260daed 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -482,44 +482,6 @@ function user_delete($mode, $user_id, $post_username = false) include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); } - $sql = 'SELECT topic_id, COUNT(post_id) AS total_posts - FROM ' . POSTS_TABLE . " - WHERE poster_id = $user_id - GROUP BY topic_id"; - $result = $db->sql_query($sql); - - $topic_id_ary = array(); - while ($row = $db->sql_fetchrow($result)) - { - $topic_id_ary[$row['topic_id']] = $row['total_posts']; - } - $db->sql_freeresult($result); - - if (sizeof($topic_id_ary)) - { - $sql = 'SELECT topic_id, topic_replies, topic_replies_real - FROM ' . TOPICS_TABLE . ' - WHERE ' . $db->sql_in_set('topic_id', array_keys($topic_id_ary)); - $result = $db->sql_query($sql); - - $del_topic_ary = array(); - while ($row = $db->sql_fetchrow($result)) - { - if (max($row['topic_replies'], $row['topic_replies_real']) + 1 == $topic_id_ary[$row['topic_id']]) - { - $del_topic_ary[] = $row['topic_id']; - } - } - $db->sql_freeresult($result); - - if (sizeof($del_topic_ary)) - { - $sql = 'DELETE FROM ' . TOPICS_TABLE . ' - WHERE ' . $db->sql_in_set('topic_id', $del_topic_ary); - $db->sql_query($sql); - } - } - // Delete posts, attachments, etc. delete_posts('poster_id', $user_id); |