• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP XenForo_Helper_String类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中XenForo_Helper_String的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_Helper_String类的具体用法?PHP XenForo_Helper_String怎么用?PHP XenForo_Helper_String使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了XenForo_Helper_String类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _sendEmail

 protected function _sendEmail(array $email, array $user, Zend_Mail_Transport_Abstract $transport)
 {
     if (!$user['email']) {
         return;
     }
     $phraseTitles = XenForo_Helper_String::findPhraseNamesFromStringSimple($email['email_title'] . $email['email_body']);
     /** @var XenForo_Model_Phrase $phraseModel */
     $phraseModel = XenForo_Model::create('XenForo_Model_Phrase');
     $phrases = $phraseModel->getPhraseTextFromPhraseTitles($phraseTitles, $user['language_id']);
     foreach ($phraseTitles as $search => $phraseTitle) {
         if (isset($phrases[$phraseTitle])) {
             $email['email_title'] = str_replace($search, $phrases[$phraseTitle], $email['email_title']);
             $email['email_body'] = str_replace($search, $phrases[$phraseTitle], $email['email_body']);
         }
     }
     $mailObj = new Zend_Mail('utf-8');
     $mailObj->setSubject($email['email_title'])->addTo($user['email'], $user['username'])->setFrom($email['from_email'], $email['from_name']);
     $options = XenForo_Application::getOptions();
     $bounceEmailAddress = $options->bounceEmailAddress;
     if (!$bounceEmailAddress) {
         $bounceEmailAddress = $options->defaultEmailAddress;
     }
     $toEmail = $user['email'];
     $bounceHmac = substr(hash_hmac('md5', $toEmail, XenForo_Application::getConfig()->globalSalt), 0, 8);
     $mailObj->addHeader('X-To-Validate', "{$bounceHmac}+{$toEmail}");
     if ($options->enableVerp) {
         $verpValue = str_replace('@', '=', $toEmail);
         $bounceEmailAddress = str_replace('@', "+{$bounceHmac}+{$verpValue}@", $bounceEmailAddress);
     }
     $mailObj->setReturnPath($bounceEmailAddress);
     if ($email['email_format'] == 'html') {
         $replacements = array('{name}' => htmlspecialchars($user['username']), '{email}' => htmlspecialchars($user['email']), '{id}' => $user['user_id']);
         $email['email_body'] = strtr($email['email_body'], $replacements);
         $text = trim(htmlspecialchars_decode(strip_tags($email['email_body'])));
         $mailObj->setBodyHtml($email['email_body'])->setBodyText($text);
     } else {
         $replacements = array('{name}' => $user['username'], '{email}' => $user['email'], '{id}' => $user['user_id']);
         $email['email_body'] = strtr($email['email_body'], $replacements);
         $mailObj->setBodyText($email['email_body']);
     }
     if (!$mailObj->getMessageId()) {
         $mailObj->setMessageId();
     }
     $thisTransport = XenForo_Mail::getFinalTransportForMail($mailObj, $transport);
     try {
         $mailObj->send($thisTransport);
     } catch (Exception $e) {
         if (method_exists($thisTransport, 'resetConnection')) {
             XenForo_Error::logException($e, false, "Email to {$user['email']} failed: ");
             $thisTransport->resetConnection();
             try {
                 $mailObj->send($thisTransport);
             } catch (Exception $e) {
                 XenForo_Error::logException($e, false, "Email to {$user['email']} failed (after retry): ");
             }
         } else {
             XenForo_Error::logException($e, false, "Email to {$user['email']} failed: ");
         }
     }
 }
开发者ID:darkearl,项目名称:projectT122015,代码行数:60,代码来源:UserEmail.php


示例2: _Tinhte_XenTag_prepareRssEntry

 protected function _Tinhte_XenTag_prepareRssEntry($result, Zend_Feed_Writer_Feed $feed)
 {
     $entry = false;
     if ($result[XenForo_Model_Search::CONTENT_TYPE] == 'thread') {
         $thread = $result['content'];
         $entry = $feed->createEntry();
         $entry->setTitle($thread['title']);
         $entry->setLink(XenForo_Link::buildPublicLink('canonical:threads', $thread));
         $entry->setDateCreated(new Zend_Date($thread['post_date'], Zend_Date::TIMESTAMP));
         $entry->setDateModified(new Zend_Date($thread['last_post_date'], Zend_Date::TIMESTAMP));
         $discussionRssContentLength = XenForo_Application::getOptions()->get('discussionRssContentLength');
         if (!empty($thread['message']) && $discussionRssContentLength > 0) {
             $bbCodeParser = $this->_Tinhte_XenTag_getBbCodeParser('Base');
             $bbCodeSnippetParser = $this->_Tinhte_XenTag_getBbCodeParser('XenForo_BbCode_Formatter_BbCode_Clean');
             $rendererStates = array('disableProxying' => true);
             $wordTrimmed = XenForo_Helper_String::wholeWordTrim($thread['message'], $discussionRssContentLength);
             $snippet = $bbCodeSnippetParser->render($wordTrimmed, $rendererStates);
             if ($snippet != $thread['message']) {
                 $snippet .= "\n\n[url='" . XenForo_Link::buildPublicLink('canonical:threads', $thread) . "']" . $thread['title'] . '[/url]';
             }
             $content = trim($bbCodeParser->render($snippet, $rendererStates));
             if (strlen($content)) {
                 $entry->setContent($content);
             }
         }
         if (!$this->_Tinhte_XenTag_isBuggyXmlNamespace()) {
             $entry->addAuthor(array('name' => $thread['username'], 'uri' => XenForo_Link::buildPublicLink('canonical:members', $thread)));
             if ($thread['reply_count']) {
                 $entry->setCommentCount($thread['reply_count']);
             }
         }
     }
     return $entry;
 }
开发者ID:maitandat1507,项目名称:Tinhte_XenTag,代码行数:34,代码来源:View.php


示例3: filterString

 /**
  * Default, empty string filterer.
  *
  * @see XenForo_BbCode_Formatter_Base::filterString()
  */
 public function filterString($string, array $rendererStates)
 {
     if ($this->_censorString) {
         $string = XenForo_Helper_String::censorString($string);
     }
     return $string;
 }
开发者ID:namgiangle90,项目名称:tokyobaito,代码行数:12,代码来源:Abstract.php


示例4: _log

 /**
  * @param array $logUser
  * @param array $content
  * @param $action
  * @param array $actionParams
  * @param null $parentContent
  * @return mixed
  */
 protected function _log(array $logUser, array $content, $action, array $actionParams = array(), $parentContent = null)
 {
     $dw = XenForo_DataWriter::create('XenForo_DataWriter_ModeratorLog');
     $dw->bulkSet(array('user_id' => $logUser['user_id'], 'content_type' => sonnb_XenGallery_Model_Photo::$xfContentType, 'content_id' => $content['content_id'], 'content_user_id' => $content['user_id'], 'content_username' => $content['username'], 'content_title' => XenForo_Helper_String::wordWrapString($content['title'], 140), 'content_url' => XenForo_Link::buildPublicLink('gallery/photos', $content), 'discussion_content_type' => sonnb_XenGallery_Model_Photo::$xfContentType, 'discussion_content_id' => $content['content_id'], 'action' => $action, 'action_params' => $actionParams));
     $dw->save();
     return $dw->get('moderator_log_id');
 }
开发者ID:Sywooch,项目名称:forums,代码行数:15,代码来源:Photo.php


示例5: actionPostIndex

 public function actionPostIndex()
 {
     if (!$this->_getConversationModel()->canStartConversations($errorPhraseKey)) {
         throw $this->getErrorOrNoPermissionResponseException($errorPhraseKey);
     }
     $input = $this->_input->filter(array('recipients' => XenForo_Input::STRING, 'conversation_title' => XenForo_Input::STRING));
     /* @var $editorHelper XenForo_ControllerHelper_Editor */
     $editorHelper = $this->getHelper('Editor');
     $input['message_body'] = $editorHelper->getMessageText('message_body', $this->_input);
     $input['message_body'] = XenForo_Helper_String::autoLinkBbCode($input['message_body']);
     $visitor = XenForo_Visitor::getInstance();
     /* @var $conversationDw XenForo_DataWriter_ConversationMaster */
     $conversationDw = XenForo_DataWriter::create('XenForo_DataWriter_ConversationMaster');
     $conversationDw->setExtraData(XenForo_DataWriter_ConversationMaster::DATA_ACTION_USER, $visitor->toArray());
     $conversationDw->setExtraData(XenForo_DataWriter_ConversationMaster::DATA_MESSAGE, $input['message_body']);
     $conversationDw->set('user_id', $visitor['user_id']);
     $conversationDw->set('username', $visitor['username']);
     $conversationDw->set('title', $input['conversation_title']);
     $conversationDw->addRecipientUserNames(explode(',', $input['recipients']));
     // checks permissions
     $messageDw = $conversationDw->getFirstMessageDw();
     $messageDw->set('message', $input['message_body']);
     $messageDw->setExtraData(XenForo_DataWriter_ConversationMessage::DATA_ATTACHMENT_HASH, $this->_getAttachmentHelper()->getAttachmentTempHash());
     $conversationDw->preSave();
     if (!$conversationDw->hasErrors()) {
         $this->assertNotFlooding('conversation');
     }
     $conversationDw->save();
     $conversation = $conversationDw->getMergedData();
     $this->_getConversationModel()->markConversationAsRead($conversation['conversation_id'], XenForo_Visitor::getUserId(), XenForo_Application::$time);
     $this->_request->setParam('conversation_id', $conversation['conversation_id']);
     return $this->responseReroute(__CLASS__, 'single');
 }
开发者ID:burtay,项目名称:bdApi,代码行数:33,代码来源:Conversation.php


示例6: renderVerification

 public function renderVerification(XenForo_View $view, $context, array $user, array $providerData, array $triggerData)
 {
     $issuer = XenForo_Helper_String::wholeWordTrim(str_replace(':', '', XenForo_Application::getOptions()->boardTitle), 50);
     $user = str_replace(':', '', $user['username']);
     $params = array('secret' => $providerData['secret'], 'otpUrl' => $this->_getAuthHandler()->getOtpAuthUrl("{$issuer}: {$user}", $providerData['secret'], $issuer), 'data' => $providerData, 'context' => $context);
     return $view->createTemplateObject('two_step_totp', $params)->render();
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:7,代码来源:Totp.php


示例7: renderTagCode

 public function renderTagCode(array $tag, array $rendererStates)
 {
     if (strtolower(strval($tag['option'])) == 'html') {
         $tag['option'] = 'html5';
     }
     if (!$tag['option']) {
         $tag['option'] = 'text';
     }
     $content = $this->stringifyTree($tag['children']);
     $content = XenForo_Helper_String::censorString($content);
     $geshi = new GeSHi($content, $tag['option']);
     if (XenForo_Application::get('options')->get('dpSyntaxHighlighterShowLines')) {
         $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS);
     }
     $geshi->set_link_target('_blank" rel="nofollow');
     $geshi->set_header_type(GESHI_HEADER_NONE);
     $geshi->set_tab_width(4);
     $content = $geshi->parse_code();
     if ($this->_view) {
         $template = $this->_view->createTemplateObject('dp_bb_code_tag_code', array('content' => $content, 'language' => $geshi->get_language_name()));
         return $template->render();
     } else {
         return '<div style="margin: 1em auto" title="Code">' . $content . '</div>';
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:25,代码来源:Base.php


示例8: actionSave

 public function actionSave()
 {
     if ($this->_input->inRequest('preview')) {
         return $this->responseReroute(__CLASS__, 'preview');
     }
     $this->_assertPostOnly();
     $feedId = $this->_input->filterSingle('feed_id', XenForo_Input::UINT);
     $data = $this->_getFeedFormData();
     $data['message_template'] = $this->getHelper('Editor')->getMessageText('message_template', $this->_input);
     $data['message_template'] = XenForo_Helper_String::autoLinkBbCode($data['message_template']);
     if ($data['user_id'] == -1) {
         $username = $this->_input->filterSingle('username', XenForo_Input::STRING);
         if ($user = $this->getModelFromCache('XenForo_Model_User')->getUserByName($username)) {
             $data['user_id'] = $user['user_id'];
         }
     }
     $data['user_id'] = intval(max($data['user_id'], 0));
     $writer = XenForo_DataWriter::create('XenForo_DataWriter_Feed');
     if ($feedId) {
         $writer->setExistingData($feedId);
     }
     $writer->bulkSet($data);
     $writer->save();
     return $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS, XenForo_Link::buildAdminLink('feeds'));
 }
开发者ID:hahuunguyen,项目名称:DTUI_201105,代码行数:25,代码来源:Feed.php


示例9: autoLinkTag

 public function autoLinkTag(array $tag, array $rendererStates)
 {
     $text = parent::autoLinkTag($tag, $rendererStates);
     if ($tag['tag'] == 'verse') {
         $bibleId = null;
         $option = explode(',', $tag['option']);
         $xenOptions = XenForo_Application::get('options');
         $verse = '';
         $version = null;
         if (count($option) > 1) {
             $verse = $option[0];
             $version = strtoupper($option[1]);
         } elseif ($option[0]) {
             if (preg_match('#^[A-z]+$#', $tag['option'])) {
                 $verse = '';
                 $version = strtoupper($tag['option']);
             } else {
                 $verse = $tag['option'];
                 $version = strtoupper($xenOptions->th_bible_defaultBible);
             }
         }
         if (in_array(strtolower($version), $xenOptions->th_bible_bbCodeBibles)) {
             $bibleId = strtolower($version);
         } elseif ($verse) {
             return $text;
         } else {
             $bibleId = null;
         }
         /* @var $verseModel ThemeHouse_Bible_Model_Verse */
         $verseModel = XenForo_Model::create('ThemeHouse_Bible_Model_Verse');
         if (!$verse) {
             $verse = XenForo_Helper_String::bbCodeStrip($text);
         }
         $verseText = $verseModel->getVerseFromText($verse, $bibleId);
         if ($verseText) {
             $verseTextStripped = XenForo_Helper_String::bbCodeStrip(str_ireplace('versenum', 'quote', $verseText), true);
             $textStripped = XenForo_Helper_String::bbCodeStrip(str_ireplace('versenum', 'quote', $text), true);
             $verseTextStripped = strtolower(preg_replace('!\\s+!', ' ', $verseTextStripped));
             // remove square brackets (i.e., extra comments)
             $textStripped = preg_replace('/\\[[^\\]]*\\]/', '', $textStripped);
             // remove double spaces, line breaks, etc.
             $textStripped = strtolower(preg_replace('!\\s+!', ' ', $textStripped));
             // split at elipsis
             $textStrippedSplit = preg_split("#(?:…)|(?:\\.\\.\\.)#", $textStripped);
             foreach ($textStrippedSplit as $_textStripped) {
                 if (!trim($_textStripped)) {
                     continue;
                 }
                 $strPos = strpos($verseTextStripped, $_textStripped);
                 if ($strPos === false) {
                     return '[VERSE=' . $verse . ',' . strtoupper($bibleId) . ']' . $verseText . '[/VERSE]';
                 } else {
                     $verseTextStripped = substr($verseTextStripped, $strPos + strlen($_textStripped));
                 }
             }
         }
     }
     return $text;
 }
开发者ID:ThemeHouse-XF,项目名称:Biblea,代码行数:59,代码来源:AutoLink.php


示例10: prepareCollection

 public function prepareCollection(array $collection, $viewingUser = null)
 {
     $this->standardizeViewingUserReference($viewingUser);
     if (!empty($collection)) {
         $collection['title'] = XenForo_Helper_String::censorString($collection['title']);
         $collection['description'] = XenForo_Helper_String::censorString($collection['description']);
     }
     return $collection;
 }
开发者ID:Sywooch,项目名称:forums,代码行数:9,代码来源:Collection.php


示例11: renderHtml

 /**
  * Help render the HTML output.
  *
  * @return mixed
  */
 public function renderHtml()
 {
     foreach ($this->_params['socialForums'] as &$forum) {
         $forum['urls'] = ThemeHouse_SocialGroups_Template_Helper_SocialForum::getAvatarUrls($forum);
         $forum['description'] = XenForo_Helper_String::bbCodeStrip($forum['description'], true);
     }
     unset($forum);
     $this->_params['renderedSocialForums'] = ThemeHouse_SocialGroups_ViewPublic_Helper::renderSocialForumsListFromDisplayArray($this, $this->_params['socialForums']);
 }
开发者ID:AndroidOS,项目名称:SocialGroups,代码行数:14,代码来源:List.php


示例12: _autoLinkUrlCallback

 /**
  * Callback for the auto-linker regex.
  *
  * @param array $match
  *
  * @return string
  */
 protected function _autoLinkUrlCallback(array $match)
 {
     $link = XenForo_Helper_String::prepareAutoLinkedUrl($match[0]);
     if ($link['url'] === $link['linkText']) {
         $tag = '[url]' . $link['url'] . '[/url]';
     } else {
         $tag = '[url="' . $link['url'] . '"]' . $link['linkText'] . '[/url]';
     }
     return $tag . $link['suffixText'];
 }
开发者ID:hahuunguyen,项目名称:DTUI_201105,代码行数:17,代码来源:AutoLink.php


示例13: getContentByIds

 /**
  * Fetches the content required by alerts.
  *
  * @param array $contentIds
  * @param XenForo_Model_Alert $model Alert model invoking this
  * @param integer $userId User ID the alerts are for
  * @param array $viewingUser Information about the viewing user (keys: user_id, permission_combination_id, permissions)
  *
  * @return array
  */
 public function getContentByIds(array $contentIds, $model, $userId, array $viewingUser)
 {
     $updateModel = $this->_getUpdateModel();
     $updates = $updateModel->getUpdatesByIds($contentIds, array('join' => XenResource_Model_Update::FETCH_RESOURCE | XenResource_Model_Update::FETCH_CATEGORY, 'permissionCombinationId' => $viewingUser['permission_combination_id']));
     foreach ($updates as &$update) {
         $update['resource_title'] = XenForo_Helper_String::censorString($update['resource_title']);
         $update['title'] = XenForo_Helper_String::censorString($update['title']);
     }
     return $updates;
 }
开发者ID:Sywooch,项目名称:forums,代码行数:20,代码来源:Update.php


示例14: _prepareNewsFeedItemAfterAction

 /**
  * Prepares the news feed item for display
  *
  * @param array $item News feed item
  * @param array $content News feed item content
  * @param array $viewingUser Information about the viewing user (keys: user_id, permission_combination_id, permissions)
  *
  * @return array
  */
 protected function _prepareNewsFeedItemAfterAction(array $item, $content, array $viewingUser)
 {
     $item['content'] = array('title' => XenForo_Helper_String::censorString($content['title']));
     foreach ($this->_getContentPrimaryKeynames() as $key) {
         if (isset($content[$key])) {
             $item['content'][$key] = $content[$key];
         }
     }
     return $item;
 }
开发者ID:namgiangle90,项目名称:tokyobaito,代码行数:19,代码来源:Discussion.php


示例15: _prepareNewsFeedItemAfterAction

 /**
  * Prepares the news feed item for display
  *
  * @param array $item News feed item
  * @param array $content News feed item content
  * @param array $viewingUser Information about the viewing user (keys: user_id, permission_combination_id, permissions)
  *
  * @return array
  */
 protected function _prepareNewsFeedItemAfterAction(array $item, $content, array $viewingUser)
 {
     if (isset($item[$item['action']]['old'])) {
         $item[$item['action']]['old'] = XenForo_Helper_String::censorString($item[$item['action']]['old']);
     }
     if (isset($item[$item['action']]['new'])) {
         $item[$item['action']]['new'] = XenForo_Helper_String::censorString($item[$item['action']]['new']);
     }
     return $item;
 }
开发者ID:namgiangle90,项目名称:tokyobaito,代码行数:19,代码来源:User.php


示例16: updateCategory

 public function updateCategory($input)
 {
     $dw = XenForo_DataWriter::create('EWRmedio_DataWriter_Categories');
     if (!empty($input['category_id']) && ($category = $this->getCategoryByID($input['category_id']))) {
         $dw->setExistingData($category);
     }
     $dw->bulkSet(array('category_name' => $input['category_name'], 'category_description' => XenForo_Helper_String::autoLinkBbCode($input['category_description']), 'category_parent' => $input['category_parent'], 'category_disabled' => $input['category_disabled']));
     $dw->save();
     $input['category_id'] = $dw->get('category_id');
     return $input;
 }
开发者ID:Sywooch,项目名称:forums,代码行数:11,代码来源:Categories.php


示例17: getContentTitle

 /**
  * Gets the title of the specified content.
  *
  * @see XenForo_ReportHandler_Abstract:getContentTitle()
  */
 public function getContentTitle(array $report, array $contentInfo)
 {
     if (!empty($contentInfo['media']['album_id']) && isset($contentInfo['media']['album_title'])) {
         return new XenForo_Phrase('xengallery_media_x_in_album_y', array('title' => XenForo_Helper_String::censorString($contentInfo['media']['media_title']), 'album' => $contentInfo['media']['album_title']));
     } else {
         if (!empty($contentInfo['media']['category_id']) && isset($contentInfo['media']['category_title'])) {
             return new XenForo_Phrase('xengallery_media_x_in_category_y', array('title' => XenForo_Helper_String::censorString($contentInfo['media']['media_title']), 'category' => $contentInfo['media']['category_title']));
         }
     }
     return new XenForo_Phrase('xengallery_media');
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:16,代码来源:Media.php


示例18: _insertIntoIndex

 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);
 }
开发者ID:Sywooch,项目名称:forums,代码行数:12,代码来源:Post.php


示例19: renderJson

 public function renderJson()
 {
     $options = XenForo_Application::get('options');
     $formatter = XenForo_BbCode_Formatter_Base::create('Dark_TaigaChat_BbCode_Formatter_Tenori', array('view' => $this));
     switch ($options->dark_taigachat_bbcode) {
         case 'Full':
             $formatter->displayableTags = true;
             break;
         case 'Basic':
         default:
             $formatter->displayableTags = array('img', 'url', 'email', 'b', 'u', 'i', 's', 'color');
             break;
         case 'None':
             $formatter->displayableTags = array('url', 'email');
             break;
     }
     $formatter->getTagsAgain();
     $parser = new XenForo_BbCode_Parser($formatter);
     if ($options->dark_taigachat_imagemode == 'Link') {
         foreach ($this->_params['taigachat']['messages'] as &$message) {
             $message['message'] = str_ireplace(array("[img]", "[/img]"), array("[url]", "[/url]"), $message['message']);
         }
     }
     $maxid = $this->_params['taigachat']['lastrefresh'];
     foreach ($this->_params['taigachat']['messages'] as &$message) {
         if ($options->dark_taigachat_bbcode == 'Full') {
             $message['message'] = XenForo_Helper_String::autoLinkBbCode($message['message']);
         } else {
             // We don't want to parse youtube etc. urls if [media] is disabled
             $autoLinkParser = new XenForo_BbCode_Parser(XenForo_BbCode_Formatter_Base::create('Dark_TaigaChat_BbCode_Formatter_BbCode_AutoLink', false));
             $message['message'] = $autoLinkParser->render($message['message']);
         }
         if ($message['id'] > $maxid) {
             $maxid = $message['id'];
         }
     }
     XenForo_ViewPublic_Helper_Message::bbCodeWrapMessages($this->_params['taigachat']['messages'], $parser);
     if ($options->dark_taigachat_direction) {
         $this->_params['taigachat']['messages'] = array_reverse($this->_params['taigachat']['messages']);
     }
     $template = $this->createTemplateObject($this->_templateName, $this->_params);
     $template->setParams($this->_params);
     $rendered = $template->render();
     $rendered = preg_replace('/\\s+<\\/(.*?)>\\s+</si', ' </$1> <', $rendered);
     $rendered = preg_replace('/\\s+<(.*?)([ >])/si', ' <$1$2', $rendered);
     //$rendered = str_replace(array("\r", "\n", "\t"), "", $rendered);
     $derp = XenForo_ViewRenderer_Json::jsonEncodeForOutput(array("templateHtml" => $rendered, "reverse" => $options->dark_taigachat_direction, "lastrefresh" => $maxid));
     $extraHeaders = XenForo_Application::gzipContentIfSupported($derp);
     foreach ($extraHeaders as $extraHeader) {
         header("{$extraHeader['0']}: {$extraHeader['1']}", $extraHeader[2]);
     }
     return $derp;
 }
开发者ID:Sywooch,项目名称:forums,代码行数:53,代码来源:List.php


示例20: prepareAlert

 /**
  * Prepares a news feed item for rendering.
  * Designed to be overriden by extended classes, while retaining the call to _prepareAlert.
  *
  * @param array $alert
  * @param array $viewingUser Information about the viewing user (keys: user_id, permission_combination_id, permissions)
  *
  * @return array
  */
 public function prepareAlert(array $item, array $viewingUser)
 {
     $methodName = '_prepare' . ucfirst($item['action']);
     $item = $this->_prepareAlertBeforeAction($item, $item['content'], $viewingUser);
     if (isset($item['content']['title'])) {
         $item['content']['title'] = XenForo_Helper_String::censorString($item['content']['title']);
     }
     if (method_exists($this, $methodName)) {
         $item = call_user_func(array($this, $methodName), $item, $viewingUser);
     }
     return $this->_prepareAlertAfterAction($item, $item['content'], $viewingUser);
 }
开发者ID:hahuunguyen,项目名称:DTUI_201105,代码行数:21,代码来源:Abstract.php



注:本文中的XenForo_Helper_String类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP XenForo_Link类代码示例发布时间:2022-05-23
下一篇:
PHP XenForo_Helper_File类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap