1. REGISTRATION REQUIREMENTS:

    Register with your xenforo.com Username then start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Integration w/HTML BBCode (permission protected) addon

Discussion in 'Showcase Support' started by Bob, Nov 10, 2012.

Thread Status:
Not open for further replies.
  1. Bob

    Bob Developer Staff Member

    For Integration with darkimortal's HTML BBCode (permission protected) addon ( http://www.xenforo.com/community/threads/html-bbcode-permission-protected-paid.31824/), you will need to make the follow direct file edit.

    NOTE: This only works for Beta 4 on up. It will not work with Beta 3 or below.

    edit the file /library/NFLJ/Showcase/ViewPublic/Item/View.php

    Replace:
    PHP:
            $bbCodeParser = new XenForo_BbCode_Parser(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
            
    $bbCodeOptions = array(
                
    'states' => array(
                    
    'viewAttachments' => $this->_params['item']['canViewAttachments']
                )
            );

            
    $this->_params['item']['message'] = XenForo_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['item'], $bbCodeParser$bbCodeOptions);
            
    $this->_params['t2']['message'] = XenForo_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['t2'], $bbCodeParser$bbCodeOptions);
            
    $this->_params['t3']['message'] = XenForo_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['t3'], $bbCodeParser$bbCodeOptions);
            
    $this->_params['t4']['message'] = XenForo_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['t4'], $bbCodeParser$bbCodeOptions);
            
    $this->_params['t5']['message'] = XenForo_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['t5'], $bbCodeParser$bbCodeOptions);    
    With:

    PHP:
            $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['item']['canViewAttachments']
                )
            );

            
    $this->_params['item']['message'] = Dark_ParseHTML_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['item'], $bbCodeParser$bbCodeOptions);
            
    $this->_params['t2']['message'] = Dark_ParseHTML_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['t2'], $bbCodeParser$bbCodeOptions);
            
    $this->_params['t3']['message'] = Dark_ParseHTML_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['t3'], $bbCodeParser$bbCodeOptions);
            
    $this->_params['t4']['message'] = Dark_ParseHTML_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['t4'], $bbCodeParser$bbCodeOptions);
            
    $this->_params['t5']['message'] = Dark_ParseHTML_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['t5'], $bbCodeParser$bbCodeOptions);
     
    Last edited: Jul 27, 2013
    Regs, ibenick, tak and 1 other person like this.
  2. C.Birch

    C.Birch Member Article Mgmt System EA User Blogs System EA Showcase EA

    Hi,

    In my admin cp i keep getting the following error in the error logs, i have not come across any errors when using the showcase itself.

    Code:
    ErrorException: Undefined index: canViewAttachments - library/NFLJ/Showcase/ViewPublic/Item/View.php:11
    Generated By: Unknown Account, Today at 3:34 AM
    Stack Trace
    
    #0 /var/www/vhosts/*****/httpdocs/beta/library/NFLJ/Showcase/ViewPublic/Item/View.php(11): XenForo_Application::handlePhpError(8, 'Undefined index...', '/var/www/vhosts...', 11, Array)
    #1 /var/www/vhosts/*****/httpdocs/beta/library/XenForo/ViewRenderer/Abstract.php(227): NFLJ_Showcase_ViewPublic_Item_View->renderHtml()
    #2 /var/www/vhosts/*****/httpdocs/beta/library/XenForo/ViewRenderer/HtmlPublic.php(67): XenForo_ViewRenderer_Abstract->renderViewObject('NFLJ_Showcase_V...', 'Html', Array, 'nflj_showcase_i...')
    #3 /var/www/vhosts/*****httpdocs/beta/library/XenForo/FrontController.php(572): XenForo_ViewRenderer_HtmlPublic->renderView('NFLJ_Showcase_V...', Array, 'nflj_showcase_i...', NULL)
    #4 /var/www/vhosts/*****/httpdocs/beta/library/XenForo/FrontController.php(158): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_HtmlPublic), Array)
    #5 /var/www/vhosts/*****/httpdocs/beta/index.php(13): XenForo_FrontController->run()
    #6 {main}
    Request State
    array(3) {
      ["url"] => string(75) "http://beta.yourpshome.net/showcase/secret-peacekeeping-base-yuma-cafe.173/"
      ["_GET"] => array(0) {
      }
      ["_POST"] => array(0) {
      }
    }
    
     
  3. C.Birch

    C.Birch Member Article Mgmt System EA User Blogs System EA Showcase EA

    I think this is my bad, i edited the file to add back in darks HTML support and followed the old edit what had "'viewAttachments' => $this->_params['canViewAttachments']" what should now be "'viewAttachments' => $this->_params['item']['canViewAttachments']"
     
  4. Bob

    Bob Developer Staff Member

    ah, ya. I changed those permissions from self singular ie $canViewAttachments to elements in the $item array, ie $item.canViewAttachments

    I'll change the help post :)
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.