本文整理汇总了PHP中XenForo_BbCode_Formatter_Base::create方法的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_BbCode_Formatter_Base::create方法的具体用法?PHP XenForo_BbCode_Formatter_Base::create怎么用?PHP XenForo_BbCode_Formatter_Base::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XenForo_BbCode_Formatter_Base
的用法示例。
在下文中一共展示了XenForo_BbCode_Formatter_Base::create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderHtml
public function renderHtml()
{
XenForo_Template_Helper_Core::setThreadPrefixes($this->_params['prefixes']);
// don't pass a view to this, because the templates don't exist in the admin
$bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base'));
$this->_params['entry']['messageHtml'] = new XenForo_BbCode_TextWrapper($this->_params['entry']['message'], $bbCodeParser);
}
示例2: renderJson
public function renderJson()
{
$bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
$bbCodeOptions = array('states' => array('viewAttachments' => $this->_params['canViewAttachments']), 'contentType' => 'post', 'contentIdKey' => 'post_id', 'showSignature' => XenForo_Visitor::getInstance()->get('content_show_signature'), 'states' => array());
$this->_params['comment']['messageHtml'] = XenForo_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['comment'], $bbCodeParser, $bbCodeOptions);
return array('comment' => $this->createTemplateObject('BRCR_post_comment', $this->_params));
}
示例3: renderHtml
public function renderHtml()
{
XenForo_Application::set('view', $this);
$bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
$this->_params['team']['aboutHtml'] = new XenForo_BbCode_TextWrapper($this->_params['team']['about'], $bbCodeParser);
foreach ($this->_params['customFieldsGrouped'] as $id => &$fields) {
if (empty($fields['fieldChoices'])) {
// hard remove if custom fields did not have any values
// @link https://nobita.me/threads/227/
unset($this->_params['customFieldsGrouped'][$id]);
continue;
}
foreach ($fields as &$field) {
if ($field['field_type'] == 'bbcode') {
$field['fieldValueHtml'] = new XenForo_BbCode_TextWrapper($field['field_value'], $bbCodeParser);
} else {
$field['fieldValueHtml'] = Nobita_Teams_ViewPublic_Helper_Team::getTeamFieldValueHtml($this->_params['team'], $field, $field['field_value']);
}
}
}
unset($fields, $field);
foreach ($this->_params['parentTabsGrouped'] as &$fields) {
foreach ($fields as &$field) {
if ($field['field_type'] == 'bbcode') {
$field['fieldValueHtml'] = new XenForo_BbCode_TextWrapper($field['field_value'], $bbCodeParser);
} else {
$field['fieldValueHtml'] = Nobita_Teams_ViewPublic_Helper_Team::getTeamFieldValueHtml($this->_params['team'], $field, $field['field_value']);
}
}
}
}
示例4: renderHtml
public function renderHtml()
{
$bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
$fields =& $this->_params['fields'];
foreach ($fields as $fieldId => &$field) {
if ($field['field_type'] == 'wysiwyg') {
$field['editor'] = XenForo_ViewPublic_Helper_Editor::getEditorTemplate($this, 'fields[' . $field['field_id'] . '][editor]', $field['default_value'], array('editorId' => $fieldId . '_editor'));
}
if ($field['field_type'] == 'rating') {
$field['fieldChoices'] = array();
for ($i = 1; $i <= XenForo_Application::getOptions()->lpsfRatingMax; $i++) {
$field['fieldChoices'][] = $i;
}
}
// render the pre text
if ($field['pre_text'] != '') {
$field['pre_text'] = new XenForo_BbCode_TextWrapper($field['pre_text'], $bbCodeParser);
}
// render the post text
if ($field['post_text'] != '') {
$field['post_text'] = new XenForo_BbCode_TextWrapper($field['post_text'], $bbCodeParser);
}
// datetime default_value editor
if (array_key_exists('field_type', $field) && $field['field_type'] == 'datetime') {
$temp = explode(' ', $field['default_value']);
if (count($temp) == 2) {
$field['default_value'] = array('date' => $temp[0], 'time' => $temp[1]);
} else {
$field['default_value'] = array('date' => '', 'time' => '');
}
}
}
}
示例5: renderHtml
public function renderHtml()
{
XenForo_Application::set('view', $this);
$bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
$bbCodeOptions = array('states' => array('viewAttachments' => $this->_params['canViewImages']), 'showSignature' => false);
$this->_params['update']['messageHtml'] = XenForo_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['update'], $bbCodeParser, $bbCodeOptions);
}
示例6: renderHtml
public function renderHtml()
{
$this->_params['editorTemplate'] = XenForo_ViewPublic_Helper_Editor::getQuickReplyEditor($this, 'message', $this->_params['post']['message'], array('json' => array('buttonConfig' => $this->_params['customEditor'])));
$bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Nobita_Teams_BbCode_Formatter_Base', array('view' => $this)));
$bbCodeOptions = array('states' => array('viewAttachments' => $this->_params['canViewAttachments']), 'contentType' => 'team_post', 'contentIdKey' => 'post_id');
$this->_params['post']['messageHtml'] = XenForo_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['post'], $bbCodeParser, $bbCodeOptions);
}
示例7: renderJson
public function renderJson()
{
$bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Nobita_Teams_BbCode_Formatter_Comment', array('view' => $this)));
//$this->_params['comment']['messageHtml'] = new XenForo_BbCode_TextWrapper($this->_params['comment']['message'], $bbCodeParser);
$this->_params['comment']['messageHtml'] = XenForo_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['comment'], $bbCodeParser, array());
return array('comment' => $this->createTemplateObject('Team_post_comment', $this->_params));
}
示例8: renderHtml
public function renderHtml()
{
XenForo_Application::set('view', $this);
$bbCodeBase = XenForo_BbCode_Formatter_Base::create('Nobita_Teams_BbCode_Formatter_Base', array('view' => $this));
$commentBbCode = XenForo_BbCode_Formatter_Base::create('Nobita_Teams_BbCode_Formatter_Comment', array('view', $this));
$bbCodeParser = XenForo_BbCode_Parser::create($bbCodeBase);
$commentBbCodeParser = XenForo_BbCode_Parser::create($commentBbCode);
$bbCodeOptions = array('states' => array('viewAttachments' => $this->_params['canViewAttachments']), 'contentType' => 'team_post', 'contentIdKey' => 'post_id');
$this->_params['team']['aboutHtml'] = new XenForo_BbCode_TextWrapper($this->_params['team']['about'], $bbCodeParser);
XenForo_ViewPublic_Helper_Message::bbCodeWrapMessages($this->_params['posts'], $bbCodeParser, $bbCodeOptions);
foreach ($this->_params['posts'] as &$post) {
if (!$post['comments']) {
continue;
}
XenForo_ViewPublic_Helper_Message::bbCodeWrapMessages($post['comments'], $commentBbCodeParser, array());
}
XenForo_ViewPublic_Helper_Message::bbCodeWrapMessages($this->_params['stickyPosts'], $bbCodeParser, $bbCodeOptions);
foreach ($this->_params['stickyPosts'] as &$post) {
if (!$post['comments']) {
continue;
}
XenForo_ViewPublic_Helper_Message::bbCodeWrapMessages($post['comments'], $commentBbCodeParser, array());
}
unset($post);
$this->_params['editorTemplate'] = XenForo_ViewPublic_Helper_Editor::getEditorTemplate($this, 'message', '', array('json' => array('buttonConfig' => $this->_params['customEditor']), 'height' => '60px'));
}
示例9: renderHtml
public function renderHtml()
{
if (!empty($this->_params['item']['listing_description'])) {
$bbCodeParser = new XenForo_BbCode_Parser(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
$this->_params['item']['HTML'] = new XenForo_BbCode_TextWrapper($this->_params['item']['listing_description'], $bbCodeParser);
}
}
示例10: renderTagMedio
public function renderTagMedio(array $tag, array $rendererStates)
{
$text = $this->renderSubTree($tag['children'], $rendererStates);
$topt = $tag['option'];
if ($media = XenForo_Model::create('EWRmedio_Model_Media')->getMediaByID($text, false)) {
if ($this->_view) {
if ($topt == 'full') {
$bbCodeParser = new XenForo_BbCode_Parser(XenForo_BbCode_Formatter_Base::create('Base'));
$media['media_description'] = new XenForo_BbCode_TextWrapper($media['media_description'], $bbCodeParser);
$keywords = explode(",", $media['media_keywords']);
foreach ($keywords as &$keyword) {
$keyword = trim($keyword);
$keyword = '<a href="' . XenForo_Link::buildPublicLink('media/keyword', array('keyword_text' => $keyword)) . '">' . $keyword . '</a>';
}
$media['media_keywords'] = implode(", ", $keywords);
$template = $this->_view->createTemplateObject('EWRmedio_BBcode_Full', array('media' => $media));
} else {
$viewParams = array('media' => $media);
if ($topt == 'left' || $topt == 'right') {
$viewParams['float'] = $topt;
}
$template = $this->_view->createTemplateObject('EWRmedio_BBcode', $viewParams);
}
return $template->render();
}
return '<a href="' . XenForo_Link::buildPublicLink('media', $media) . '">' . $media['media_title'] . '</a>';
} else {
return '[medio]' . $text . '[/medio]';
}
}
示例11: renderHtml
public function renderHtml()
{
$bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
$bbCodeOptions = array('states' => array('viewAttachments' => $this->_params['canViewImages']));
$this->_params['showLimitedNotice'] = $this->_params['isLimited'];
$this->_params['update']['messageHtml'] = XenForo_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['update'], $bbCodeParser, $bbCodeOptions);
}
示例12: actionList
public function actionList()
{
$viewParams = array();
$taigamodel = $this->_getTaigaChatModel();
$options = XenForo_Application::get('options');
$visitor = XenForo_Visitor::getInstance();
$sidebar = false;
if (!$taigamodel->canViewMessages()) {
//throw $this->getErrorOrNoPermissionResponseException('dark_no_permission_view_message');
return $this->responseView('Dark_TaigaChat_ViewPublic_TaigaChat_List_Blank', 'dark_taigachat_blank');
}
if ($this->_input->inRequest('sidebar') && $this->_input->filterSingle('sidebar', XenForo_Input::UINT)) {
$sidebar = true;
}
$query = array("page" => 1, "perPage" => $sidebar ? $options->dark_taigachat_sidebarperpage : $options->dark_taigachat_fullperpage, "lastRefresh" => $this->_input->filterSingle('lastrefresh', XenForo_Input::UINT));
$messages = $taigamodel->getMessages($this->_input->filterSingle('room', XenForo_Input::UINT), $query);
$messageIds = $taigamodel->getMessageIds($this->_input->filterSingle('room', XenForo_Input::UINT), $query);
foreach ($messages as &$message) {
if ($taigamodel->canModifyMessage($message)) {
$message['canModify'] = true;
}
}
$bbCodeParser = new XenForo_BbCode_Parser(XenForo_BbCode_Formatter_Base::create('Base'));
$motd = new XenForo_BbCode_TextWrapper($options->dark_taigachat_motd, $bbCodeParser);
if (!$this->_input->filterSingle('fake', XenForo_Input::UINT)) {
$taigamodel->updateActivity($visitor['user_id']);
}
$onlineUsersTaiga = array();
if ($options->dark_taigachat_sidebar) {
$onlineUsersTaiga = $taigamodel->getActivityUserList($visitor->toArray());
}
$viewParams = array('taigachat' => array("messages" => $messages, "sidebar" => $sidebar, "messageIds" => $messageIds, "editside" => $options->dark_taigachat_editside, "timedisplay" => $options->dark_taigachat_timedisplay, "miniavatar" => $options->dark_taigachat_miniavatar, "lastrefresh" => $this->_input->filterSingle('lastrefresh', XenForo_Input::UINT), "numInChat" => $taigamodel->getActivityUserCount(), "motd" => $motd, 'online' => $onlineUsersTaiga, "route" => $options->dark_taigachat_route, "canBan" => $taigamodel->canBanFromShoutbox()));
return $this->responseView('Dark_TaigaChat_ViewPublic_TaigaChat_List', 'dark_taigachat_list', $viewParams);
}
示例13: renderHtml
public function renderHtml()
{
$options = XenForo_Application::get('options');
$parserModel = XenForo_Model::create('EWRcarta_Model_Parser');
if ($this->_params['page']['page_type'] == 'phpfile') {
$this->_params['page'] = $parserModel->parsePagePHP($this->_params['page']);
} else {
$cacheModel = XenForo_Model::create('EWRcarta_Model_Cache');
$cache = $cacheModel->getCache($this->_params['page']);
if ($this->_params['page']['page_date'] >= $cache['cache_date'] || strtotime($options->EWRcarta_cache, $cache['cache_date']) < XenForo_Application::$time) {
$bbCodeParser = new XenForo_BbCode_Parser(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
$bbCodeOptions = array('viewAttachments' => true, 'stopLineBreakConversion' => $this->_params['page']['page_type'] == 'html' ? true : false, 'attachments' => $this->_params['page']['attachments']);
$this->_params['page']['HTML'] = new XenForo_BbCode_TextWrapper($this->_params['page']['page_content'], $bbCodeParser, $bbCodeOptions);
$this->_params['page']['HTML'] = (string) $this->_params['page']['HTML'];
if ($this->_params['page']['page_type'] == 'html') {
$this->_params['page']['HTML'] = htmlspecialchars_decode($this->_params['page']['HTML']);
}
$this->_params['page'] = $parserModel->parseContents($this->_params['page']);
$this->_params['page'] = $parserModel->parseTemplates($this->_params['page']);
$this->_params['page'] = $parserModel->parseAutolinks($this->_params['page']);
$dw = XenForo_DataWriter::create('EWRcarta_DataWriter_Cache', XenForo_DataWriter::ERROR_SILENT);
if ($cache) {
$dw->setExistingData($cache);
}
$dw->bulkSet(array('page_id' => $this->_params['page']['page_id'], 'cache_content' => $this->_params['page']['HTML']));
$dw->save();
} else {
$this->_params['page']['HTML'] = $cache['cache_content'];
$this->_params['page']['cache'] = $cache['cache_date'];
}
}
}
示例14: renderHtml
public function renderHtml()
{
$bbCodeParser = new XenForo_BbCode_Parser(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
$this->_params['media']['HTML'] = new XenForo_BbCode_TextWrapper($this->_params['media']['media_description'], $bbCodeParser);
$bbCodeStripper = new XenForo_BbCode_Parser(XenForo_BbCode_Formatter_Base::create('XenForo_BbCode_Formatter_Text'));
$this->_params['media']['TEXT'] = $bbCodeStripper->render($this->_params['media']['media_description']);
}
示例15: renderJson
public function renderJson()
{
$output = array();
$bbCodeParser = new XenForo_BbCode_Parser(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
$bbCodeOptions = array('states' => array('viewAttachments' => $this->_params['canViewAttachments']));
XenForo_ViewPublic_Helper_Message::bbCodeWrapMessages($this->_params['posts'], $bbCodeParser, $bbCodeOptions);
$viewParams = $this->_params;
unset($viewParams['posts']);
foreach ($this->_params['posts'] as &$post) {
$viewParams['post'] = $post;
$template = $this->createTemplateObject('post', $viewParams);
$output['posts'][] = $template->render();
}
if (XenForo_Application::getOptions()->sonnb_LiveThread_reserveOrder) {
$lastPost = reset($this->_params['posts']);
} else {
$lastPost = end($this->_params['posts']);
}
$template = $this->createTemplateObject('', $viewParams);
$viewOutput = $template->render();
$output['css'] = $template->getRequiredExternals('css');
$output['js'] = $template->getRequiredExternals('js');
$output['lastDate'] = $lastPost['post_date'];
$output['reserveOrder'] = isset($viewParams['reserveOrder']) ? $viewParams['reserveOrder'] : false;
return XenForo_ViewRenderer_Json::jsonEncodeForOutput($output);
}