/** * Returns the formatted message. * * @return string */ public function getFormattedMessage() { require_once WCF_DIR . 'lib/data/message/bbcode/MessageParser.class.php'; MessageParser::getInstance()->setOutputType('text/html'); require_once WCF_DIR . 'lib/data/message/bbcode/AttachmentBBCode.class.php'; AttachmentBBCode::setMessageID($this->contestID); return MessageParser::getInstance()->parse($this->message, $this->enableSmilies, $this->enableHtml, $this->enableBBCodes, !$this->messagePreview); }
/** * Returns an excerpt of this private message. * * @return string */ public function getMessagePreview() { AttachmentBBCode::setMessageID($this->pmID); $parser = MessageParser::getInstance(); $parser->setOutputType('text/plain'); $message = $parser->parse($this->message, $this->enableSmilies, $this->enableHtml, $this->enableBBCodes, false); if (StringUtil::length($message) > 500) { $message = StringUtil::substring($message, 0, 497) . '...'; } return $message; }
/** * Returns the text of this post. * * @return string the text of this post */ public function getFormattedMessage() { // return message cache if ($this->messageCache) { return KeywordHighlighter::doHighlight($this->messageCache); } // parse message $parser = MessageParser::getInstance(); $parser->setOutputType('text/html'); AttachmentBBCode::setMessageID($this->postID); return $parser->parse($this->message, $this->enableSmilies, $this->enableHtml, $this->enableBBCodes, !$this->messagePreview); }