diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2004-09-16 18:33:22 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2004-09-16 18:33:22 +0000 |
commit | 2fa463cdeb5d8e4f2373aa834154ca27ea21c97a (patch) | |
tree | 87059418d9b487f76bf1c99ae7ec3184a62cd8ef /phpBB/posting.php | |
parent | d80f8d577ebdc1489b2dcf49bdb9a266d29d1ef1 (diff) | |
download | forums-2fa463cdeb5d8e4f2373aa834154ca27ea21c97a.tar forums-2fa463cdeb5d8e4f2373aa834154ca27ea21c97a.tar.gz forums-2fa463cdeb5d8e4f2373aa834154ca27ea21c97a.tar.bz2 forums-2fa463cdeb5d8e4f2373aa834154ca27ea21c97a.tar.xz forums-2fa463cdeb5d8e4f2373aa834154ca27ea21c97a.zip |
- more updates, mostly bugfixes to the bbcode parser
- changed current_user in sessions (please review)
- give more flexibility to style authors in regard to the pagination elements
- profile fields updates (included a sample constuct into viewtopic_body.html - have to be documented extensivly)
- code optimizations (use of strpos, sizeof, loops not iterating functions on every call, memory savings...)
- and last but not least --- hopefully not introduced more bugs than healthy (*cough*)
git-svn-id: file:///svn/phpbb/trunk@4984 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/posting.php')
-rw-r--r-- | phpBB/posting.php | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php index dfe3d099a6..c0008dfe93 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -908,7 +908,22 @@ if (!sizeof($error) && $preview) $extensions = $update_count = array(); $template->assign_var('S_HAS_ATTACHMENTS', true); - display_attachments($forum_id, 'attachment', $message_parser->attachment_data, $update_count, true); + + $attachment_data = $message_parser->attachment_data; + $unset_attachments = parse_inline_attachments($preview_message, $attachment_data, $update_count, $forum_id); + + foreach ($unset_attachments as $index) + { + unset($attachment_data[$index]); + } + + foreach ($attachment_data as $i => $attachment) + { + $template->assign_block_vars('attachment', array( + 'DISPLAY_ATTACHMENT' => $attachment) + ); + } + unset($attachment_data, $attachment); } if (!sizeof($error)) @@ -955,7 +970,6 @@ if (sizeof($poll_options) && $poll_title) $message_parser->decode_message(); $poll_options = explode("\n", $message_parser->message); } - unset($message_parser); // MAIN POSTING PAGE BEGINS HERE @@ -1153,7 +1167,7 @@ page_footer(); // // Delete Post -function delete_post($mode, $post_id, $topic_id, $forum_id, $data) +function delete_post($mode, $post_id, $topic_id, $forum_id, &$data) { global $db, $user, $config, $auth, $phpEx, $SID; @@ -1290,7 +1304,7 @@ function delete_post($mode, $post_id, $topic_id, $forum_id, $data) // Submit Post -function submit_post($mode, $subject, $username, $topic_type, $poll, $data, $update_message = true) +function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $update_message = true) { global $db, $auth, $user, $config, $phpEx, $SID, $template, $phpbb_root_path; @@ -1600,7 +1614,7 @@ function submit_post($mode, $subject, $username, $topic_type, $poll, $data, $upd $db->sql_freeresult($result); } - for ($i = 0; $i < sizeof($poll['poll_options']); $i++) + for ($i = 0, $size = sizeof($poll['poll_options']); $i < $size; $i++) { if (trim($poll['poll_options'][$i])) { |