diff options
author | Ludovic Arnaud <ludovic_arnaud@users.sourceforge.net> | 2003-04-11 00:19:29 +0000 |
---|---|---|
committer | Ludovic Arnaud <ludovic_arnaud@users.sourceforge.net> | 2003-04-11 00:19:29 +0000 |
commit | 4f55c9fb81287f7790a471ff5bf318cb8189d59f (patch) | |
tree | c0e2d5e2e1f575f1dedfa925bd9d760eda6c8c78 /phpBB/posting.php | |
parent | f17c36cea455ac858511a9a191572a457c4a33f8 (diff) | |
download | forums-4f55c9fb81287f7790a471ff5bf318cb8189d59f.tar forums-4f55c9fb81287f7790a471ff5bf318cb8189d59f.tar.gz forums-4f55c9fb81287f7790a471ff5bf318cb8189d59f.tar.bz2 forums-4f55c9fb81287f7790a471ff5bf318cb8189d59f.tar.xz forums-4f55c9fb81287f7790a471ff5bf318cb8189d59f.zip |
BBCode parser + decoder, missing some tags and mildly broken at this time
git-svn-id: file:///svn/phpbb/trunk@3812 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/posting.php')
-rw-r--r-- | phpBB/posting.php | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php index df9bd66025..030709de74 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -181,6 +181,8 @@ if ($sql != '') $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); + $message_parser->bbcode_uid = $row['bbcode_uid']; + $forum_id = intval($row['forum_id']); $topic_id = intval($row['topic_id']); $post_id = intval($row['post_id']); @@ -483,6 +485,9 @@ if (($submit) || ($preview) || ($refresh)) // Check checksum ... don't re-parse message if the same if ($mode != 'edit' || $message_md5 != $post_checksum) { + // DEBUG + $bbcode_uid = $message_parser->bbcode_uid; + // Parse message if (($result = $message_parser->parse($message, $enable_html, $enable_bbcode, $bbcode_uid, $enable_urls, $enable_smilies)) != '') { @@ -596,7 +601,8 @@ if (($submit) || ($preview) || ($refresh)) 'post_checksum' => $post_checksum, 'forum_parents' => $forum_parents, 'notify' => $notify, - 'notify_set' => $notify_set + 'notify_set' => $notify_set, + 'bbcode_bitfield' => $message_parser->bbcode_bitfield ); submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_uid, $poll, $attachment_data, $post_data); @@ -620,6 +626,13 @@ if ($preview) } $post_time = $current_time; + + // DEBUG + $bbcode_bitfield = bindec('1111111111'); + + include($phpbb_root_path . 'includes/bbcode.' . $phpEx); + $bbcode = new bbcode($bbcode_uid, $bbcode_bitfield); + $preview_message = format_display(stripslashes($message), $enable_html, $enable_bbcode, $bbcode_uid, $enable_urls, $enable_smilies, $enable_sig); $preview_subject = (sizeof($censors)) ? preg_replace($censors['match'], $censors['replace'], $subject) : $subject; @@ -627,7 +640,7 @@ if ($preview) // Poll Preview if ( ( ($mode == 'post') || ( ($mode == 'edit') && ($post_id == $topic_first_post_id) && (empty($poll_last_vote)) )) && ( ($auth->acl_get('f_poll', $forum_id)) || ($auth->acl_get('m_edit', $forum_id)) )) { - decode_text($poll_title); + decode_text($poll_title, $bbcode_uid); $preview_poll_title = format_display(stripslashes($poll_title), $enable_html, $enable_bbcode, $bbcode_uid, $enable_urls, $enable_smilies, false, false); $template->assign_vars(array( @@ -645,8 +658,8 @@ if ($preview) } // Decode text for message display -decode_text($post_text); -decode_text($subject); +decode_text($post_text, $bbcode_uid); +decode_text($subject, $bbcode_uid); // Save us some processing time. ;) $poll_options_tmp = implode("\n", $poll_options); |