From 8675e30366dbe0e9baf35a3398019da500198549 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 24 Sep 2003 19:41:14 +0000 Subject: 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 --- phpBB/includes/functions_posting.php | 2 +- phpBB/includes/message_parser.php | 44 ++++++++++++++++++++++-------------- 2 files changed, 28 insertions(+), 18 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 065d3021f1..0358672e5c 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -66,7 +66,7 @@ function generate_smilies($mode) { $template->assign_vars(array( 'S_SHOW_EMOTICON_LINK' => TRUE, - 'U_MORE_SMILIES' => "posting.$phpEx$SID&mode=smilies") + 'U_MORE_SMILIES' => $phpbb_root_path . "posting.$phpEx$SID&mode=smilies") ); } } 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[] = '' . $row['emoticon'] . ''; } 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) { -- cgit v1.2.1