From b0bfd5c66f8f1f1cf48f9aff362036e17d387d50 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 18 Mar 2008 14:44:51 +0000 Subject: Correctly update board statistics for attaching orphaned files to existing posts (Bug #20185) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8451 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_attachments.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'phpBB/includes') diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 1db1602665..d6f32bda53 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -940,6 +940,7 @@ class acp_attachments AND is_orphan = 1'; $result = $db->sql_query($sql); + $files_added = $space_taken = 0; while ($row = $db->sql_fetchrow($result)) { $post_row = $post_info[$upload_list[$row['attach_id']]]; @@ -979,9 +980,18 @@ class acp_attachments WHERE topic_id = ' . $post_row['topic_id']; $db->sql_query($sql); + $space_taken += $row['filesize']; + $files_added++; + add_log('admin', 'LOG_ATTACH_FILEUPLOAD', $post_row['post_id'], $row['real_filename']); } $db->sql_freeresult($result); + + if ($files_added) + { + set_config('upload_dir_size', $config['upload_dir_size'] + $space_taken, true); + set_config('num_files', $config['num_files'] + $files_added, true); + } } } -- cgit v1.2.1