comcode_text_to_tempcode (line 134)
Convert the specified comcode (text format) into a tempcode tree. You shouldn't output the tempcode tree to the browser, as it looks really horrible. If you are in a rare case where you need to output directly (not through templates), you should call the evaluate method on the tempcode object, to convert it into a string.
tempcode
comcode_text_to_tempcode
(LONG_TEXT $comcode, MEMBER $source_member, boolean $as_admin, ?integer $wrap_pos, ?string $pass_id, object The $connection, boolean $semiparse_mode, boolean $preparse_mode, boolean $is_all_semihtml, boolean $structure_sweep, boolean $check_only, [?array $highlight_bits = NULL], [?MEMBER $on_behalf_of_member = NULL])
-
LONG_TEXT
$comcode: The comcode to convert
-
MEMBER
$source_member: The member the evaluation is running as. This is a security issue, and you should only run as an administrator if you have considered where the comcode came from carefully
-
boolean
$as_admin: Whether to explicitly execute this with admin rights. There are a few rare situations where this should be done, for data you know didn't come from a member, but is being evaluated by one.
-
?integer
$wrap_pos: The position to conduct wordwrapping at (NULL: do not conduct word-wrapping)
-
?string
$pass_id: A special identifier that can identify this resource in a sea of our resources of this class; usually this can be ignored, but may be used to provide a binding between Javascript in evaluated comcode, and the surrounding environment (NULL: no explicit binding)
-
object The
$connection: database connection to use
-
boolean
$semiparse_mode: Whether to parse so as to create something that would fit inside a semihtml tag. It means we generate HTML, with Comcode written into it where the tag could never be reverse-converted (e.g. a block).
-
boolean
$preparse_mode: Whether this is being pre-parsed, to pick up errors before row insertion.
-
boolean
$is_all_semihtml: Whether to treat this whole thing as being wrapped in semihtml, but apply normal security otherwise.
-
boolean
$structure_sweep: Whether we are only doing this parse to find the title structure
-
boolean
$check_only: Whether to only check the Comcode. It's best to use the check_comcode function which will in turn use this parameter.
-
?array
$highlight_bits: A list of words to highlight (NULL: none)
-
?MEMBER
$on_behalf_of_member: The member we are running on behalf of, with respect to how attachments are handled; we may use this members attachments that are already within this post, and our new attachments will be handed to this member (NULL: member evaluating)
detect_link (line 1625)
Detect a link in some text.
array
detect_link
(string &$comcode, integer $pos)
-
string
&$comcode: The text
-
integer
$pos: Search position
filter_html (line 1723)
Filter HTML for safety.
void
filter_html
(boolean $as_admin, MEMBER $source_member, integer $pos, integer &$len, LONG_TEXT &$comcode, boolean $in_html, boolean $in_semihtml)
-
boolean
$as_admin: Whether to explicitly execute this with admin rights. There are a few rare situations where this should be done, for data you know didn't come from a member, but is being evaluated by one.
-
MEMBER
$source_member: The member the evaluation is running as. This is a security issue, and you should only run as an administrator if you have considered where the comcode came from carefully
-
integer
$pos: The offset of the tag in the Comcode
-
integer
&$len: The length of the Comcode
-
LONG_TEXT
&$comcode: The Comcode being parsed
-
boolean
$in_html: Whether the parser is/was in an HTML region
-
boolean
$in_semihtml: Whether the parser is/was in a Semi-HTML region
init__comcode_text (line 24)
Standard code module initialisation function.
void
init__comcode_text
()
in_tag_stack (line 1606)
Find if any of some tags are in the stack.
boolean
in_tag_stack
(array $tag_stack, array $tags)
-
array
$tag_stack: The tag stack
-
array
$tags: The tags
_close_open_lists (line 1828)
Get HTML to close any open lists.
array
_close_open_lists
(integer $list_indent, string $list_type)
-
integer
$list_indent: The depth level of lists that we need to close
-
string
$list_type: List-type code
_opened_tag (line 1666)
Helper function for setting up and juggling variables after reaching a new Comcode tag.
array
_opened_tag
(boolean $as_admin, MEMBER $source_member, array $attribute_map, string $current_tag, integer $pos, boolean $in_separate_parse_section, boolean $in_html, boolean $in_semihtml, boolean $close, integer &$len, LONG_TEXT &$comcode)
-
boolean
$as_admin: Whether to explicitly execute this with admin rights. There are a few rare situations where this should be done, for data you know didn't come from a member, but is being evaluated by one.
-
MEMBER
$source_member: The member the evaluation is running as. This is a security issue, and you should only run as an administrator if you have considered where the comcode came from carefully
-
array
$attribute_map: The attribute map of the tag
-
string
$current_tag: The identifier for the tag
-
integer
$pos: The offset of the tag in the Comcode
-
boolean
$in_separate_parse_section: Whether the parser is/was in a separate parse section (e.g. a 'code' tag)
-
boolean
$in_html: Whether the parser is/was in an HTML region
-
boolean
$in_semihtml: Whether the parser is/was in a Semi-HTML region
-
boolean
$close: Whether the tag is a closing tag
-
integer
&$len: The length of the Comcode
-
LONG_TEXT
&$comcode: The Comcode being parsed