parse_message() public method

Init - give message here or manually
public parse_message ( $message = '' )
Beispiel #1
0
 /**
  * Parse BBCode in a message
  *
  * @param string $message Message to parse
  * @return string Parsed message
  */
 public function parse_message($message)
 {
     if (empty($this->bbcode_data)) {
         return '';
     }
     if (!is_object($this->message_parser)) {
         if (!class_exists('\\bbcode')) {
             require $this->phpbb_root_path . 'includes/bbcode.' . $this->php_ext;
         }
         if (!class_exists('\\parse_message')) {
             require $this->phpbb_root_path . 'includes/message_parser.' . $this->php_ext;
         }
         $this->message_parser = new \parse_message();
     }
     $this->message_parser->parse_message($message);
     $this->bbcode_data['regexp'] = array($this->bbcode_data['first_pass_match'] => str_replace('$uid', $this->message_parser->bbcode_uid, $this->bbcode_data['first_pass_replace']));
     $this->message_parser->bbcodes = array($this->bbcode_data['bbcode_tag'] => $this->bbcode_data);
     $this->message_parser->parse_bbcode();
     return $this->message_parser->message;
 }