File size: 898B
<?php
include 'config.php';
include'func.php';
$title='Loved Track';
include'head.php';
if(!empty($_GET['page'])){
$noPage=$_GET['page'];
}else{
$noPage='1';
}
$json=json_decode(ngegrab('http://ws.audioscrobbler.com/2.0/?method=chart.getlovedtracks&api_key='.$lastfm_api.'&format=json&limit=10&page='.$noPage.''));
if (!empty($json)){
foreach($json->tracks->track as $list){
$name=$list->name;
$artist=$list->artist->name;
echo'<div class="menu">» <a href="'.$dir.'/?q='.$artist.'+'.$name.'">'.$artist.' - '.$name.'</a></div>';}
echo '<div class="paging">';
if ($noPage > 1) {echo'<a href="?page='.($noPage-1).'">« Previous</a> - ';}
if ($noPage <= 100) {echo'<a href="?page='.($noPage+1).'">Next Page »</a> ';}
echo '</div>';
}else{echo'<div class="menu"><font color="red">Result Not Found, please use another keyword.</font></div>';}
include'foot.php';
?>