diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2004-02-08 18:02:17 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2004-02-08 18:02:17 +0000 |
| commit | d7735d2587e68bab42fde8753ee733de76369f72 (patch) | |
| tree | dcfce4a598d89b72a8469ef4f3538a0668668bee /phpBB/posting.php | |
| parent | b9bf2fe7519aa7aab5278fb882a139f3c823feb0 (diff) | |
| download | forums-d7735d2587e68bab42fde8753ee733de76369f72.tar forums-d7735d2587e68bab42fde8753ee733de76369f72.tar.gz forums-d7735d2587e68bab42fde8753ee733de76369f72.tar.bz2 forums-d7735d2587e68bab42fde8753ee733de76369f72.tar.xz forums-d7735d2587e68bab42fde8753ee733de76369f72.zip | |
inline attachment capability...
git-svn-id: file:///svn/phpbb/trunk@4819 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/posting.php')
| -rw-r--r-- | phpBB/posting.php | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php index 2c1836d051..3732615140 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -197,7 +197,6 @@ if ($sql) $db->sql_freeresult($result); } - if ($poster_id == ANONYMOUS || !$poster_id) { $username = (in_array($mode, array('quote', 'edit', 'delete'))) ? trim($post_username) : ''; @@ -561,6 +560,8 @@ if ($submit || $preview || $refresh) $refresh = true; } + // Parse Attachments - before checksum is calculated + $message_parser->parse_attachments($mode, $post_id, $submit, $preview, $refresh); // Grab md5 'checksum' of new message $message_md5 = md5($message_parser->message); @@ -572,8 +573,6 @@ if ($submit || $preview || $refresh) $message_parser->parse($enable_html, $enable_bbcode, $enable_urls, $enable_smilies, $img_status, $flash_status, $quote_status); } - $message_parser->parse_attachments($mode, $post_id, $submit, $preview, $refresh); - if ($mode != 'edit' && !$preview && !$refresh && $config['flood_interval'] && !$auth->acl_get('f_ignoreflood', $forum_id)) { // Flood check @@ -899,6 +898,19 @@ if ($enable_icons) } } +// Generate inline attachment select box +if (sizeof($message_parser->attachment_data)) +{ + $s_inline_attachment_options = ''; + foreach ($message_parser->attachment_data as $i => $attachment) + { + + $s_inline_attachment_options .= '<option value="' . $i . '">' . $attachment['real_filename'] . '</option>'; + } + + $template->assign_var('S_INLINE_ATTACHMENT_OPTIONS', $s_inline_attachment_options); +} + // Topic type selection ... only for first post in topic. $topic_type_toggle = false; if ($mode == 'post' || ($mode == 'edit' && $post_id == $topic_first_post_id)) @@ -1900,7 +1912,7 @@ function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_ WHERE post_id = ' . $data['post_id']); } - // Update Poll Tables and Attachment Entries + // Update Poll Tables if ($poll['poll_options']) { $cur_poll_options = array(); @@ -1950,7 +1962,8 @@ function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_ if (count($attach_data) && $data['post_id'] && in_array($mode, array('post', 'reply', 'quote', 'edit'))) { $space_taken = $files_added = 0; - foreach ($attach_data as $attach_row) + + foreach ($attach_data as $pos => $attach_row) { if ($attach_row['attach_id']) { |
