<?php
//
// ObsidianMusic
// a.k.a. amaroK Web Frontend 2.0
//
// Created 1/1/06
// Copyright (C) Ryan Loebs (ObsidianX) 2005/2006
// See LICENSE for GPL
//
// cover.php - Displays the album cover on the album info page
//
///////////////////////////////////////
if(eregi("cover.php", $_SERVER['PHP_SELF'])){
die("Cannot access directly.");
}
// Make sure there was a call to load a picture
if(@$_GET['cid']){
// Grab the cover path from database
$q = query(getquery("alcover", $sort, $_GET['cid']));
$assoc = fetch_assoc($q);
if(!$assoc['path']){
// None found? NOCOVER!
$cover = file_get_contents("img/nocover.png");
}
else{
$cover = file_get_contents($assoc['path']);
}
}else{
// Send default "no cover" picture
$cover = file_get_contents("img/nocover.png");
}
// Send the picture header
header("Content-type: image/png");
// Kill the script and send the image data
// (killed to prevent pat from writing out)
die($cover);