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 | ||
$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_flash_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
Function to perform custom bbcode second pass by extensions can be used to assign bbcode pattern replacement Example: '#[list=([^[]+):$uid]#e' => "\$this->bbcode_second_pass_by_extension('\$1')"
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 1115
__construct($message = '')
Init - give message here or manually
in
bbcode at line 49
bbcode_set_bitfield(string $bitfield = '')
Init bbcode cache entries if bitfield is specified
in
bbcode at line 61
bbcode_second_pass($message, $bbcode_uid = '', $bbcode_bitfield = false)
Second pass bbcodes
in
bbcode at line 150
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 468
bbcode_tpl($tpl_name, $bbcode_id = -1, $skip_bitfield_check = false)
Return bbcode template
in
bbcode at line 533
bbcode_tpl_replace($tpl_name, $tpl)
Return bbcode template replacement
in
bbcode at line 562
bbcode_list($type)
Second parse list bbcode
in
bbcode at line 611
bbcode_second_pass_quote($username, $quote)
Second parse quote tag
in
bbcode at line 632
bbcode_second_pass_code($type, $code)
Second parse code tag
in
bbcode at line 685
mixed
bbcode_second_pass_by_extension()
deprecated
deprecated
Function to perform custom bbcode second pass by extensions can be used to assign bbcode pattern replacement Example: '#[list=([^[]+):$uid]#e' => "\$this->bbcode_second_pass_by_extension('\$1')"
Accepts variable number of parameters
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 268
check_bbcode($bbcode, $in)
Making some pre-checks for bbcodes as well as increasing the number of parsed items
in
bbcode_firstpass at line 288
bbcode_specialchars($text)
Transform some characters in valid bbcodes
in
bbcode_firstpass at line 299
bbcode_size($stx, $in)
Parse size tag
in
bbcode_firstpass at line 327
bbcode_color($stx, $in)
Parse color tag
in
bbcode_firstpass at line 340
bbcode_underline($in)
Parse u tag
in
bbcode_firstpass at line 353
bbcode_strong($in)
Parse b tag
in
bbcode_firstpass at line 366
bbcode_italic($in)
Parse i tag
in
bbcode_firstpass at line 379
bbcode_img($in)
Parse img tag
in
bbcode_firstpass at line 416
bbcode_flash($width, $height, $in)
Parse flash tag
in
bbcode_firstpass at line 470
bbcode_attachment($stx, $in)
Parse inline attachments [ia]
in
bbcode_firstpass at line 553
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 646
bbcode_parse_list($in)
Parse list bbcode Expects the argument to start with a tag
in
bbcode_firstpass at line 774
bbcode_quote($in)
Parse quote bbcode Expects the argument to start with a tag
in
bbcode_firstpass at line 943
validate_email($var1, $var2)
Validate email
in
bbcode_firstpass at line 983
validate_url(string $var1, string $var2)
Validate url
at line 1125
parse($allow_bbcode, $allow_magic_url, $allow_smilies, $allow_img_bbcode = true, $allow_flash_bbcode = true, $allow_quote_bbcode = true, $allow_url_bbcode = true, $update_this_message = true, $mode = 'post')
Parse Message
at line 1304
format_display($allow_bbcode, $allow_magic_url, $allow_smilies, $update_this_message = true)
Formatting text for display
at line 1394
decode_message($custom_bbcode_uid = '', $update_this_message = true)
Decode message to be placed back into form box
at line 1421
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 1430
smilies($max_smilies = 0)
Parse Smilies
at line 1509
bool
check_attachment_form_token(language $language, request_interface $request, string $form_name)
Check attachment form token depending on submit type
at line 1532
parse_attachments($form_name, $mode, $forum_id, $submit, $preview, $refresh, $is_message = false)
Parse Attachments
at line 1816
get_submitted_attachment_data($check_user_id = false)
Get Attachment Data
at line 1904
parse_poll($poll)
Parse Poll
at line 1967
null
remove_nested_quotes(int $max_depth)
Remove nested quotes at given depth in current parsed message
at line 2025
null
set_plupload(plupload $plupload)
Setter function for passing the plupload object
at line 2039
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