protected function _insertIntoIndex(XenForo_Search_Indexer $indexer, array $data, array $parentData = null) { $message = $data['message']; $message = trim(XenForo_Helper_String::stripQuotes($message, 0)); $tagTexts = Tinhte_XenTag_Integration::parseHashtags($message); if (!empty($tagTexts)) { $extraMetadata = array(); $extraMetadata[Tinhte_XenTag_Constants::SEARCH_METADATA_TAGS] = Tinhte_XenTag_Helper::getSafeTagsTextArrayForSearch($tagTexts); $indexer = new Tinhte_XenTag_XenForo_Search_Indexer($indexer, $extraMetadata); } $result = parent::_insertIntoIndex($indexer, $data, $parentData); }
/** * Gets the quote text for the specified conversation message. * * @param array $message * @param integer $maxQuoteDepth Max depth of quotes (-1 for unlimited) * * @return string */ public function getQuoteForConversationMessage(array $message, $maxQuoteDepth = 0) { return '[quote="' . $message['username'] . '"]' . trim(XenForo_Helper_String::stripQuotes($message['message'], $maxQuoteDepth)) . "[/quote]\n"; }
/** * Gets the quote text for the specified post. * * @param array $post * @param integer $maxQuoteDepth Max depth of quoted text (-1 for unlimited) * * @return string */ public function getQuoteTextForPost(array $post, $maxQuoteDepth = 0) { if ($post['message_state'] != 'visible') { // non-visible posts shouldn't be quoted return ''; } /* * Note that if this syntax changes, changes must be applied to * XenForo_DataWriter_DiscussionMessage::_alertQuoted() * and to * XenForo_BbCode_Formatter_Base::renderTagQuote() */ return '[quote="' . $post['username'] . ', post: ' . $post['post_id'] . '"]' . trim(XenForo_Helper_String::stripQuotes($post['message'], $maxQuoteDepth)) . "[/quote]\n"; }
/** * Converts some HTML into quotable BB code * * @param array $post * @param string $messageHtml * @param integer $maxQuoteDepth Max depth of quoted text (-1 for unlimited) * * @return string */ public function getQuoteTextForPostFromHtml(array $post, $messageHtml, $maxQuoteDepth = 0) { $message = $this->getModelFromCache('XenForo_Model_BbCode')->getBbCodeFromSelectionHtml($messageHtml); $message = trim(XenForo_Helper_String::stripQuotes($message, $maxQuoteDepth)); return $this->_getQuoteWrapperBbCode($post, $message); }