$query"); $count = 0; $rightcol = "

"; if(isset($_COOKIE['DETAIL'])) { $rightcol .= "showing artist detail   [ hide this ]"; } else { $rightcol .= "hiding artist detail   [ show this ]"; } $rightcol .= "

"; while(list($id, $artist, $album, $tracknumber, $title, $date, $length, $filesize, $codec, $bitrate, $samplerate, $archive_volume, $updated) = mysql_fetch_row($result)) { if(! $noshow) { if(isset($_COOKIE['DETAIL'])) { // get the album info from last.fm $url = "http://ws.audioscrobbler.com/2.0/?method=album.getinfo&user=subtlerage&api_key=b25b959554ed76058ac220b7b2e0a026&artist=".urlencode($artist)."&album=".urlencode($album); $ch = curl_init($url) or die(curl_error()); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_TIMEOUT, "60"); curl_setopt($ch, CURLOPT_PORT, "80"); $data = curl_exec($ch) or die(curl_error($ch)); $debug = curl_getinfo($ch); curl_close($ch); $xml = new DOMDocument(); $xml->loadXML($data); $items = $xml->getElementsByTagName('album'); foreach($items as $item) { $summaries = $item->getElementsByTagName('summary'); $albumsummary = $summaries->item(0)->nodeValue; $images = $item->getElementsByTagName('image'); $image = $images->item(2)->nodeValue; if(empty($albumsummary)) { $albumsummary = "none available"; } if(empty($image)) { $image = "/images/na.gif"; } $rightcol .= "
Album Information
$albumsummary
"; } // get the artist info from last.fm $url = "http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&user=subtlerage&api_key=b25b959554ed76058ac220b7b2e0a026&artist=".urlencode($artist)."&album=".urlencode($album); $ch = curl_init($url) or die(curl_error()); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_TIMEOUT, "60"); curl_setopt($ch, CURLOPT_PORT, "80"); $data = curl_exec($ch) or die(curl_error($ch)); $debug = curl_getinfo($ch); curl_close($ch); $xml = new DOMDocument(); $xml->loadXML($data); $artistsummaries = $xml->getElementsByTagName('summary'); $artistsummary = $artistsummaries->item(0)->nodeValue; $artistimages = $xml->getElementsByTagName('image'); $image = $artistimages->item(2)->nodeValue; if(empty($artistsummary)) { $rightcol .= "
Artist Information
none available
"; } else { $rightcol .= "
Artist Information
$artistsummary
"; } // get simiilar artist info from last.fm $url = "http://ws.audioscrobbler.com/2.0/?method=artist.getsimilar&user=subtlerage&api_key=b25b959554ed76058ac220b7b2e0a026&limit=10&artist=".urlencode($artist)."&album=".urlencode($album); $ch = curl_init($url) or die(curl_error()); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_TIMEOUT, "60"); curl_setopt($ch, CURLOPT_PORT, "80"); $data = curl_exec($ch) or die(curl_error($ch)); $debug = curl_getinfo($ch); curl_close($ch); $xml = new DOMDocument(); $xml->loadXML($data); $items = $xml->getElementsByTagName('artist'); $rightcol .= "
Similar Artists
"; $sim = ''; foreach($items as $item) { $names = $item->getElementsByTagName('name'); $name = $names->item(0)->nodeValue; $sim .= "$name, "; } $sim = preg_replace("/, $/", "", $sim); $rightcol .= "$sim
"; } // breadcrumbs $nocol = "
Music Collection >> ".strtoupper($q)." >> $artist >> $album   "; if($date > 0) { $nocol .= "[ $date ]"; } $nocol .= "
\n"; $leftcol = "
\n"; $pagetitle = "Music Collection >> ".strtoupper($q)." >> $artist >> $album"; } $noshow = true; if($count % 2) { $class = ' class="alt clearfix"'; } else { $class = ' class="clearfix"'; } $leftcol .= "
$tracknumber - $title ( $length )
"; $fsize = $filesize / 1024; $leftcol .= "
".number_format($fsize)." KB     $codec     $bitrate kbps
\n"; $count++; } $leftcol .= "
\n"; } // view specific artist's albums elseif(isset($_GET['artist'])) { $q = substr($_GET['artist'], 0, 1); $query = "SELECT artist, album, date, codec FROM music WHERE artist = '".addslashes($_GET['artist'])."' GROUP BY artist, album ORDER BY date ASC"; $result = mysql_query($query, $Connection) or die(mysql_error()."
$query
"); $nocol = "
Music Collection >> ".strtoupper($q)." >> ".urldecode($_GET['artist'])."
\n"; $pagetitle = "Music Collection >> ".strtoupper($q)." >> ".urldecode($_GET['artist']); $leftcol = "
    \n"; if(! mysql_num_rows($result)) { $leftcol .= "
  1. No results
  2. "; } else { while(list($artist, $album, $date, $codec) = mysql_fetch_row($result)) { $leftcol .= "
  3. $album"; if($date > 0) { $leftcol .= " ( $date )"; } $leftcol .= "
  4. \n"; } } $leftcol .= "
\n"; //$leftcol .= "
$query
"; } // view all artists beginning with... elseif(isset($_GET['q'])) { $q = strtolower($_GET['q']); if($q == "all") { $query = "SELECT artist, album, date, codec FROM music GROUP BY artist, album"; $result = mysql_query($query, $Connection) or die(mysql_error()."
$query
"); $nocol = "
Music Collection >> all artists
\n"; $leftcol = "
    \n"; if(! mysql_num_rows($result)) { $leftcol .= "
  1. No results
  2. "; } else { while(list($artist, $album, $date, $codec) = mysql_fetch_row($result)) { $leftcol .= '
  3. '.$artist.' - '.$album.' ('.$date.')
  4. '."\n"; } $leftcol .= "
\n"; } } else { $query = "SELECT artist FROM music WHERE artist LIKE '$q%' GROUP BY artist"; $result = mysql_query($query, $Connection) or die(mysql_error()."
$query
"); $nocol = "
Music Collection >> ".strtoupper($q)."
\n"; $pagetitle = "Music Collection >> ".strtoupper($q); $leftcol = "
    \n"; if(! mysql_num_rows($result)) { $leftcol .= "
  1. No results
  2. "; } else { while(list($artist, $album) = mysql_fetch_row($result)) { $leftcol .= '
  3. '.$artist.'
  4. '."\n"; } } $leftcol .= "
\n"; } } else { $leftcol = "

Click something.

"; $nocol = "
Music Collection
"; } if(! isset($pagetitle)) { $pagetitle = 'Music Collection'; } ?> <br /> <b>Notice</b>: Undefined variable: pagetitle in <b>/var/vhosts/stoneythecat.com/httpdocs/music/index.php</b> on line <b>304</b><br />

Notice: Undefined variable: nocol in /var/vhosts/stoneythecat.com/httpdocs/music/index.php on line 317

Notice: Undefined variable: leftcol in /var/vhosts/stoneythecat.com/httpdocs/music/index.php on line 319

Notice: Undefined variable: rightcol in /var/vhosts/stoneythecat.com/httpdocs/music/index.php on line 321