diff options
author | Nathan Guse <nathaniel.guse@gmail.com> | 2014-01-17 19:28:31 -0800 |
---|---|---|
committer | Nathan Guse <nathaniel.guse@gmail.com> | 2014-01-17 19:28:31 -0800 |
commit | ab41396707e722ae817d9e5e5f2299d0d681d620 (patch) | |
tree | 3f550cd6fb8cca4bfbb05806cb0b7cf49744381d /phpBB/includes/message_parser.php | |
parent | efd56bc981c7f9bd51b828259c7b0a2b00972d62 (diff) | |
parent | ebc2d1dd1bd2a102ee8c8f1b134068e7a1f75c00 (diff) | |
download | forums-ab41396707e722ae817d9e5e5f2299d0d681d620.tar forums-ab41396707e722ae817d9e5e5f2299d0d681d620.tar.gz forums-ab41396707e722ae817d9e5e5f2299d0d681d620.tar.bz2 forums-ab41396707e722ae817d9e5e5f2299d0d681d620.tar.xz forums-ab41396707e722ae817d9e5e5f2299d0d681d620.zip |
Merge pull request #1866 from prototech/ticket/11915
[ticket/11915] Improve Plupload integration
Diffstat (limited to 'phpBB/includes/message_parser.php')
-rw-r--r-- | phpBB/includes/message_parser.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index b29f587385..ad6743b3a3 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -1461,6 +1461,7 @@ class parse_message extends bbcode_firstpass 'is_orphan' => 1, 'real_filename' => $filedata['real_filename'], 'attach_comment'=> $this->filename_data['filecomment'], + 'filesize' => $filedata['filesize'], ); $this->attachment_data = array_merge(array(0 => $new_entry), $this->attachment_data); @@ -1572,6 +1573,7 @@ class parse_message extends bbcode_firstpass 'is_orphan' => 1, 'real_filename' => $filedata['real_filename'], 'attach_comment'=> $this->filename_data['filecomment'], + 'filesize' => $filedata['filesize'], ); $this->attachment_data = array_merge(array(0 => $new_entry), $this->attachment_data); @@ -1580,8 +1582,10 @@ class parse_message extends bbcode_firstpass if (isset($this->plupload) && $this->plupload->is_active()) { + $download_url = append_sid("{$phpbb_root_path}download/file.{$phpEx}", 'mode=view&id=' . $new_entry['attach_id']); + // Send the client the attachment data to maintain state - $json_response->send($this->attachment_data); + $json_response->send(array('data' => $this->attachment_data, 'download_url' => $download_url)); } } } @@ -1649,7 +1653,7 @@ class parse_message extends bbcode_firstpass if (sizeof($not_orphan)) { // Get the attachment data, based on the poster id... - $sql = 'SELECT attach_id, is_orphan, real_filename, attach_comment + $sql = 'SELECT attach_id, is_orphan, real_filename, attach_comment, filesize FROM ' . ATTACHMENTS_TABLE . ' WHERE ' . $db->sql_in_set('attach_id', array_keys($not_orphan)) . ' AND poster_id = ' . $check_user_id; @@ -1674,7 +1678,7 @@ class parse_message extends bbcode_firstpass // Regenerate newly uploaded attachments if (sizeof($orphan)) { - $sql = 'SELECT attach_id, is_orphan, real_filename, attach_comment + $sql = 'SELECT attach_id, is_orphan, real_filename, attach_comment, filesize FROM ' . ATTACHMENTS_TABLE . ' WHERE ' . $db->sql_in_set('attach_id', array_keys($orphan)) . ' AND poster_id = ' . $user->data['user_id'] . ' |