HTML BBCode (permission protected) [Deleted]

I have a suggestion. How can we add a click option. It gets tiring everytime typing it out.

GPL$JZ~(EB2QA]1~A_CQ$T4.webp

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
 
I have another suggestion. It would make this even better if we could use the [parsehtml] in the Signature.
 
Dang, I'd pay more for something that did that.
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 :)
 
Great!

How about xenzine?
library - XenZine - ViewPublic - Article - View.php

replace content with:
PHP:
<?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');
    }       
}

Basically your editing that add-on's public function renderHtml to use darks html one and not stock Xenforo, do a file compare and you will see the edits made to make it work are same in both add-on, just about finding the right file.
 
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?
 
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?

PM me the old and new emails and I'll change that for you
 
******* has a parsehtml addon that is integrated into the editor. Mistypants has also integrated her sosbbcodes addon into the editor. Can we get the same for this addon please?
 
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 :)

This was working great, sadly it seems to not work in resource manager with latest version of xenforo and/or resource manager. Can anyone help please?
 
Last edited:
Top Bottom