Exemple #1
0
    public function actionIndex() {
        $response = parent::actionIndex();

        if ($response instanceof XenForo_ControllerResponse_View) {
            $xfRecentStatus = RCBD_RecentStatus_Model_StatusList::getStatusArray();
        }

        $response->params += array('xfRecentStatus' => $xfRecentStatus['status']);
        $response->params += array('xfRecentStatusComments' => $xfRecentStatus['comments']);
        return $response;
    }
    public static function templateHook($name, &$contents, array $params, XenForo_Template_Abstract $template) {
        // Choose the hook you want to manipulate
        if ($name === 'forum_list_sidebar') {
            // Change the value of $contents in any way you want
            $xfRecentStatus = RCBD_RecentStatus_Model_StatusList::getStatusArray();
            $params = array('xfRecentStatus' => $xfRecentStatus['status'],
                'xfRecentStatusComments' => $xfRecentStatus['comments'],
                'visitor' => XenForo_Visitor::getInstance(),
            );

            $contents .= $template->create('RCBD_recent_status', $params)->render();
        }
    }