1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-01 14:30:32 +02:00

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
This commit is contained in:
Ludovic Arnaud
2003-04-11 00:19:29 +00:00
parent f17c36cea4
commit 4f55c9fb81
5 changed files with 479 additions and 570 deletions

View File

@@ -125,7 +125,7 @@ function generate_topic_icons($mode, $enable_icons)
}
// DECODE TEXT -> This will/should be handled by bbcode.php eventually
function decode_text(&$message)
function decode_text(&$message, $bbcode_uid)
{
global $config, $censors;
@@ -158,6 +158,7 @@ function decode_text(&$message)
obtain_word_list($censors);
}
$message = str_replace(":$bbcode_uid", '', $message);
$message = preg_replace($match, $replace, $message);
return;
@@ -548,7 +549,7 @@ function user_notification($mode, $subject, $forum_id, $topic_id, $post_id)
// Format text to be displayed - from viewtopic.php - centralizing this would be nice ;)
function format_display($message, $html, $bbcode, $uid, $url, $smilies, $sig)
{
global $auth, $forum_id, $config, $censors, $user;
global $auth, $forum_id, $config, $censors, $user, $bbcode;
// If the board has HTML off but the post has HTML
// on then we process it, else leave it alone
@@ -558,6 +559,7 @@ function format_display($message, $html, $bbcode, $uid, $url, $smilies, $sig)
}
// Second parse bbcode here
$message = $bbcode->bbcode_second_pass($message);
// If we allow users to disable display of emoticons
// we'll need an appropriate check and preg_replace here
@@ -773,6 +775,7 @@ function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_
'enable_smilies' => $post_data['enable_smilies'],
'enable_magic_url' => $post_data['enable_urls'],
'bbcode_uid' => $bbcode_uid,
'bbcode_bitfield' => $post_data['bbcode_bitfield']
);
if ($mode != 'edit' || $post_data['message_md5'] != $post_data['post_checksum'])