public function actionView()
 {
     $id = Yii::app()->request->getParam('id', 0);
     $topContent = TopContentModel::model()->findByPk($id);
     if (!$topContent) {
         $this->forward("/site/error", true);
     }
     if ($topContent->type == 'album') {
         $content = AlbumModel::model()->findByPk($topContent->content_id);
     } elseif ($topContent->type == 'video_playlist') {
         $content = WapVideoPlaylistModel::model()->published()->with('video_playlist_artist')->findByPk($topContent->content_id);
     }
     if (!$content || $content->status != 1) {
         $this->forward("/site/error", true);
     }
     $this->render('view', compact('topContent', 'content'));
 }
Exemple #2
0
            $count = 0;
        }
        if ($count > 0 && $item['id'] != 0) {
            $link = Yii::app()->createUrl("topContent/view", array("id" => $item['id'], "title" => Common::makeFriendlyUrl($item['name'])));
            ?>
                    <?php 
            if (isset($item)) {
                ?>

                    <li>
                        <a href="<?php 
                echo $link;
                ?>
" class="a-top top-content-img">
                            <img \="" src="<?php 
                echo TopContentModel::model()->getAvatarUrl($item['id']);
                ?>
">
                            <div class="hotlist-gradient"></div>
                            <div>
                                <p title="<?php 
                echo CHtml::encode($item['name']);
                ?>
" href="<?php 
                echo $link;
                ?>
" class="top-content-name"><?php 
                echo $item['name'];
                ?>
</p>
                            </div>