$class = ""; } $html .= $tpl->assign($row, array('song.NAME' => $ga->cut_string($arr[$i]['name'], 27, true), 'song.SINGER' => $ga->cut_string($arr[$i]['singer'], 27, true), 'song.ID' => $arr[$i]['id'], 'song.KAT' => $arr[$i]['kat'], 'song.CAT' => $arr[$i]['cat'], 'song.KBS' => $arr[$i]['kbs'], 'song.TYPE' => $arr[$i]['type'], 'song.RATE' => $arr[$i]['rate'], 'song.CLASS' => $class, 'song.NUM' => $i, 'server' => URL_SERVER)); } # Phân Trang if ($ga->page > 1) { $prev = $ga->page - 1; $pre = '<a href="javascript:void(0);" onclick="loadAjax(\'' . $ga->keyword . '\',\'' . $prev . '\',\'' . $_POST['by'] . '\',\'' . $ga->total . '\');"><img src="theme/img/prev.png" style="border:0px solid;"></a>'; } if ($ga->page < $ga->result) { $next = $ga->page + 1; $ne = '<a href="javascript:void(0);" onclick="loadAjax(\'' . $ga->keyword . '\',\'' . $next . '\',\'' . $_POST['by'] . '\',\'' . $ga->total . '\');"><img src="theme/img/next.png" style="border:0px solid;"></a>'; } $main = $tpl->assign($main, array('ga_pre' => $pre, 'ga_next' => $ne, 'ga_page' => $ga->page, 'ga_result' => $ga->result, 'ga_total' => $ga->total, 'ga_keyword' => $_POST['keyword'])); # Buff Theme $main = $tpl->assign_blocks($main, array('list' => $html)); $tpl->show($main); } } else { if ($_POST['by'] == '4' && $_POST['keyword']) { if ($ga->Album()) { $arr = $ga->arr; $main = $tpl->get('theme/list_album'); $row = $tpl->get_block($main, 'list_row', 1); $html = ""; for ($i = 1; $i <= count($arr) - 4; $i++) { $html .= $tpl->assign($row, array('song.NAME' => $ga->cut_string($arr[$i]['name'], 27, true), 'song.ID' => $arr[$i]['id'], 'song.IMG' => $arr[$i]['img'], 'song.NUM' => $i)); } # Phân Trang if ($ga->page > 1) { $prev = $ga->page - 1;
} else { if ($_GET['type'] == 'creat') { $item = explode('~~', $_COOKIE['pl']); header("Content-Type: application/xml; charset=utf-8"); $asx = '<?xml version="1.0" encoding="utf-8"?>' . '<playlist version="1" xmlns="http://xspf.org/ns/0/">' . '<trackList>'; for ($i = 1; $i <= count($item) - 2; $i++) { $data = explode('~`', $item[$i]); $asx .= '<track>' . '<title>' . $data[2] . '</title>' . '<creator>' . $data[1] . '</creator>' . '<location>http://the-vagabond.vn/metro/music-zing/download.php?type=playlist&id=' . $data[0] . '#.mp3</location>' . '</track>'; } $asx .= '</trackList>' . '</playlist>'; echo $asx; } else { if (!$_COOKIE['pl'] || $_COOKIE['pl'] == '~~') { echo '<div id="bottom" style="width:230px; margin-bottom:10px;">Vui lòng chọn bài hát</div>'; exit; } $main = $tpl->get('theme/playlist'); $row = $tpl->get_block($main, 'list_row', 1); $html = ""; $item = explode('~~', $_COOKIE['pl']); for ($i = 1; $i <= count($item) - 2; $i++) { $data = explode('~`', $item[$i]); $html .= $tpl->assign($row, array('song.NAME' => $data[1], 'song.ID' => $data[0], 'song.SINGER' => $data[2], 'song.NUM' => $i)); } $main = $tpl->assign_blocks($main, array('list' => $html)); $tpl->show($main); } } } } }