public function actionForum($cid = null, $id = null, $slug = null, $toggle = null)
    {
        $filters = Yii::$app->session->get('forum-filters');
        if (in_array(strtolower($toggle), ['new', 'edit', 'hot', 'pin', 'lock', 'all'])) {
            if (strtolower($toggle) == 'all') {
                $filters = null;
            } else {
                $filters[strtolower($toggle)] = empty($filters[strtolower($toggle)]) || $filters[strtolower($toggle)] == 0 ? 1 : 0;
            }
            Yii::$app->session->set('forum-filters', $filters);
            return $this->redirect([
                'forum/forum',
                'cid' => $cid,
                'id' => $id,
                'slug' => $slug
            ]);
        }

        $forum = Forum::verify($cid, $id, $slug, $this->module->user->isGuest);
        if (empty($forum)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find the forum you are looking for.'));
            return $this->redirect(['forum/index']);
        }

        $this->setMetaTags(
            $forum->keywords ?: $forum->category->keywords,
            $forum->description ?: $forum->category->description
        );

        return $this->render('forum', [
            'model' => $forum,
            'filters' => $filters
        ]);
    }
public function actionForum($cid = null, $id = null, $slug = null, $toggle = null)
    {
        $filters = Yii::$app->session->get('forum-filters');
        if (in_array(strtolower($toggle), ['new', 'edit', 'hot', 'pin', 'lock', 'all'])) {
            if (strtolower($toggle) == 'all') {
                $filters = null;
            } else {
                $filters[strtolower($toggle)] = empty($filters[strtolower($toggle)]) || $filters[strtolower($toggle)] == 0 ? 1 : 0;
            }
            Yii::$app->session->set('forum-filters', $filters);
            return $this->redirect([
                'forum/forum',
                'cid' => $cid,
                'id' => $id,
                'slug' => $slug
            ]);
        }

        $forum = Forum::verify($cid, $id, $slug, $this->module->user->isGuest);
        if (empty($forum)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find the forum you are looking for.'));
            return $this->redirect(['forum/index']);
        }

        $this->setMetaTags(
            $forum->keywords ?: $forum->category->keywords,
            $forum->description ?: $forum->category->description
        );

        return $this->render('forum', [
            'model' => $forum,
            'filters' => $filters
        ]);
    }
public function actionForum ( $ cid = null , $ id = null , $ slug = null , $ toggle = null ) { $ filters = Yii :: $ app -> session -> get ( 'forum-filters' ) ; if ( in_array ( strtolower ( $ toggle ) , [ 'new' , 'edit' , 'hot' , 'pin' , 'lock' , 'all' ] ) ) { if ( strtolower ( $ toggle ) == 'all' ) { $ filters = null ; } else { $ filters [ strtolower ( $ toggle ) ] = empty ( $ filters [ strtolower ( $ toggle ) ] ) || $ filters [ strtolower ( $ toggle ) ] == 0 ? 1 : 0 ; } Yii :: $ app -> session -> set ( 'forum-filters' , $ filters ) ; return $ this -> redirect ( [ 'forum/forum' , 'cid' => $ cid , 'id' => $ id , 'slug' => $ slug ] ) ; } $ forum = Forum :: verify ( $ cid , $ id , $ slug , $ this -> module -> user -> isGuest ) ; if ( empty ( $ forum ) ) { $ this -> error ( Yii :: t ( 'podium/flash' , 'Sorry! We can not find the forum you are looking for.' ) ) ; return $ this -> redirect ( [ 'forum/index' ] ) ; } $ this -> setMetaTags ( $ forum -> keywords ? : $ forum -> category -> keywords , $ forum -> description ? : $ forum -> category -> description ) ; return $ this -> render ( 'forum' , [ 'model' => $ forum , 'filters' => $ filters ] ) ; }
Displaying the forum of given category ID, own ID and slug.
@param int $cid category ID
@param int $id forum ID
@param string $slug forum slug
@return string|Response
Displaying the forum of given category ID own ID and slug .