Documentation

Convert

string
CSocNetTextParser::convert(
 string text,
 bool bPreview = true,
 array arImages = array(),
 array allow = array(),
 string type = html
);

The method formats a message. Non-static method.

Parameters

Parameter Description Available from version
text Original message.
bPreview Optional parameter. True by default.
arImages Array of message images.
allow Array of parameters for message formatting with values Y or N:
  • HTML - text can contain any HTML tags,
  • ANCHOR - permitted tag <a>,
  • BIU - permitted tags <b>, <i>, <u>,
  • IMG - permitted tags <img>,
  • QUOTE - permitted quoting tag <quote>,
  • CODE - permitted code showing tag <code>,
  • FONT - permitted tag <font>,
  • LIST - permitted tags <ul>, <li>,
  • SMILES - show smileys as images,
  • NL2BR - replace line feed with tag <br> if any HTML tags are permitted,
  • VIDEO - video embedding permitted,
type Message type. Optional parameter. HTML by default.

Returned value

Returns message formatted string.

Examples

<?
$parser = new CSocNetTextParser(LANGUAGE_ID, "/bitrix/images/socialnetwork/smile/");
$parser->MaxStringLen = 20;
$message = $parser->convert($draftMessage);
?>


© «Bitrix24», 2001-2024