We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 5f3a490b authored by mattl's avatar mattl

show album artwork

parent 3daf90e0
......@@ -67,6 +67,20 @@ class Album {
}
function getAlbumArt(){
global $mdb2;
$res = $mdb2->query("SELECT image from Album WHERE name =" . $mdb2->quote($this->name, 'text'));
if(!$res->numRows()) {
$c = "/i/qm160.png";
} else {
$row = sanitize($res->fetchRow(MDB2_FETCHMODE_ASSOC));
$c = $row['image'];
}
return $c;
}
function getPlayCount() {
global $mdb2;
......
......@@ -11,7 +11,7 @@
<li>
<dl>
<dt><a href="{$albums[i]->getURL()}">
{$albums[i]->name}</a></dt>
<img src="{$albums[i]->getAlbumArt()}" alt="{$albums[i]->name}" width="160" /></a></dt>
<dd>{$albums[i]->getPlayCount()} plays</dd>
</dl>
</li>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment