Bitrix Site Manager

convert

string
convert(
 string strPost_message,
 array arAllow
);

The function convert formats the message text.

Parameters

ParameterDescription
strPost_message Text to be formatted.
arAllow Array of parameters of the text formatting. Has the structure similar to the array ALLOW of the CForum class variable. Contains the following parameters which can be set to Y or N:
  • HTML - allow all HTML tags in text;
  • ANCHOR - allow tag <a>;
  • BIU - allow tag <b>, <i>, <u>;
  • IMG - allow tag <img>;
  • QUOTE - allow tag <quote>;
  • CODE - allow tag <code>;
  • FONT - allow tag <font>,
  • LIST - allow tag <ul>, <li>;
  • SMILES - converts smiles as images ;
  • NL2BR - replace CR(+LF) with <br> if HTML is set to Y.

Example



<?
$parser = new textParser();  // create textParser
$arAllow = $Forum->ALLOW;    // fill the formatting array
                             // from the CForum class member array 
                             // the two arrays are identical 
$arAllow["SMILES"] = "N";    // forbid smileys as icons

// format and display a message
echo $parser->convert($strMessage, $arAllow);
?>