I have a suggestion. How can we add a click option. It gets tiring everytime typing it out.
View attachment 74849
For every post i have to type in [parsehtml] [/parsehtml]
It would be great if we could just click an icon and [parsehtml] [/parsehtm] would appear.
Other than that. This mod works great. I use it everyday
Unfortunately not. Have been requested many months.Will this work in resources?
This add-on can work with the Resources manager, it just needs a single file to be edited by hand.Dang, I'd pay more for something that did that.
<?php
class XenResource_ViewPublic_Resource_Description extends XenForo_ViewPublic_Base
{
public function renderHtml()
{
XenForo_Application::set('view', $this);
$formatter = Dark_ParseHTML_BbCode_Formatter_Ritsu::create('Dark_ParseHTML_BbCode_Formatter_Ritsu', array('view' => $this));
$bbCodeParser = new Dark_ParseHTML_BbCode_Parser($formatter);
$bbCodeOptions = array(
'states' => array(
'viewAttachments' => $this->_params['canViewImages']
),
'showSignature' => false
);
$this->_params['update']['messageHtml'] = Dark_ParseHTML_ViewPublic_Helper_Message::getBbCodeWrapper(
$this->_params['update'], $bbCodeParser, $bbCodeOptions
);
}
}
This add-on can work with the Resources manager, it just needs a single file to be edited by hand.
Be sure to back up that file and use this edit at your own risk![]()
library - XenZine - ViewPublic - Article - View.phpGreat!
How about xenzine?
<?php
class XenZine_ViewPublic_Article_View extends XenForo_ViewPublic_Base
{
public function renderHtml()
{
$formatter = Dark_ParseHTML_BbCode_Formatter_Ritsu::create('Dark_ParseHTML_BbCode_Formatter_Ritsu', array('view' => $this));
$bbCodeParser = new Dark_ParseHTML_BbCode_Parser($formatter);
$bbCodeOptions = array(
'states' => array(
'viewAttachments' => true
)
);
$article = $this->_params['article']; // referance unalterd copy
$this->_params['article']['message'] = $this->_params['article']['body'];
$this->_params['article']['body'] = Dark_ParseHTML_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['article'], $bbCodeParser, $bbCodeOptions);
$this->_params['article']['message'] = $this->_params['article']['resource_box'];
$this->_params['article']['resource_box'] = XenForo_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['article'], $bbCodeParser, $bbCodeOptions);
// we also want to render all of the different types of custom fields
$customFieldModel = $this->_getCustomFieldModel();
$customFieldsFromCache = $customFieldModel->getCustomFieldsFromCache();
$customValues = $this->_params['customFieldsBottom'];
$this->customFeildsBbCodeWrapper($this->_params['customFieldsBottom'], $customValues, $customFieldsFromCache, $article, $customFieldModel, $bbCodeParser, $bbCodeOptions);
$customValues = $this->_params['customFieldsSide'];
$this->customFeildsBbCodeWrapper($this->_params['customFieldsSide'], $customValues, $customFieldsFromCache, $article, $customFieldModel, $bbCodeParser, $bbCodeOptions);
$customValues = $this->_params['customFieldsTop'];
$this->customFeildsBbCodeWrapper($this->_params['customFieldsTop'], $customValues, $customFieldsFromCache, $article, $customFieldModel, $bbCodeParser, $bbCodeOptions);
$tabs = $this->_params['customTabs'];
if($tabs)
{
foreach($tabs as $tabKey=>$tab)
{
$customValues = $this->_params['customTabs'][$tabKey]['customFields'];
$this->customFeildsBbCodeWrapper($this->_params['customTabs'][$tabKey]['customFields'], $customValues, $customFieldsFromCache, $article, $customFieldModel, $bbCodeParser, $bbCodeOptions);
}
}
}
public function customFeildsBbCodeWrapper(&$paramKey, $customValues, $customFieldsFromCache, $article, $customFieldModel, $bbCodeParser, $bbCodeOptions)
{
if($customValues)
{
foreach($customValues as $customValueKey => $customValue)
{
if($customValue)
{
$field_id = $customValue['field_id'];
$field = $customFieldModel->getCustomFieldById($field_id, $customFieldsFromCache);
$fieldMap = $customFieldModel->getCustomFieldMapByType($field['field_type']);
if($fieldMap == "text" || $fieldMap == "single")
{
$field_value = $customValue['field_value'];
$nArticle = $article; // use a referance, so we can keep using it, it gets moddifed on passing through getBbCodeWrapper
$nArticle['message'] = $field_value;
$field_value = XenForo_ViewPublic_Helper_Message::getBbCodeWrapper($nArticle, $bbCodeParser, $bbCodeOptions);
$paramKey[$customValueKey]['field_value'] = $field_value;
$this->removeCustomAttachments($nArticle['message'], $this->_params['article']);
}
if($fieldMap == "multiple" )
{
foreach($customValue['field_value'] as $vKey => $v)
{
$nArticle = $article; // use a referance, so we can keep using it, it gets moddifed on passing through getBbCodeWrapper
$nArticle['message'] = $v;
$v = XenForo_ViewPublic_Helper_Message::getBbCodeWrapper($nArticle, $bbCodeParser, $bbCodeOptions);
$paramKey[$customValueKey]['field_value'][$vKey] = $v;
$this->removeCustomAttachments($nArticle['message'], $this->_params['article']);
}
}
if($fieldMap == "tablerows" )
{
foreach($customValue['field_value']['rows'] as $rowKey => $row)
{
foreach($row['value'] as $cellKey => $cell)
{
$nArticle = $article; // use a referance, so we can keep using it, it gets moddifed on passing through getBbCodeWrapper
$nArticle['message'] = $cell;
$cell = XenForo_ViewPublic_Helper_Message::getBbCodeWrapper($nArticle, $bbCodeParser, $bbCodeOptions);
$paramKey[$customValueKey]['field_value']['rows'][$rowKey]['value'][$cellKey] = $cell;
$this->removeCustomAttachments($nArticle['message'], $this->_params['article']);
}
}
}
}
}
}
}
public function removeCustomAttachments($text, &$message) // remove attachments from body message that are found in cusotm Attachments
{
if (stripos($text, '[/attach]') !== false)
{
if (preg_match_all('#\[attach(=[^\]]*)?\](?P<id>\d+)(\D.*)?\[/attach\]#iU', $text, $matches))
{
foreach ($matches['id'] AS $attachId)
{
unset($message['attachments'][$attachId]);
}
}
}
}
protected function _getCustomFieldModel()
{
return XenForo_Model::create('XenZine_Model_CustomField');
}
}
I just bought it and it was instantly delivered. I however did not like that it is licensed to the paypal email address in my control panel. I tend to keep that information private, specifically, the email address I use to make purchases.
Is there anyway I can get that changed to the admin's address of the domain that hosts the board instead?
This add-on can work with the Resources manager, it just needs a single file to be edited by hand.
Is this working with 1.4.2?
Great addon btw. Thank you.
This add-on can work with the Resources manager, it just needs a single file to be edited by hand.
Open the file: library - XenResource - ViewPublic - Resource - Description.php
And replace its content with the following.
PHP:<?php class XenResource_ViewPublic_Resource_Description extends XenForo_ViewPublic_Base { public function renderHtml() { XenForo_Application::set('view', $this); $formatter = Dark_ParseHTML_BbCode_Formatter_Ritsu::create('Dark_ParseHTML_BbCode_Formatter_Ritsu', array('view' => $this)); $bbCodeParser = new Dark_ParseHTML_BbCode_Parser($formatter); $bbCodeOptions = array( 'states' => array( 'viewAttachments' => $this->_params['canViewImages'] ), 'showSignature' => false ); $this->_params['update']['messageHtml'] = Dark_ParseHTML_ViewPublic_Helper_Message::getBbCodeWrapper( $this->_params['update'], $bbCodeParser, $bbCodeOptions ); } }
Be sure to back up that file and use this edit at your own risk![]()
We use essential cookies to make this site work, and optional cookies to enhance your experience.