public function actionView()
 {
     $radioId = Yii::app()->request->getParam("id", 0);
     $radioName = WapRadioModel::model()->findByPk($radioId)->name;
     $albumId = WapRadioModel::model()->getAlbumByRadio($radioId, "c2.id");
     $radioAvatar = RadioModel::model()->getAvatarUrl($radioId, 's1');
     $album = WapAlbumModel::model()->published()->findByPk($albumId);
     if (!$album) {
         $this->forward("/site/error", true);
     }
     $songsOfAlbum = WapSongModel::model()->getSongsOfAlbum($albumId);
     $artists = AlbumArtistModel::model()->getArtistsByAlbum($albumId);
     $phone = yii::app()->user->getState('msisdn');
     $errorCode = 'success';
     $errorDescription = '';
     $registerText = WapAlbumModel::model()->getCustomMetaData('REG_TEXT');
     ///meta tag
     $AlbumDetail = AlbumModel::model()->findByPk($albumId);
     $artistId = !empty($artists) ? $artists[0]->artist_id : $AlbumDetail->artist_id;
     $ArtistInfo = ArtistModel::model()->findByPk($artistId);
     $this->itemName = $AlbumDetail->name;
     $this->artist = $ArtistInfo->name;
     $this->thumb = AlbumModel::model()->getAvatarUrl($albumId, 's1');
     $this->url = URLHelper::buildFriendlyURL("album", $albumId, Common::makeFriendlyUrl($ArtistInfo->name));
     $this->description = strip_tags($AlbumDetail->description);
     //get other radio
     $parent_id = Yii::app()->params['horoscope']['parent_id'];
     $radioListOther = WapRadioModel::model()->getHoroscopes($parent_id);
     $this->render('detail', array('album' => $album, 'songsOfAlbum' => $songsOfAlbum, 'errorCode' => $errorCode, 'errorDescription' => $errorDescription, 'registerText' => $registerText, 'radioListOther' => $radioListOther, 'radioAvatar' => $radioAvatar));
 }
Exemple #2
0
 public function index()
 {
     //header('content-type:text/html;charset=utf-8');
     $userId = $_SESSION['qq']['userId'];
     $collect = new CollectModel();
     //查询收藏
     $user_collect = $collect->getCollectByuserId($userId);
     $article = new ArticleModel();
     $arr = array();
     foreach ($user_collect as $v) {
         //根据收藏的文章id查询文章
         $a = $article->getArticleById($v['articleId']);
         //取出admin的昵称
         $a['adminName'] = $this->getAdmin($a['adminId']);
         $arr[] = $a;
     }
     $comment = new CommentModel();
     $commentAlbum = $comment->getCommentByAlbum($userId);
     $album = new AlbumModel();
     $articles = array();
     $albums = array();
     foreach ($commentAlbum as $v) {
         if ($v['albumId'] != null) {
             $c = $album->getAlbumById($v['albumId']);
             $c['adminName'] = $this->getAdmin($v['adminId']);
             $albums[] = $c;
         }
     }
     $commentArticle = $comment->getCommentByArticle($userId);
     foreach ($commentArticle as $v) {
         if ($v['articleId'] != null) {
             $a = $article->getArticleById($v['articleId']);
             $a['adminName'] = $this->getAdmin($v['adminId']);
             $articles[] = $a;
         }
     }
     var_dump($albums);
     $this->assign('user', $_SESSION['qq']['userName']);
     //评论过的相册
     $this->assign('albums', $albums);
     //评论过的文章
     $this->assign('articles', $articles);
     //收藏
     $this->assign('user_collect', $arr);
     $this->display();
 }
 public function run()
 {
     $user_id = intval(Input::get('user_id', 0));
     $user = UserORM::find($user_id);
     if (empty($user)) {
         return '用户未找到';
     }
     $sql = "SELECT a.*, al.source FROM album as a LEFT JOIN album_source as al ON al.album_id = a.id WHERE a.user_id = " . $user_id . " AND al.is_front = " . BaseORM::ENABLE . "  ORDER BY a.id DESC";
     $results = DB::select(DB::raw($sql));
     return AlbumModel::listData($results);
 }
 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'));
 }
 public function init()
 {
     $assets = dirname(__FILE__) . '/assets';
     $this->assetsPath = Yii::app()->assetManager->publish($assets, false, 1, YII_DEBUG);
     $cs = Yii::app()->clientScript;
     $cs->registerCssFile($this->assetsPath . '/css/stylejwp.css');
     $cs->registerScriptFile($this->assetsPath . '/jwplayer.js');
     $album = AlbumModel::model()->findByPk($this->albumId);
     $this->albumObject = $album;
     $this->data = AlbumModel::model()->builDataPlayerAlbum($this->albumId, $this->cached);
     if (!empty($this->data)) {
         $playlistIndex = AlbumModel::model()->getDataIndexAlbum();
         $indexPl = json_decode($this->data);
         $cs->registerScript('play_album_touch' . $this->id, "\n            jwplayer('" . $this->id . "').setup({\n                width: '100%',\n                height: 35,\n                playlist: " . $this->data . ",\n                skin: '" . $this->assetsPath . "/vega-skin-album-min-2.xml',\n                autostart: '" . $this->autostart . "',\n                primary: '" . $this->primary . "'\n            });", CClientScript::POS_END);
         $cs->registerScript('play_album_touch_option' . $this->id, "\n            jwplayer().onReady(function() {\n                var state = jwplayer().getState();\n                if(state=='IDLE'){\n                    \$('#play').show();\n                    \$('#pause').hide();\n                }\n                jwplayer().setVolume(100);\n            });\n            var isShuffle = false;\n            var currentId = 0;\n            jwplayer().onPlaylistItem(function() {\n                //logSongFlag = true;\n                var currentItem = jwplayer().getPlaylistItem();\n                currentId = currentItem['mediaid'];\n                //\$('#vg-player li').removeClass('active');\n                //\$('#vg-player-item-'+currentItem['mediaid']).addClass('active');\n                \$('#item-title').html(currentItem['title']);\n            });\n\n            jwplayer().onPlay(function(){\n                var state = jwplayer().getState();\n                if(state=='PLAYING'){\n                    \$('#play').hide();\n                    \$('#pause').show();\n                }else{\n                    \$('#play').show();\n                    \$('#pause').hide();\n\n                }\n            });\n\n                \$('#play').click(function(){\n                    jwplayer().play();\n                    \$('#play').hide();\n                    \$('#pause').show();\n                });\n\n                \$('#pause').click(function(){\n                    jwplayer().pause();\n                    \$('#play').show();\n                    \$('#pause').hide();\n                });\n\n                \$('#next').click(function(){\n                    var state = jwplayer().getState();\n                    var curentIndex = jwplayer().getPlaylistIndex();\n                    var totalItem = jwplayer().getPlaylist().length;\n                    if(curentIndex<totalItem){\n                        nextItem = curentIndex+1;\n                    }else{\n                        nextItem = 0;\n                    }\n                    if(isShuffle){\n                        nextItem = randomItem();\n                    }\n                    jwplayer().playlistItem(nextItem);\n\n                    return false;\n                })\n\n                \$('#prev').click(function(){\n                    var state = jwplayer().getState();\n                    var curentIndex = jwplayer().getPlaylistIndex();\n                    var totalItem = jwplayer().getPlaylist().length;\n                    if(curentIndex <= 0){\n                        nextItem = totalItem-1;\n                    }else{\n                        nextItem = curentIndex-1;\n                    }\n                    jwplayer().playlistItem(nextItem);\n                    return false;\n                })\n\n                \$('#repeat').click(function(){\n                    \$('#repeat').hide();\n                    \$('#playone').show();\n                    jwplayer().setRepeat();\n                    return false;\n                })\n                \$('#playone').click(function(){\n                    \$('#repeat').show();\n                    \$('#playone').hide();\n                    jwplayer().setRepeat();\n                    return false;\n                })\n\n                \$('#sequence').click(function(){\n                    isShuffle = true;\n                    \$('#sequence').hide();\n                    \$('#shuffle').show();\n                    jwplayer().setShuffle();\n                    return false;\n                })\n                \$('#shuffle').click(function(){\n                    isShuffle = false;\n                    \$('#sequence').show();\n                    \$('#shuffle').hide();\n                    jwplayer().setShuffle();\n                    return false;\n                })\n                function randomItem(){\n                    var playlist = jwplayer().getPlaylist();\n                    var playlistsize = playlist.length;\n                    var randomnumber=Math.floor(Math.random()*playlistsize)\n                    return randomnumber;\n                };\n                ", CClientScript::POS_END);
         $cs->registerScript('play_album_this' . $this->id, "\n            function playThis(index) {\n\t\t\t\t\tjwplayer().playlistItem(index);\n            };", CClientScript::POS_END);
         $cs->registerScript('play_album_getlyrics' . $this->id, "\n            function getLyrics() {\n\t\t\t\t\tvar currentItem = jwplayer().getPlaylistItem();\n                    itemId = currentItem.mediaid;\n                    Popup.title_popup='Lời bài hát';\n                    var lyrics = \$('#lyrics-'+itemId).html();\n                    lyrics = (lyrics=='') ? 'Lời bài hát đang được cập nhật!' : lyrics;\n                    Popup.alert(lyrics);\n            };", CClientScript::POS_END);
         $deviceType = 'mobile';
         $cs->registerScript('play_album_current' . $this->id, "\n                var device_type = '" . $deviceType . "';\n                var listPlayed =Array();\n                var logPlayAlbumFlag = true;\n                var logSongFlag = true;\n                    jwplayer().onBeforePlay(function() {\n                        var currentItem = jwplayer().getPlaylistItem();\n                        itemId = currentItem.mediaid;\n                        \$('.nhacvnplayer ul li.item').removeClass('onpause');\n                        \$('.nhacvnplayer ul li.item').removeClass('playing');\n                        \$('.nhacvnplayer #song_'+itemId).addClass('playing');\n                    });\n                    jwplayer().onPause(function(){\n                        var currentItem = jwplayer().getPlaylistItem();\n                        itemId = currentItem.mediaid;\n                        \$('.nhacvnplayer ul li.item').removeClass('playing');\n                        \$('.nhacvnplayer #song_'+itemId).addClass('onpause');\n                    });\n\t\t\t\t\tjwplayer().onPlaylistItem(function() {\n\t\t\t\t\t    logSongFlag = true;\n                        var currentItem = jwplayer().getPlaylistItem();\n                        itemId = currentItem.mediaid;\n                        //\$('.nhacvnplayer ul li.item').removeClass('playing');\n                        //\$('.nhacvnplayer #song_'+itemId).addClass('playing');\n                        hashdis = new Hashids(has_key);\n                        id = hashdis.encode(parseInt(itemId));\n                        songId = 'so'+id;\n\t                    history.replaceState({}, '', '?st='+songId);\n                    })\n                    //log and track\n                    jwplayer().onTime(function(event) {\n                    if(Math.round(event.position) >=5){\n                        if(logPlayAlbumFlag) {\n                            logPlayAlbumFlag = false;\n                            var action = 'Play Album';\n                            if(in_array_item(listPlayed,'album_'+" . $album->id . ")){\n                                var action = 'Replay Album';\n                            }\n                            var item = 'album_" . $album->id . "';\n                            if(!in_array_item(listPlayed,item)){\n                                listPlayed.push(item);\n                            }\n                            //console.log(device_type+'-'+action);\n                            ga('send', 'event', device_type, action,'" . CHtml::encode($album->name . "-" . $album->artist_name . "-" . $album->id) . "');\n                            ajax_load('/player/logAlbum',{'id':" . $album->id . "});\n                        }\n                        if(logSongFlag){\n                            logSongFlag = false;\n                            var currentItem = jwplayer().getPlaylistItem();\n                            itemId = currentItem.mediaid;\n                            itemTitle = currentItem.media_title;\n                            itemDesc = currentItem.media_desc;\n                            var action = 'Play Song';\n\t\t\t\t\t\t\tif(in_array_item(listPlayed,'song_'+itemId)){\n\t\t\t\t\t\t\t\tvar action = 'Replay Song';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar item = 'song_'+itemId;\n                            if(!in_array_item(listPlayed,item)){\n                                listPlayed.push(item);\n                            }\n                            //console.log(device_type+'-'+action+'|'+itemId+'|'+itemTitle+'|'+itemDesc);\n\t\t\t\t\t\t\tga('send', 'event', device_type, action, itemTitle+'-'+itemDesc+'-'+itemId);\n\t\t\t\t\t\t\tajax_load('/player/logSong',{'id':itemId});\n                        }\n                    }\n\n\t\t\t    })", CClientScript::POS_END);
         if (isset($_GET['st']) && !empty($_GET['st'])) {
             $st = $_GET['st'];
             if (!is_numeric($st)) {
                 $hashStrId = substr($st, 2);
                 $hashids = new Hashids(Yii::app()->params["hash_url"]);
                 $parse = $hashids->decode($hashStrId);
                 $songId = $parse[0];
                 $index = isset($playlistIndex[$songId]) ? $playlistIndex[$songId] : 0;
             } else {
                 $index = (int) ($st - 1);
             }
             if ($index >= 0) {
                 $cs->registerScript('play_album_st' . $this->id, "\n                        var isFirst = true;\n                        jwplayer().playlistItem(" . $index . ");\n                        jwplayer().onQualityLevels(function(event){\n                            if(isFirst){\n                                isFirst=false;\n                                \$('.nhacvnplayer ul li.item').removeClass('playing');\n                                \$('.nhacvnplayer #playlist li.song-item-" . $index . "').addClass('onpause');\n                            }\n                        });\n                        ", CClientScript::POS_END);
             }
         }
     }
     parent::init();
 }
Exemple #6
0
 public function AlbumAction($edit = false, $filter = array(), $album_id = null)
 {
     $this->BaseSiteData();
     $request_user_id = (int) Project::getUser()->getShowedUser()->id;
     $user_id = (int) Project::getUser()->getDbUser()->id;
     $album_id = (int) $album_id > 0 ? $album_id : (int) Project::getRequest()->getKeyByNumber(0);
     $info = array();
     if ($request_user_id === $user_id && $edit === true) {
         $info['can_edit'] = true;
         $info['access_list'] = HelpFunctions::getAccessList();
     }
     if ((int) Project::getUser()->getShowedUser()->id <= 0) {
         $tabs = TabController::getMainAlbumTabs(false, false, true);
     } else {
         //	$tabs = TabController::getOwnTabs(false, true);
         $tabs = TabController::getOwnTabs(false, false, true);
     }
     $info['tab_list'] = $tabs;
     $album_model = new AlbumModel();
     $album_model->load($album_id);
     $info['thumbnail_id'] = (int) $album_model->thumbnail_id;
     $this->BaseAlbumData($info, $album_id);
     $photo_model = new PhotoModel();
     $photo_model->filter = $filter;
     $pager = new DbPager(Project::getRequest()->getKeyByNumber(1), $this->getParam('photo_per_page', self::DEFAULT_PHOTO_PER_PAGE));
     $photo_model->setPager($pager);
     $list = $photo_model->loadByAlbumUser($request_user_id, $album_id);
     $this->checkImages($list);
     $info['photo_list'] = $list;
     $info['list_pager'] = $photo_model->getPager();
     $info['list_controller'] = 'Photo';
     $info['list_action'] = 'Album';
     $info['list_user'] = null;
     $info['user_id'] = $user_id;
     $this->_view->assign('current_album_name', $album_model->name);
     $this->_view->PhotoList($info);
     $this->_view->parse();
 }
 public function __construct()
 {
     parent::__construct();
 }
Exemple #8
0
 public function addalbumComment()
 {
     if (!$_SESSION['qq']) {
         $result['code'] = '021';
         $result['message'] = '未登录,请登录账号!';
     } else {
         //实例化model
         $commentModel = new CommentModel();
         $albumModel = new AlbumModel();
         $albumId = $_GET['albumId'];
         $content = $_GET['comment'];
         //根据相册id查询相册信息
         $albumInfo = $albumModel->getAlbumById($albumId);
         $data = array('userId' => $_SESSION['qq']['userId'], 'albumId' => $albumId, 'content' => $content, 'adminId' => $albumInfo['adminId']);
         $commentId = $commentModel->addComment($data);
         if ($commentId) {
             $commentInfo = $commentModel->getCommentById($commentId);
             $result['code'] = '0';
             $result['message'] = '恭喜,评论成功!';
             $result['info'] = $commentInfo;
         } else {
             $result['code'] = '022';
             $result['message'] = '抱歉,评论失败!';
         }
     }
     echo json_encode($result);
     exit;
 }
Exemple #9
0
 protected function BaseAlbumData(&$info, $album_id, $album_list = false)
 {
     $request_user_id = (int) Project::getUser()->getShowedUser()->id;
     $user_id = (int) Project::getUser()->getDbUser()->id;
     if (Project::getUser()->isMyArea()) {
         $v = new AlbumView();
         $v->ControlPanel();
         $info['control_panel'] = $v->parse();
     } else {
         $info['control_panel'] = null;
     }
     if ($request_user_id > 0) {
         //	$info['tab_list'] = TabController::getOwnTabs(false, true);
         $info['tab_list'] = TabController::getOwnTabs(false, false, true);
     }
     $tmp = array();
     $album_model = new AlbumModel();
     $tmp['album_menu_list'] = $album_model->loadByUser($request_user_id, $user_id);
     $tmp['album_id'] = $album_id;
     if (Project::getUser()->isMyArea()) {
         $tmp['album_owner'] = true;
     }
     $v = new AlbumView();
     $v->AlbumMenu($tmp);
     $info['album_menu'] = $v->parse();
     if ($album_list !== false) {
         $info[$album_list] = $tmp['album_menu_list'];
     }
 }
 public function actionLogAlbum()
 {
     $id = Yii::app()->request->getParam('id');
     $album = AlbumModel::model()->findByPk($id);
     if (!Yii::app()->user->isGuest) {
         $activity = new UserActivityModel();
         $activity->channel = 'wap';
         $activity->user_id = Yii::app()->user->getId();
         $activity->user_phone = Yii::app()->user->getState('phone');
         $activity->loged_time = date('Y-m-d H:i:s');
         $activity->activity = 'play_album';
         $activity->obj1_id = $album->id;
         $activity->obj1_name = $album->name;
         $activity->obj1_url_key = $album->url_key;
         $activity->obj2_id = $album->artist_id;
         $activity->obj2_name = $album->artist_name;
         $ret = $activity->save();
         if ($ret) {
             echo "1";
         } else {
             echo CHtml::errorSummary($activity);
         }
         Yii::app()->end();
     }
     echo '';
     Yii::app()->end();
 }
Exemple #11
0
 public function photoUpdate()
 {
     $albumId = $_GET['albumId'];
     $photo = new PhotosModel();
     $photos = $photo->getPhotos($albumId);
     $album = new AlbumModel();
     $albums = $album->getAlbumById($albumId);
     //var_dump($_POST);
     if ($_POST) {
         $arr = array();
         foreach ($_POST['photo_description'] as $k => $v) {
             $newk = trim($k, "'");
             //echo $newk;
             $arr['fileName'] = $newk;
             $arr['description'] = $v;
             $data = $photo->getPhotosByFileName($newk);
             //var_dump($arr);
             if (!empty($data)) {
                 $row = $photo->updatePhotos($data['photoId'], $arr);
             } else {
                 $arr['fileName'] = '/asset/upload/' . $arr['fileName'];
                 $arr['albumId'] = $albumId;
                 $row = $photo->addPhotos($arr);
             }
             //$this->row=$row;
         }
         //var_dump($_POST);
         $update = array();
         $update['albumName'] = $_POST['albumName'];
         $update['description'] = $_POST['description'];
         if (isset($_POST['frontCover']) && !empty($_POST['frontCover'])) {
             $update['frontCover'] = $_POST['frontCover'];
         }
         //var_dump($update);
         $rows = $album->updateAlbum($albumId, $update);
         S('相册修改成功');
     }
     $album_photos = array();
     foreach ($photos as $v) {
         if ($albums['frontCover'] == $v['fileName']) {
             $v['frontCover'] = 1;
         } else {
             $v['frontCover'] = 0;
         }
         $album_photos[] = $v;
     }
     //相册的信息
     $this->assign('albums', $albums);
     //该相册下的所有图片
     $this->assign('photos', $album_photos);
     $this->display();
 }
 /**
  * function actionView
  * call to render detail album page
  */
 public function actionView()
 {
     $albumId = (int) Yii::app()->request->getParam('id');
     $album = WapAlbumModel::model()->available()->findByPk($albumId);
     if (!$album) {
         $this->forward("/site/error", true);
     } else {
         if ($album->status == 0) {
             $deactive = true;
         }
     }
     $songsOfAlbum = WapSongModel::model()->getSongsOfAlbum($albumId);
     //samge artist
     $countAlbumsSameArtist = WapAlbumModel::model()->countAlbumsSameArtist($album->id, $album->artist_id);
     $albumPages = new CPagination($countAlbumsSameArtist);
     $pageSize = Yii::app()->params['pageSize'];
     $albumPages->setPageSize($pageSize);
     $currentPage = $albumPages->getCurrentPage();
     /* NEW */
     $artists = AlbumArtistModel::model()->getArtistsByAlbum($albumId);
     $artistIds = '';
     if ($artists) {
         foreach ($artists as $artist) {
             $artistIds .= ',' . $artist->artist_id;
         }
     }
     $artistIds = $artistIds != '' ? substr($artistIds, 1) : '';
     $albumsSameArtist = WapAlbumModel::model()->getAlbumbyArtists($artistIds, $pageSize, $currentPage * $pageSize);
     /* END */
     $phone = yii::app()->user->getState('msisdn');
     $errorCode = 'success';
     $errorDescription = '';
     //for show price
     $favourite = Yii::app()->request->getParam('favourite', null);
     $phone = yii::app()->user->getState('msisdn');
     $user_id = Yii::app()->user->id;
     if (isset($favourite) && $favourite == 0) {
         if (!empty($user_id)) {
             $res = WapFavouriteAlbumModel::model()->deleteAllByAttributes(array('msisdn' => $phone, 'album_id' => $albumId));
         } else {
             $this->redirect($this->createUrl("/account/login"));
         }
     }
     if (isset($favourite) && $favourite == 1) {
         if (!empty($phone)) {
             $res = WapFavouriteAlbumModel::model()->favouriteAlbum($phone, $albumId);
         } else {
             $this->redirect($this->createUrl("/account/login"));
         }
     }
     $like = null;
     if ($phone) {
         $like = FavouriteAlbumModel::model()->findByAttributes(array('album_id' => $albumId, 'msisdn' => $phone));
     }
     $userType = "GUEST";
     $phone = Yii::app()->user->getState('phone');
     if ($phone) {
         $userType = "MEMBER";
     }
     $userSub = Yii::app()->user->getState('userSub');
     $packageCode = Yii::app()->user->getState('packageCode');
     if ($userSub) {
         $userType = "SUB_" . $packageCode;
     }
     $perLimit = ContentLimitModel::getPermision($albumId, "album", $userType, "WAP");
     ///meta tag
     $AlbumDetail = AlbumModel::model()->findByPk($albumId);
     $artistId = !empty($artists) ? $artists[0]->artist_id : $AlbumDetail->artist_id;
     $ArtistInfo = ArtistModel::model()->findByPk($artistId);
     $this->itemName = $AlbumDetail->name;
     $this->artist = $ArtistInfo->name;
     $this->thumb = AlbumModel::model()->getAvatarUrl($albumId, 's1');
     $this->url = URLHelper::buildFriendlyURL("album", $albumId, Common::makeFriendlyUrl($ArtistInfo->name));
     $this->description = strip_tags($AlbumDetail->description);
     $this->render('view', array('album' => $album, 'songsOfAlbum' => $songsOfAlbum, 'albumsSameArtist' => $albumsSameArtist, 'albumPages' => $albumPages, 'errorCode' => $errorCode, 'errorDescription' => $errorDescription, 'userSub' => $userSub, 'like' => $like, 'perLimit' => $perLimit, 'deactive' => $deactive));
 }
Exemple #13
0
    function viewAlbumPage($user_id)
    {
        $htmlPage = "";
        $user_id = (int) $user_id;
        $albumModel = new AlbumModel();
        $aAlbums = $albumModel->loadAll(0, 0);
        $htmlPage = '<ul class="foto-preview-list clearfix">';
        foreach ($aAlbums as $key => $item) {
            $dir = '/users/' . $item['login'] . '/album' . '/thumbs/';
            $imgSrc = !$item['thumbnail'] ? $this->image_url . 'noimage.gif' : $dir . $item['thumbnail'];
            $htmlPage .= '<li>
							<dl>
								<dt><a href="' . PhotoController::getAlbumUrl($item['id'], $item['login']) . '"><img src="' . $imgSrc . '" alt="" /></a></dt>
								<dd class="auth"><a href="' . UserController::getProfileUrl($item['login']) . '" class="with-icon-s"><i class="icon-s user-icon"></i>' . $item['login'] . '</a></dd>
								<dd><a href="' . PhotoController::getAlbumUrl($item['id'], $item['login']) . '" class="with-icon-s"><i class="icon-s category-icon"></i>' . $item['name'] . '</a> (14)</dd>
							</dl>
						</li>';
            /*     $htmlPage .= '
                            <div class="photo_gallery">
            				<div class="block_ee1" style="width: 170px;"><div class="block_ee2"><div class="block_ee3"><div class="block_ee4">
            					<div class="block_title">
                                    <h2><a href="'.PhotoController::getAlbumUrl($item['id'], $item['login']).'">'.$item['name'].'</a></h2>
            					</div>
            					<div style="width: 140px; height: 112px; text-align: center;">
                                    <a href="'.PhotoController::getAlbumUrl($item['id'], $item['login']).'"><img src="'.$imgSrc.'" /></a>
            					</div>
            					<div class="block_title2">
                                    <a href="'.UserController::getProfileUrl($item['login']).'">'.$item['login'].'</a><br />
            						<span id="micro">'.date("j F Y", strtotime($item['creation_date'])).'</span>
            					</div>
            				</div></div></div></div>
            				</div>
                        '; */
        }
        $htmlPage .= '</ul>';
        return $htmlPage;
    }
Exemple #14
0
 public function albumInfo()
 {
     $blogerId = Data::get($_GET['blogerId'], Data::Int);
     $albumId = Data::get($_GET['albumId'], Data::Int);
     if (!is_int($blogerId) && $blogerId <= 0) {
         R('Index', 'index');
     }
     if (!is_int($albumId) && $albumId <= 0) {
         R('Index', 'index');
     }
     // $blogerId=$_GET['blogerId'];
     // $albumId=$_GET['albumId'];
     $album = new AlbumModel();
     $albums = $album->getAlbumById($albumId);
     $photo = new PhotosModel();
     $photos = $photo->getPhotos($albumId);
     $time = 0;
     foreach ($photos as $v) {
         $addtime = strtotime($v['addTime']);
         if ($time < $addtime) {
             $time = $addtime;
         }
     }
     $time = date("Y-m-d H:i:s", $time);
     $photoCount = $photo->getPhotosCountByAlbumId($albumId);
     $comment = new CommentModel();
     $a = $comment->getCommentByAlbumId($albumId);
     $user = new UserModel();
     $comments = array();
     foreach ($a as $v) {
         $users = $v;
         $users['user'] = $user->getUserById($v['userId']);
         $comments[] = $users;
     }
     //博主个人信息
     $blogerInfo = $this->getBlogerInfo($blogerId);
     $this->assign('blogerInfo', $blogerInfo);
     //某博主信息
     $count = $this->articleCount($blogerId);
     $this->assign('count', $count);
     //某博主文章总数
     //获取所有文章标签
     $allTags = $this->getAllTags();
     $this->assign("allTags", $allTags);
     //所有文章标签
     //获取所有文章分类
     $allTypes = $this->getAllTypes($blogerId);
     $this->assign("allTypes", $allTypes);
     //某人所有文章分类
     $latestComments = $this->getLatestComments($blogerId, '0,3');
     $this->assign('latestComments', $latestComments);
     //最新三条评论
     //用户个人信息
     $allUserInfo = $this->getAllUserInfo();
     $this->assign('allUserInfo', $allUserInfo);
     //某用户信息
     //该相册下的所有评论
     $this->assign('comments', $comments);
     //该相册下的所有相片
     $this->assign('photos', $photos);
     //相片最后的添加时间
     $this->assign('time', $time);
     //相册的相片数
     $this->assign('photoCount', $photoCount);
     //相册的部分信息
     $this->assign('album', $albums);
     $this->display();
 }
Exemple #15
0
?>
">
    <div class="head-label clearfix">
        <span class="text">Chủ đề âm nhạc</span>
        <span class="title"></span>
    </div><!-- End .head-label -->
</a>
<?php 
if ($topContent) {
    ?>
    <div class="box_content">
        <ul class="collection_list items-list">
            <?php 
    foreach ($topContent as $item) {
        if (isset($item) && $item['type'] == 'album') {
            $albumInfo = AlbumModel::model()->findByPk($item['content_id']);
            $artist_name = $albumInfo->artist_name;
            $count = $albumInfo ? count($albumInfo->song_count) : 0;
        } elseif (isset($item) && $item['type'] == 'video_playlist') {
            $videoPlaylist = VideoPlaylistModel::model()->findByPk($item['content_id']);
            $artist_name = $videoPlaylist->artist_name;
            $count = $videoPlaylist ? count($videoPlaylist->video_playlist_videos) : 0;
        } else {
            $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)) {
                ?>