parse_message
class parse_message extends bbcode_firstpass
Main message parser for posting, pm, etc. takes raw message and parses it for attachments, bbcode and smilies
Properties
$bbcode_uid | from bbcode | ||
$bbcode_bitfield | from bbcode | ||
$bbcode_cache | from bbcode | ||
$bbcode_template | from bbcode | ||
$bbcodes | from bbcode | ||
$template_bitfield | from bbcode | ||
protected | $template_filename | from bbcode | |
$message | from bbcode_firstpass | ||
$warn_msg | from bbcode_firstpass | ||
$parsed_items | from bbcode_firstpass | ||
$mode | from bbcode_firstpass | ||
$attachment_data | |||
$filename_data | |||
$message_status | |||
$allow_img_bbcode | |||
$allow_quote_bbcode | |||
$allow_url_bbcode | |||
protected plupload | $plupload | The plupload object used for dealing with attachments |
Methods
Init - give message here or manually
Init bbcode cache entries if bitfield is specified
Second pass bbcodes
Return bbcode template
Making some pre-checks for bbcodes as well as increasing the number of parsed items
Parse code tag Expects the argument to start right after the opening [code] tag and to end with [/code]
Parse list bbcode Expects the argument to start with a tag
Parse Message
Formatting text for display
Decode message to be placed back into form box
Replace magic urls of form http://xxx.xxx., www.xxx. and [email protected].
Parse Smilies
Check attachment form token depending on submit type
Parse Attachments
Get Attachment Data
Parse Poll
Remove nested quotes at given depth in current parsed message
Function to perform custom bbcode validation by extensions can be used in bbcode_init() to assign regexp replacement Example: 'regexp' => array('#[b](.*?)[/b]#uise' => "\$this->validate_bbcode_by_extension('\$1')")
Details
at line 1056
__construct($message = '')
Init - give message here or manually
in
bbcode at line 51
bbcode_set_bitfield(string $bitfield = '')
Init bbcode cache entries if bitfield is specified
in
bbcode at line 63
bbcode_second_pass($message, $bbcode_uid = '', $bbcode_bitfield = false)
Second pass bbcodes
in
bbcode at line 152
bbcode_cache_init()
Init bbcode cache
requires: $this->bbcode_bitfield sets: $this->bbcode_cache with bbcode templates needed for bbcode_bitfield
in
bbcode at line 450
bbcode_tpl($tpl_name, $bbcode_id = -1, $skip_bitfield_check = false)
Return bbcode template
in
bbcode at line 515
bbcode_tpl_replace($tpl_name, $tpl)
Return bbcode template replacement
in
bbcode at line 543
bbcode_list($type)
Second parse list bbcode
in
bbcode at line 592
bbcode_second_pass_quote($username, $quote)
Second parse quote tag
in
bbcode at line 613
bbcode_second_pass_code($type, $code)
Second parse code tag
in
bbcode_firstpass at line 54
parse_bbcode()
Parse BBCode
in
bbcode_firstpass at line 107
prepare_bbcodes()
Prepare some bbcodes for better parsing
in
bbcode_firstpass at line 128
bbcode_init($allow_custom_bbcode = true)
Init bbcode data for later parsing
in
bbcode_firstpass at line 263
check_bbcode($bbcode, $in)
Making some pre-checks for bbcodes as well as increasing the number of parsed items
in
bbcode_firstpass at line 283
bbcode_specialchars($text)
Transform some characters in valid bbcodes
in
bbcode_firstpass at line 294
bbcode_size($stx, $in)
Parse size tag
in
bbcode_firstpass at line 322
bbcode_color($stx, $in)
Parse color tag
in
bbcode_firstpass at line 335
bbcode_underline($in)
Parse u tag
in
bbcode_firstpass at line 348
bbcode_strong($in)
Parse b tag
in
bbcode_firstpass at line 361
bbcode_italic($in)
Parse i tag
in
bbcode_firstpass at line 374
bbcode_img($in)
Parse img tag
in
bbcode_firstpass at line 411
bbcode_attachment($stx, $in)
Parse inline attachments [ia]
in
bbcode_firstpass at line 494
bbcode_code($stx, $in)
Parse code tag Expects the argument to start right after the opening [code] tag and to end with [/code]
in
bbcode_firstpass at line 587
bbcode_parse_list($in)
Parse list bbcode Expects the argument to start with a tag
in
bbcode_firstpass at line 715
bbcode_quote($in)
Parse quote bbcode Expects the argument to start with a tag
in
bbcode_firstpass at line 884
validate_email($var1, $var2)
Validate email
in
bbcode_firstpass at line 924
validate_url(string $var1, string $var2)
Validate url
at line 1067
parse($allow_bbcode, $allow_magic_url, $allow_smilies, $allow_img_bbcode = true, $allow_quote_bbcode = true, $allow_url_bbcode = true, $update_this_message = true, $mode = 'post')
Parse Message
at line 1241
format_display($allow_bbcode, $allow_magic_url, $allow_smilies, $update_this_message = true)
Formatting text for display
at line 1331
decode_message($custom_bbcode_uid = '', $update_this_message = true)
Decode message to be placed back into form box
at line 1358
magic_url($server_url)
Replace magic urls of form http://xxx.xxx., www.xxx. and [email protected].
Cuts down displayed size of link if over 50 chars, turns absolute links into relative versions when the server/script path matches the link
at line 1367
smilies($max_smilies = 0)
Parse Smilies
at line 1446
bool
check_attachment_form_token(language $language, request_interface $request, string $form_name)
Check attachment form token depending on submit type
at line 1469
parse_attachments($form_name, $mode, $forum_id, $submit, $preview, $refresh, $is_message = false)
Parse Attachments
at line 1761
get_submitted_attachment_data($check_user_id = false)
Get Attachment Data
at line 1849
parse_poll($poll)
Parse Poll
at line 1912
void
remove_nested_quotes(int $max_depth)
Remove nested quotes at given depth in current parsed message
at line 1970
null
set_plupload(plupload $plupload)
Setter function for passing the plupload object
at line 1984
mixed
validate_bbcode_by_extension()
Function to perform custom bbcode validation by extensions can be used in bbcode_init() to assign regexp replacement Example: 'regexp' => array('#[b](.*?)[/b]#uise' => "\$this->validate_bbcode_by_extension('\$1')")
Accepts variable number of parameters