Make a section of your website work when forum is down?

Jaxel

Well-known member
If I disable my forum, I would like to make certain sections of the forum still work... How would this be possible?
 
XenForo_ControllerPublic_Abstract contains this function:

PHP:
    /**
    * Checks that the board is currently active (and can be viewed by the visitor)
    * or throws an exception.
    *
    * @param string $action
    */
    protected function _assertBoardActive($action)
    {
        $options = XenForo_Application::get('options');
        if (!$options->boardActive && !XenForo_Visitor::getInstance()->get('is_admin'))
        {
            throw $this->responseException($this->responseMessage($options->boardInactiveMessage), 503);
        }
    }

With that in mind you should be able to overwrite the function in your own controller. To have something completely ignore the _assertBoardActive check, simply return true:

PHP:
    protected function _assertBoardActive($action)
    {
        return true;
    }

Of course, as the $action parameter is passed to the function, so you can actually do it on a per action basis.
 
Top Bottom