示例#1
0
 public function actionIndex()
 {
     $callBack = (int) Yii::app()->request->getParam('call_back', 0);
     $page = (int) Yii::app()->request->getParam('page', 1);
     $limit = Yii::app()->params['numberPerPage'];
     $pageSize = Yii::app()->params['pageSize'];
     $c = CHtml::encode(Yii::app()->request->getParam('genre', 'VN'));
     $s = CHtml::encode(Yii::app()->request->getParam('type', 'SONG'));
     $s = strtoupper($s);
     $callBackLink = Yii::app()->createUrl("bxh/index", array('type' => $c, 's' => $s));
     if ($c == 'VN' || $c == 0) {
         $cTitle = Yii::t("wap", "Việt Nam");
     }
     if ($c == 'EUR') {
         $cTitle = Yii::t("wap", "Âu Mỹ");
     }
     if ($c == 'KOR') {
         $cTitle = Yii::t("wap", "Châu Á");
     }
     $sTitle = $s == 'SONG' ? Yii::t("wap", "Song") : $s;
     $options = array();
     $ccType = 'bxh';
     $collection = CollectionModel::model()->getCollectionByType($s, $ccType, $c, 0);
     $contentCode = $collection[0]->code;
     $count = WapSongModel::countListByCollection($contentCode);
     $topWeek = MainContentModel::getListByCollection($contentCode, $page, $limit);
     $options['col'] = $contentCode;
     $pager = new CPagination($count);
     $pager->setPageSize($limit);
     $type_name = strtolower($s);
     $ajaxview = "_ajax" . $type_name . "List";
     if ($callBack) {
         $this->layout = false;
         $this->render($ajaxview, compact('topWeek', 'pager', 'callBackLink', 'limit', 'options'));
     } else {
         $this->render('index', array('topWeek' => $topWeek, 's' => $s, 'c' => $c, 'cTitle' => $cTitle, 'sTitle' => $sTitle, 'pager' => $pager, 'callBackLink' => $callBackLink, 'options' => $options));
     }
 }
示例#2
0
<div class="page-404">
	<?php 
$albums = MainContentModel::getListByCollection('ALBUM_HOT', 0, 4);
?>
	<p class="img-404">
		<img src="/touch/images/404.png"/>
	</p>
	<ul class="album_list items-list pt30">
		<?php 
$i = 0;
foreach ($albums as $key => $album) {
    $artist_name = ArtistHelper::ArtistNamesByAlbum($album['id']);
    $i++;
    $albumLink = yii::app()->createUrl('album/view', array('id' => $album['id'], 'url_key' => Common::makeFriendlyUrl($album['name']), "artist" => Common::makeFriendlyUrl(trim($album['artist_name']))));
    if ($album['id']) {
        $avatarImage = CHtml::image(WapAlbumModel::model()->getThumbnailUrl(100, $album['id']), 'avatar', array('class' => 'avatar'));
    } else {
        $avatarImage = CHtml::image('/images/icon/clip-50.png', '', array('class' => 'avatar'));
    }
    ?>
			<li class="item <?php 
    if ($i == count($albums)) {
        echo 'last_item';
    }
    ?>
">
				<a href="<?php 
    echo $albumLink;
    ?>
">
					<?php 
示例#3
0
 function videoplaylistbox()
 {
     $type = Yii::app()->request->getParam('_type', 'hot');
     $limit = Yii::app()->request->getParam('limit', 20);
     if ($type == 'hot') {
         $items = MainContentModel::getListByCollection('VIDEO_PLAYLIST_HOT', 1, $limit);
     } else {
         $items = MainContentModel::getListByCollection('VIDEO_PLAYLIST_NEW', 1, $limit);
     }
     $this->renderPartial("_videoplaylistbox", compact('items', 'type'));
 }