diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2003-09-24 19:41:14 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2003-09-24 19:41:14 +0000 |
commit | 8675e30366dbe0e9baf35a3398019da500198549 (patch) | |
tree | ace084d93e82cbafdcc2f1ac45f6961a79f46e22 /phpBB/includes/message_parser.php | |
parent | f614337627ac7b6553cf3c6cdb50a3d9d9fe33a3 (diff) | |
download | forums-8675e30366dbe0e9baf35a3398019da500198549.tar forums-8675e30366dbe0e9baf35a3398019da500198549.tar.gz forums-8675e30366dbe0e9baf35a3398019da500198549.tar.bz2 forums-8675e30366dbe0e9baf35a3398019da500198549.tar.xz forums-8675e30366dbe0e9baf35a3398019da500198549.zip |
some small fixes
got rid of iframe (topic review)... tested new div method with various browsers, further testing and oppinions would be nice. ;)
NOTE: New css element added to theme
git-svn-id: file:///svn/phpbb/trunk@4510 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/message_parser.php')
-rw-r--r-- | phpBB/includes/message_parser.php | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 6c4113e5b2..dad0f5d723 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -639,14 +639,16 @@ class parse_message FROM ' . SMILIES_TABLE; $result = $db->sql_query($sql); + // TEMP - maybe easier regular expression processing... at the moment two newlines prevents smilie substitution. + $this->message = str_replace("\n", "\\n", $this->message); + if ($row = $db->sql_fetchrow($result)) { $match = $replace = array(); do { -// $match[] = '#(' . preg_quote($row['code'], '#') . ')#'; - $match[] = "#(?<=.\W|\W.|^\W)" . preg_quote($row['code'], '#') . "(?=.\W|\W.|\W$)#"; + $match[] = "#(?<=.\W|\W.|\W)" . preg_quote($row['code'], '#') . "(?=.\W|\W.|\W$)#"; $replace[] = '<!-- s' . $row['code'] . ' --><img src="{SMILE_PATH}/' . $row['smile_url'] . '" border="0" alt="' . $row['emoticon'] . '" title="' . $row['emoticon'] . '" /><!-- s' . $row['code'] . ' -->'; } while ($row = $db->sql_fetchrow($result)); @@ -657,12 +659,14 @@ class parse_message if ($num_matches !== FALSE && $num_matches > intval($config['max_post_smilies'])) { + $this->message = str_replace("\\n", "\n", $this->message); $this->warn_msg[] = $user->lang['TOO_MANY_SMILIES']; return; } } $this->message = trim(preg_replace($match, $replace, ' ' . $this->message . ' ')); + $this->message = str_replace("\\n", "\n", $this->message); } } @@ -727,27 +731,33 @@ class parse_message // Perform actions on temporary attachments if ($delete_file) { - foreach ($_POST['delete_file'] as $index => $value) + $index = (int) key($_POST['delete_file']); + + // delete selected attachment + if ($this->attachment_data[$index]['attach_id'] == '-1') { - // delete selected attachment - if ($this->attachment_data[$index]['attach_id'] == '-1') - { - phpbb_unlink($this->attachment_data[$index]['physical_filename'], 'file'); + phpbb_unlink($this->attachment_data[$index]['physical_filename'], 'file'); - if ($this->attachment_data[$index]['thumbnail']) - { - phpbb_unlink('t_' . $this->attachment_data[$index]['physical_filename'], 'thumbnail'); - } - } - else + if ($this->attachment_data[$index]['thumbnail']) { - delete_attachments($post_id, intval($this->attachment_data[$index]['attach_id'])); + phpbb_unlink('t_' . $this->attachment_data[$index]['physical_filename'], 'thumbnail'); } - unset($this->attachment_data[$index]); + } + else + { + delete_attachments($post_id, intval($this->attachment_data[$index]['attach_id'])); } - // a quick way to reindex the array. :) - $this->attachment_data = array_merge($this->attachment_data); + unset($this->attachment_data[$index]); + + // Reindex Array + $attachment_data = $this->attachment_data; + unset($this->attachment_data); + foreach ($attachment_data as $element) + { + $this->attachment_data[] = $element; + } + unset($attachment_data); } else if ($edit_comment || $add_file || $preview) { |