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)); }
public function __get($name) { if ($name == 'url_key') { $str = trim(parent::__get($name), "-"); $str = str_replace("--", "-", $str); if (strrpos($str, "-") === false) { $str = Common::makeFriendlyUrl(trim($str)); } return str_replace("'", "", $str); } return parent::__get($name); }
public static function ArtistsByAlbumForWapDetail($id) { $artists = AlbumArtistModel::model()->getArtistsByAlbum($id); $i = 0; $html = ""; foreach ($artists as $artist) { $html .= $i > 0 ? " - " : ""; $html .= '<a href="' . URLHelper::buildFriendlyURL("artist", $artist->artist_id, Common::makeFriendlyUrl($artist->artist_name)) . '">' . $artist->artist_name . '</a>'; $i++; } return $html; }
public function actionDetail() { $this->forward("/site/error", true); $new_id = (int) Yii::app()->request->getParam('id'); $from = Yii::app()->request->getParam('from', ''); $news = $detailnew = NewsModel::model()->findByPk($new_id); if (empty($news)) { $this->forward("/site/error", true); } $this->itemName = htmlspecialchars($detailnew->title); $this->keyword = $detailnew->title; $this->thumb = NewsModel::model()->getAvatarUrl($new_id, 's1'); $this->url = URLHelper::buildFriendlyURL("news", $detailnew ? $new_id : 0, Common::makeFriendlyUrl($detailnew->title ? $detailnew->title : " ")); $this->description = ""; if ($from == 'api') { $this->layout = false; } $this->render('detail', compact('news', 'from')); }
public function actionView() { $playlistId = Yii::app()->request->getParam('id'); $playlist = WapPlaylistModel::model()->published()->findByPk($playlistId); $user_msisdn = $playlist->msisdn; if (!$playlist) { $this->forward("/site/error", true); } $songsOfPlaylist = WapPlaylistModel::model()->getSongs($playlistId); //samge user $countPlSameUser = WapPlaylistModel::model()->countPlaylistByPhone($this->userPhone); $playlistPages = new CPagination($countPlSameUser); $pageSize = Yii::app()->params['pageSize']; $playlistPages->setPageSize($pageSize); $currentPage = $playlistPages->getCurrentPage(); $playlistsSameUser = WapPlaylistModel::model()->getSamePlaylistByPhone($playlist->id, $this->userPhone, $currentPage * $pageSize, $pageSize); $errorCode = 'success'; $errorDescription = ''; //for show price $checkPlay = WapUserTransactionModel::model()->checkCharging24h($this->userPhone, $this->userPhone, $playlistId, 'play_album'); $userSub = $this->userSub; //WapUserSubscribeModel::model()->getUserSubscribe($phone); if ($checkPlay) { $playPrice = 0; } else { if ($userSub) { $playPrice = 0; } } if ($checkPlay) { $playPrice = 0; } // $registerText = WapAlbumModel::model()->getCustomMetaData('REG_TEXT'); $this->itemName = $playlist->name; $this->artist = "Chacha"; //$playlist->username; $this->thumb = UserModel::model()->getThumbnailUrl('s1', $playlist->user_id); $this->url = URLHelper::buildFriendlyURL("playlist", $playlist->id, Common::makeFriendlyUrl($playlist->name)); $this->description = $playlist->name; $this->render('view', array('playlist' => $playlist, 'songsOfPlaylist' => $songsOfPlaylist, 'playlistsSameUser' => $playlistsSameUser, 'playlistPages' => $playlistPages, 'errorCode' => $errorCode, 'errorDescription' => $errorDescription, 'userSub' => $userSub, 'user_msisdn' => $user_msisdn)); }
public function actionDownload() { $this->layout = false; $contentId = (int) Yii::app()->request->getParam('id'); $type = Yii::app()->request->getParam('type', 'downloadSong'); $deviceId = yii::app()->session['deviceId']; $downloadUrl = ''; if ($type == 'downloadVideo') { $video = WapVideoModel::model()->findByPk($contentId); $downloadUrl = VideoModel::model()->getDownloadUrl($contentId, $deviceId, 'http', true); $contentType = 'video/mp4'; $fileName = $video->name; $fileName = Common::makeFriendlyUrl($fileName) . ".mp4"; } elseif ($type == 'downloadSong') { $song = WapSongModel::model()->findByPk($contentId); //$downloadUrl = WapSongModel::model()->getNiceDownloadUrl($song->id, $deviceId, 'http', $song->profile_ids, $song->url_key, $song->artist_name); //$downloadUrl = WapSongModel::model()->getAudioFileUrl($song->id, $deviceId, 'http', $song->profile_ids); $downloadUrl = WapSongModel::model()->getNiceDownloadUrl($song->id, $deviceId, 'http', $song->profile_ids, $song->url_key, $song->artist_name); echo '<meta http-equiv="refresh" content="0;url=' . $downloadUrl . '" />'; exit; $contentType = 'audio/mpeg'; $fileName = $song->name; $fileName = Common::makeFriendlyUrl($fileName) . ".mp3"; } echo '<meta http-equiv="refresh" content="0;url=' . $downloadUrl . '" />'; exit; //$this->redirect($downloadUrl); //Yii::app()->end(); //echo '<meta http-equiv="refresh" content="0;url='.$downloadUrl.'" />'; header("Cache-Control: public"); header("Content-Description: File Transfer"); header("Content-Disposition: attachment; filename=" . $fileName); header("Content-Type: {$contentType}"); header("Content-Transfer-Encoding: binary"); readfile($downloadUrl); //Yii::app()->end(); //Common::DownloadWithName($this->userPhone, $contentId, $type); exit; }
<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
foreach ($list_video as $item) { ?> <li class="item-video-playlist <?php echo $video->id == $item->id ? 'selected' : ''; ?> " id="video-item-<?php echo $i; ?> " rel="<?php echo $item->id; ?> "> <?php $playUrl = VideoModel::model()->getVideoFileUrl($item->id, $deviceId, 'rtsp', true); $videoPlaylistLink = Yii::app()->createUrl('videoPlaylist/view', array('id' => $content->id, 'url_key' => Common::makeFriendlyUrl($item['name']), 'video_id' => $item->id)); ?> <a data-toggle="modal" data-freeview="1" data-allowview="3" data-pricev="0" data-priced="0" data-id="39618" data-3g="0" data-hp="0" href="javascript:void(0)" class="thumb-link popup-modal"> <?php $avatarImage = CHtml::image(WapVideoModel::model()->getThumbnailUrl(100, $item['id']), 'avatar', array('class' => 'video-avatar', 'align' => 'left')); ?> <div class="thumb"> <?php echo $avatarImage; ?> </div> <h2><?php echo Formatter::smartCut(CHtml::encode($item['name']), Yii::app()->params['limit_substring_title'], 0); ?>
<p class="singer over-text"><a title="<?php echo CHtml::encode($album->artist_name); ?> " ><?php echo CHtml::encode($album->artist_name); ?> </a></p> </div> </div> <ul class="bxh_album_list song_detail_list mart20"> <?php foreach ($songs as $song) { $urlKey = Common::makeFriendlyUrl(trim($song->song->name)); $artist_name = Common::makeFriendlyUrl($song->artist_name); $link = Yii::app()->createUrl("song/view", array("id" => $song->song_id, "title" => $urlKey, 'artist' => $artist_name)); $artistLink = Yii::app()->createUrl("/search") . "?" . http_build_query(array("q" => CHtml::encode($song->song->artist_name))); $artistId = SongArtistModel::model()->findByAttributes(array('song_id' => $song->song->id))->artist_id; $image = AvatarHelper::getAvatar("artist", $artistId, 640); ?> <li> <a href="<?php echo $link; ?> "> <img src="<?php echo $image; ?> " alt="<?php echo CHtml::encode($song->song->artist_name);
public static function makeUrlGenre($object) { Yii::import("application.vendors.Hashids.*"); $hashids = new Hashids(Yii::app()->params["hash_url"]); $type = $object['type']; $name = $object['name']; $id = $object['id']; $gt = isset($object['gt']) ? $object['gt'] : ''; $suffix = 'gr'; $code = $hashids->encode($id); $code = $suffix . $code; $prefix = 'nhac-'; $urlKey = $prefix . Common::makeFriendlyUrl($name); if ($type == 'song') { $type = 'bai-hat'; } $params = array("action" => $type, "url_key" => $urlKey, "code" => $code); if (!empty($gt)) { if ($gt == 'new') { $gt = 'moi'; } $params['gt'] = $gt; } if (isset($object['other'])) { foreach ($object['other'] as $key => $ac) { $params[$key] = $ac; } } $link = Yii::app()->createAbsoluteUrl("site/url2", $params); return $link; }
<ul class="list_bxh ovh" style="border-bottom: none;"> <?php if ($data) { ?> <li> <div style="overflow: hidden;margin-bottom: 5px;"> <a href="<?php echo Yii::app()->createUrl("collection/view", array("id" => $collection->id, "title" => Common::makeFriendlyUrl(CHtml::encode($collection->name)))); ?> " class="play_all"><span>playall</span></a> </div> </li> <?php $i = 1; foreach ($data as $song) { $urlKey = $song->url_key ? $song->url_key : Common::makeFriendlyUrl($song->name); $link = Yii::app()->createUrl("song/view", array("id" => $song->id, 'title' => trim($urlKey, "-"))); ?> <?php if ($i == 1) { ?> <li> <div class="chart-index chart-1st"><b>1</b></div> <div class="chart-content-1st"> <a href="<?php echo $link; ?> " title="<?php echo CHtml::encode($song->name) . ' - ' . CHtml::encode($song->artist_name); ?> ">
if ($numFound > 0 && $objType == 'search') { ?> <div class="bl_title padL10 padT5 padB5 fontB"><?php echo yii::t('chachawap', 'Tìm thấy ') . $numFound . yii::t('chachawap', ' nhạc chuông'); ?> </div> <?php } ?> <table class="tablelist"> <?php foreach ($ringtones as $ringtone) { if (!empty($ringtone->ringtone)) { $ringtone = $ringtone->ringtone; } $ringtoneLink = yii::app()->createUrl('ringtone/view', array('id' => $ringtone->id, 'url_key' => Common::makeFriendlyUrl($ringtone->name))); $avatarImage = CHtml::image(WapArtistModel::model()->getThumbnailUrl(50, $ringtone->artist_id), 'avatar', array('class' => 'avatar')); ?> <tr><td width="65px"> <?php if ($type != "noavatar") { echo $avatarImage; } ?> </td> <td class="itemwrap" onclick="document.location = '<?php echo $ringtoneLink; ?> '"> <p class="m0 fontB"> <a href="<?php
if ($data) { ?> <div class="listview <?php echo $this->layout; ?> "> <h3 class="title"><?php echo $title; ?> </h3> <ul class="items-listview"> <?php foreach ($data as $item) { ?> <?php $link = Yii::app()->createUrl('/post/view', array('id' => $item->_id, 'url_key' => Common::makeFriendlyUrl($item->title))); //$image = FeedModel::model()->getAvatarUrl($item->second_thumb); $image = $item->second_thumb; ?> <li class="item"> <div> <div class="vil-thumb"> <div class="wrr-thumb"> <a href="<?php echo $link; ?> "><img width="100%" alt="<?php echo $item->title; ?> " width="100%" src="<?php echo $image;
<?php $this->pageTitle = $article->title; $this->breadcrumbs = array($article->genre => Yii::app()->createUrl('/category/index', array('url_key' => Common::makeFriendlyUrl($article->genre))), $article->title); ?> <?php $this->renderPartial('_view', array('article' => $article)); ?> <div id="comments"> <?php if ($article->comments >= 1) { ?> <h3> <?php echo $article->comments > 1 ? $article->comments . ' comments' : 'One comment'; ?> </h3> <?php $this->renderPartial('_comments', array('post' => $article, 'comments' => $article->comments)); ?> <?php } ?> <h3>Leave a Comment</h3> <?php if (Yii::app()->user->hasFlash('commentSubmitted')) {
?> " href="<?php echo $link; ?> "><?php echo Formatter::smartCut(CHtml::encode($song->name), 30); ?> </a></h3> <p> <?php //artist link new $j = 0; $artistList = explode(",", $song->artist_object); foreach ($artistList as $item) { $artists = explode("|", $item); $urlKey = Common::makeFriendlyUrl(trim($artists[1])); $artistLink = Yii::app()->createUrl("artist/view", array("id" => $artists[0], "title" => $urlKey)); //end artist link new ?> <a title="<?php echo CHtml::encode($artists[1]); ?> " href="<?php echo $artistLink; ?> "><?php echo Formatter::smartCut($artists[1], 20); ?> </a> <?php if (count($artistList) > 1 && $j < count($artistList) - 1) {
<table class="videolist tablelist"> <?php $currentPage = Yii::app()->request->getParam('pv', 1); $number = ($currentPage - 1) * yii::app()->params['pageSize'] + 1; foreach ($videos as $video) { if ($video->id != $excludeId) { $videoLink = yii::app()->createUrl('video/view', array('id' => $video->id, 'url_key' => Common::makeFriendlyUrl($video->name), 'src' => $src, 'playlist' => $playlist ? $playlist : 0)); if ($video->id) { $avatarImage = CHtml::image(WapVideoModel::model()->getThumbnailUrl(100, $video->id), 'avatar', array('class' => 'avatar')); } else { $avatarImage = CHtml::image('/css/wap/images/icon/clip-50.png', 'avatar', array('class' => 'avatar')); } ?> <tr><td width="100px" onclick="document.location = '<?php echo $videoLink; ?> '"> <?php echo $avatarImage; ?> </td> <td class="itemwrap" onclick="document.location = '<?php echo $videoLink; ?> '"> <p class="m0 fontB"> <a href="<?php echo $videoLink; ?> "><?php
public function actionCharge() { $id = Yii::app()->request->getParam('id'); $song = SongModel::model()->findByPk($id); $action = Yii::app()->request->getParam('action', 'playSong'); $deviceId = yii::app()->session['deviceId']; $msg = ""; $playUrl = ''; if (!$song) { $this->forward("/site/error", true); } $artist_name = Common::makeFriendlyUrl($song->artist_name); $back_url = Yii::app()->params['base_url'] . Yii::app()->createUrl('song/view', array('id' => $song->id, 'url_key' => Common::makeFriendlyUrl($song->name), 'artist' => $artist_name)); if (Yii::app()->user->isGuest) { if ($action == 'downloadSong') { $this->redirect($this->createUrl("/account/login", array('back_url' => $back_url))); Yii::app()->end(); } else { //cho nghe 5 lan free $limit = isset(Yii::app()->session["limit_play"]) ? Yii::app()->session["limit_play"] : 0; if ($limit >= 5) { $msg = Yii::app()->params['message']['limit_content']; } else { Yii::app()->session["limit_play"] = Yii::app()->session["limit_play"] + 1; $playUrl = WapSongModel::model()->getAudioFileUrl($song->id, $deviceId, 'rtsp', $song->profile_ids); $this->redirect($this->createUrl("song/view", array('url' => $playUrl, "id" => $id, 'url_key' => $song->url_key))); } $this->render('play', compact('msg', 'back_url', 'playUrl')); exit; } } if ($action == 'downloadSong' && empty($this->isSub)) { $msg = "Quý khách vui lòng đăng ký dịch vụ để tải miễn phí nội dung"; $this->render('download', compact('msg', 'back_url')); exit; } $bmUrl = Yii::app()->params['bmConfig']['remote_wsdl']; $client = new SoapClient($bmUrl, array('trace' => 1)); if ($action == 'downloadSong') { $params = array('code' => $song->code, 'from_phone' => yii::app()->user->getState('msisdn'), 'to_phone' => yii::app()->user->getState('msisdn'), 'source_type' => 'wap', 'promotion' => 0, 'smsId' => '', 'noteOptions' => array()); $result = $client->__soapCall('downloadSong', $params); } elseif ($action == 'playSong') { $params = array('code' => $song->code, 'from_phone' => Yii::app()->user->getState('msisdn'), 'source_type' => 'wap', 'promotion' => 0); $result = $client->__soapCall('playSong', $params); } $errorCode = $result->message; // Log url trả về cho user if ($errorCode == "success") { if ($action == 'playSong') { $playUrl = WapSongModel::model()->getAudioFileUrl($song->id, $deviceId, 'rtsp', $song->profile_ids); } else { $playUrl = WapSongModel::model()->getNiceDownloadUrl($song->id, $deviceId, 'http', $song->profile_ids, $song->url_key, $song->artist_name); } $this->redirect($this->createUrl("song/view", array('url' => $playUrl, "id" => $id, 'url_key' => $song->url_key))); } else { $msg = Yii::app()->params['subscribe'][$errorCode]; } $this->render('play', compact('msg', 'back_url', 'playUrl')); }
echo yii::t('wap', 'Tìm thấy ') . $numFound . yii::t('wap', ' nghệ sĩ'); ?> </div> <?php } ?> <table class="tablelist"> <?php $count = 1; $number = $artistPages->getCurrentPage() * yii::app()->params['pageSize'] + 1; ?> <?php foreach ($artists as $artist) { ?> <?php $artistLink = yii::app()->createUrl('artist/view', array('id' => $artist->id, 'url_key' => Common::makeFriendlyUrl($artist->name))); if ($artist->id) { $avatarImage = CHtml::image(WapArtistModel::model()->getThumbnailUrl(50, $artist->id), 'avatar', array('class' => 'avatar')); } else { $avatarImage = CHtml::image('/css/wap/images/icon/artist-50.png', 'avatar', array('class' => 'avatar')); } ?> <tr> <td style="width:60px"><a href="<?php echo $artistLink; ?> "><?php echo $avatarImage; ?> </a></td> <td>
?> list_song album_song_list"> <?php $songs = $this->songs; $i = 0; if ($songs) { Yii::app()->SEO->addMetaProp('music:song_count', count($songs)); foreach ($songs as $song) { $obj = array("obj_type" => 'song', 'name' => $song->name, 'id' => $song->id, 'artist' => $song->artist_name); $link = URLHelper::makeUrl($obj); Yii::app()->SEO->addMetaProp('music:song', $link); Yii::app()->SEO->addMetaProp('music:song:track', $i + 1); $duration = isset($song->duration) ? $song->duration : 250; $songName = CHtml::encode($song->name); $artistLink = Yii::app()->createUrl("/search") . "?" . http_build_query(array("q" => CHtml::encode($song->artist_name))); $urlKey = !empty($song->url_key) ? $song->url_key : Common::makeFriendlyUrl($song->name); $shareLink = $link; ?> <li class="item item-in-list song-item-<?php echo $i; ?> " id="song_<?php echo $song->id; ?> " value="<?php echo $song->id; ?> "> <a onClick="javascript: playThis('<?php
<table class="playlist tablelist"> <?php $currentPage = Yii::app()->request->getParam('ps', 1); $number = ($currentPage - 1) * yii::app()->params['pageSize'] + 1; foreach ($playlists as $playlist) { $playlistLink = yii::app()->createUrl('playlist/detail', array('id' => $playlist->id, 'baseid' => NULL, 'url_key' => Common::makeFriendlyUrl($playlist->name), array('class' => 'avatar'))); if ($playlist->id) { $avatarImage = CHtml::image(UserModel::model()->getThumbnailUrl(50, $playlist->user_id), 'avatar', array('class' => 'avatar')); } else { $avatarImage = CHtml::image('/css/wap/images/icon/clip-50.png', 'avatar'); } ?> <tr><td width="65px"> <?php echo $avatarImage; ?> </td> <td class="itemwrap" onclick="document.location = '<?php echo $playlistLink; ?> '"> <p class="m0 fontB"> <a href="<?php echo $playlistLink; ?> "><?php echo WapCommonFunctions::substring($playlist->name, ' ', 6); ?> </a> </p>
</h4> <p class="time-news">(<?php echo date('d/m H:i', strtotime($news[0]->created_time)); ?> )</p> </a> </div> <div class="intro"><?php echo CHtml::encode(Formatter::smartCut($news[0]->intro, 110)); ?> </div> </div> <?php for ($i = 1; $i < count($news); $i++) { $item = $news[$i]; $link = Yii::app()->createUrl('news/detail', array('id' => $item->id, 'url_key' => Common::makeFriendlyUrl($item->title))); ?> <div class="item_row news_row <?php if ($i == count($news) - 1) { echo 'last_item'; } ?> "> <a href="<?php echo $link; ?> " title=" <?php echo CHtml::encode($item->title); ?> "> <h4 class="title"><?php
<?php if (!empty($albums)) { ?> <ul class="album_list items-list"> <?php $i = 0; foreach ($albums as $key => $album) { $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("s4", $album->id), $album->name, array('class' => 'avatar')); } else { $avatarImage = CHtml::image('/css/wap/images/icon/clip-50.png', 'avatar', array('class' => 'avatar')); } ?> <li class="item"> <a href="<?php echo $albumLink; ?> "> <?php echo $avatarImage; ?> <h3 class="subtext padT10"><?php echo CHtml::encode($album->name, 10, 0); ?> </h3> <ul class="subtext info"><li><?php echo CHtml::encode($album->artist_name, 10, 0); ?>
<table class="bg_news mylistnew tablelist"> <?php if (isset($albumPages)) { $number = $albumPages->getCurrentPage() * yii::app()->params['pageSize'] + 1; } else { $number = 1; } foreach ($newsList as $news) { echo '<tr>'; $newsLink = yii::app()->createUrl('news/view', array('id' => $news->id, 'url_key' => Common::makeFriendlyUrl($news->title))); $thumbnailUrl = WapNewsModel::model()->getThumbnailUrl(100, $news->id); /* * $agetHeaders = @get_headers($thumbnailUrl); if (preg_match("|200|", $agetHeaders[0])) { $avatarImage = CHtml::image($thumbnailUrl, 'avatar'); } else { $avatarImage = CHtml::image('../css/wap/images/icon/default-50.png', 'avatar'); } */ $avatarImage = CHtml::image($thumbnailUrl, 'avatar'); if ($type == "homepage" && $number == 1 || $type != "homepage") { ?> <td onclick="document.location = '<?php echo $newsLink; ?> '"> <table> <tr style="background: none"> <td width="85px"><?php echo $avatarImage; ?>
<div id="musicgift"> <?php $artistLink = yii::app()->createUrl('artist/view', array('id' => $song->song_artist[0]->artist_id, 'url_key' => Common::makeFriendlyUrl($song->artist_name))); ?> <div style="padding: 10px"> <div class="newlist toptext cusleftdiv infom"> <h1><?php echo $song->name; ?> </h1> <div>Ca sĩ: <a href="<?php echo $artistLink; ?> "><?php echo $song->artist_name; ?> </a></div> <div>MS: S<?php echo $song->code; ?> </div> <div> <span class="img_wrap">Nghe</span> <a class="smallText" href="<?php echo yii::app()->createUrl('song/view', array('id' => $song->id, 'play' => 1)); ?> ">(<?php echo $played_count; ?> )</a>
<?php $i = $limit * $pager->getCurrentPage(); foreach ($topWeek as $song) { $i++; $artist_name = Common::makeFriendlyUrl($song->artist_name); $link = Yii::app()->createUrl('song/view', array('id' => $song->id, 'url_key' => Common::makeFriendlyUrl($song->name), 'artist' => $artist_name)); ?> <li class="item"> <div class="vg_number vg_number<?php echo $i; ?> fll"><?php echo $i; ?> </div> <a href="<?php echo $link; ?> "> <i class="vg_icon icon_song"></i> <h3 class="subtext"><?php echo CHtml::encode($song->name); ?> </h3> <ul class="info subtext"><li><?php echo CHtml::encode($song->artist_name); ?> </li></ul> </a> </li>
<div class="ct_list_box"> <ul class="video_list items-list"> <?php $i = 0; foreach ($this->videos as $video) { if (!isset($this->options['excludeId']) || isset($this->options['excludeId']) && $this->options['excludeId'] != $video['id']) { $link = Yii::app()->createUrl('video/view', array('id' => $video['id'], 'url_key' => Common::makeFriendlyUrl($video['name']), "artist" => Common::makeFriendlyUrl(trim($video['artist_name'])))); if (isset($this->type) && $this->type == 'VIDEO_COLLECTION') { $link = Yii::app()->createUrl('video/view', array('id' => $video['id'], 'url_key' => Common::makeFriendlyUrl($video['name']), "artist" => Common::makeFriendlyUrl(trim($video['artist_name'])))); } if (isset($this->type) && $this->type == 'VIDEO_PLAYLIST') { $playlistId = isset($this->options) && isset($this->options['playlist']) ? $this->options['playlist'] : 0; $link = Yii::app()->createUrl('video/view', array('id' => $video['id'], 'url_key' => Common::makeFriendlyUrl($video['name']), "artist" => Common::makeFriendlyUrl(trim($video['artist_name'])), 'playlist' => $playlistId)); } $i++; $name = explode("-", $video['name']); ?> <li class="item <?php if ($i == count($this->videos)) { echo 'last_item'; } ?> "> <?php $avatarImage = CHtml::image(WapVideoModel::model()->getThumbnailUrl(100, $video['id']), 'avatar', array('class' => 'video-avatar', 'align' => 'left')); ?> <a href="<?php echo $link; ?> ">
<ul class="list_bxh ovh" style="border-bottom: none;"> <?php if ($data) { $i = 1; foreach ($data as $album) { $urlKey = $album->url_key ? $album->url_key : Common::makeFriendlyUrl($album->name); $link = Yii::app()->createUrl("album/view", array("id" => $album->id, 'title' => trim($urlKey, "-"), "artist" => Common::makeFriendlyUrl(trim($album->artist_name)))); ?> <?php if ($i == 1) { ?> <li> <div class="chart-index chart-1st"><b>1</b></div> <div class="chart-content-1st"> <a href="<?php echo $link; ?> " title="<?php echo CHtml::encode($album->name) . ' - ' . CHtml::encode($album->artist_name); ?> "> <img width="50" src="<?php echo AvatarHelper::getAvatar("album", $album->id, 150); ?> " alt="<?php echo CHtml::encode($album->name) . ' - ' . CHtml::encode($album->artist_name); ?> " /> </a> <h3> <a href="<?php
<li class="li-spacer" id="<?php echo $pager->getCurrentPage() + 1; ?> "> <input type="hidden" class="curent-page" value="<?php echo $pager->getCurrentPage() + 1; ?> "> </li> <?php $i = $limit * $pager->getCurrentPage(); foreach ($topWeek as $video) { $i++; $link = Yii::app()->createUrl('video/view', array('id' => $video->id, 'url_key' => Common::makeFriendlyUrl($video->name), "artist" => Common::makeFriendlyUrl(trim($video->artist_name)))); $name = explode("-", $video['name']); ?> <li data-corners="false" data-shadow="false" data-iconshadow="true" data-wrapperels="div" data-icon="arrow-r" data-iconpos="right" data-theme="d" class="ui-btn ui-btn-icon-right ui-li-has-arrow ui-li ui-btn-up-d"><div class="ui-btn-inner ui-li"> <div class="ui-btn-text"> <span class="xbh-count-album index"><?php echo $i; ?> </span> <?php $avatarImage = CHtml::image(WapVideoModel::model()->getThumbnailUrl(100, $video->id), 'avatar', array('class' => 'video-avatar-bxh', 'align' => 'left')); echo $avatarImage;
public function actionIndex() { $keyword = trim(yii::app()->request->getParam('q', '')); $keyword = strip_tags($keyword); $search_type = trim(yii::app()->request->getParam('type', '')); $page = intval(yii::app()->request->getParam('page', 1)); $is_search = Yii::app()->request->getParam('is_search', 1); $paging = array('page' => $page, 'recordsPerPage' => !$search_type ? Yii::app()->params['numberPerPage'] : Yii::app()->params['pageSize']); $limit = 5; $searchType = !$search_type ? $this->type_infos : array($search_type => ''); $total_results = array(); foreach ($searchType as $type => $info) { switch ($type) { case 'song': $response = SearchHelper::getInstance()->search($keyword, 'song', $limit, $page - 1); $results = $this->copyAndCast($response->docs, array('name' => 'name', 'artist_name' => 'artist_name')); $results = $this->getStatistic($results, $type); $countSong = $response->numFound; $pages = new CPagination($countSong); $pageSize = Yii::app()->params['pageSize']; $pages->params = array('q' => $keyword, 'type' => $type); $pages->setPageSize($pageSize); $total_results[$type] = array('numFound' => $response->numFound, 'results' => $results, 'pages' => $pages); break; case 'clip': $response = SearchHelper::getInstance()->search($keyword, 'video', $limit, $page - 1); $results = $this->copyAndCast($response->docs, array('artist' => 'artist_name')); $results = $this->getStatistic($results, $type); $countClip = $response->numFound; $pages = new CPagination($countClip); $pageSize = Yii::app()->params['pageSize']; $pages->params = array('q' => $keyword, 'type' => $type); $pages->setPageSize($pageSize); $total_results[$type] = array('numFound' => $response->numFound, 'results' => $results, 'pages' => $pages); break; case 'album': $response = SearchHelper::getInstance()->search($keyword, 'album', $limit, $page - 1); $results = $this->copyAndCast($response->docs, array('artist' => 'artist_name')); $results = $this->getStatistic($results, $type); $countAlbum = $response->numFound; $pages = new CPagination($countAlbum); $pageSize = Yii::app()->params['pageSize']; $pages->params = array('q' => $keyword, 'type' => $type); $pages->setPageSize($pageSize); $total_results[$type] = array('numFound' => $response->numFound, 'results' => $results, 'pages' => $pages); break; case 'artist': $response = SearchHelper::getInstance()->search($keyword, 'artist', $limit, $page - 1); $results = $this->copyAndCast($response->docs, array('artist' => 'artist_name')); $results = $this->getStatistic($results, $type, 'song_count'); $countArtist = $response->numFound; $pages = new CPagination($countArtist); $pageSize = Yii::app()->params['pageSize']; $pages->params = array('q' => $keyword, 'type' => $type); $pages->setPageSize($pageSize); $total_results[$type] = array('numFound' => $response->numFound, 'results' => $results, 'pages' => $pages); $listArtist = ArtistModel::updateResultFromSearch($this->copyAndCast($response->docs, array())); $artistSeach = trim($listArtist[0]['name']); if ($artistSeach == $keyword || Common::makeFriendlyUrl($artistSeach) == Common::makeFriendlyUrl($keyword)) { $urlKey = Common::makeFriendlyUrl(trim($listArtist[0]['name'])); $link = Yii::app()->createUrl("artist/view", array("id" => $listArtist[0]['id'], "title" => $urlKey)); $this->redirect($link); } break; case 'videoplaylist': $response = SearchHelper::getInstance()->search($keyword, 'videoplaylist', $limit, $page - 1); $results = $this->copyAndCast($response->docs, array('artist' => 'artist_name')); $results = $this->getStatistic($results, $type); $countVideoPlaylist = $response->numFound; $pages = new CPagination($countVideoPlaylist); $pageSize = Yii::app()->params['pageSize']; $pages->params = array('q' => $keyword, 'type' => $type); $pages->setPageSize($pageSize); $total_results[$type] = array('numFound' => $response->numFound, 'results' => $results, 'pages' => $pages); break; } } if ($is_search == '0') { $this->render('list_rbt', array('keyword' => $keyword, 'search_type' => $search_type, 'total_results' => $total_results, 'type_infos' => $this->type_infos)); } // echo '<pre>';print_r($total_results); $this->render('result', array('keyword' => $keyword, 'search_type' => $search_type, 'total_results' => $total_results, 'type_infos' => $this->type_infos)); }
</div> <?php } ?> <table class="tablelist"> <?php foreach ($ringbacktones as $rbt) { if (!empty($rbt->rbt_id)) { $id = $rbt->rbt_id; } else { $id = $rbt->id; } if (!empty($rbt->rbt)) { $rbt = $rbt->rbt; } $rbtLink = yii::app()->createUrl('ringbacktone/view', array('id' => $id, 'url_key' => Common::makeFriendlyUrl($rbt->name))); $avatarImage = CHtml::image(WapArtistModel::model()->getThumbnailUrl(50, $rbt->artist_id), 'avatar', array('class' => 'avatar')); ?> <tr><td width="65px"> <?php if ($type != "noavatar") { echo $avatarImage; } ?> </td> <td class="itemwrap" onclick="document.location = '<?php echo $rbtLink; ?> '"> <p class="m0 fontB"> <a href="<?php