librefm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Librefm-commits] [1143] display album art for track's other albums


From: Clint Adams
Subject: [Librefm-commits] [1143] display album art for track's other albums
Date: Sun, 03 May 2009 02:36:56 +0000

Revision: 1143
          http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1143
Author:   clint
Date:     2009-05-03 02:36:55 +0000 (Sun, 03 May 2009)
Log Message:
-----------
display album art for track's other albums

Modified Paths:
--------------
    trunk/nixtape/themes/librefm/templates/track.tpl
    trunk/nixtape/track.php

Modified: trunk/nixtape/themes/librefm/templates/track.tpl
===================================================================
--- trunk/nixtape/themes/librefm/templates/track.tpl    2009-05-03 02:09:56 UTC 
(rev 1142)
+++ trunk/nixtape/themes/librefm/templates/track.tpl    2009-05-03 02:36:55 UTC 
(rev 1143)
@@ -28,7 +28,15 @@
       Listeners: {$track->getListenerCount()}
   </li>
   <li>
-      Other Albums containing this track: {$otheralbum}
+
+      Albums containing this track:
+{section name=i loop=$albums}
+<span{if $albums[i]->image != false} about="{$albums[i]->id}"{/if}>
+<img class="album photo" {if $albums[i]->image == false} 
src="{$base_url}/i/qm160.png"{else}src="{$albums[i]->image}"{/if}
+ 
alt="{$albums[i]->name|escape:'html':'UTF-8'}"title="{$albums[i]->name|escape:'html':'UTF-8'}"
 width="160" />
+</span>
+{/section}
+
   </li>
 </ul>
 <div class="cleaner">&nbsp;</div>

Modified: trunk/nixtape/track.php
===================================================================
--- trunk/nixtape/track.php     2009-05-03 02:09:56 UTC (rev 1142)
+++ trunk/nixtape/track.php     2009-05-03 02:36:55 UTC (rev 1143)
@@ -40,15 +40,17 @@
 
 $res = $mdb2->query("SELECT * FROM Track WHERE lower(artist) = " . 
$mdb2->quote(strtolower($track->artist_name),"text") . " AND lower(name) = " . 
$mdb2->quote(strtolower($track->name),"text"));
 
-$otheralbums = "";
+$aOtheralbums = {};
+$i = 0;
 
 while (($row = $res->fetchRow(MDB2_FETCHMODE_ASSOC))) {
        $trow = sanitize($row);
-       $otheralbums .= $trow["album"] . ", ";
+       if ($trow["album"]) {
+       $aArtistAlbums[$i++] = new Album(row["album"], row["artist"]);
+       }
 }
 
-$smarty->assign('otheralbum', $otheralbums);
+$smarty->assign("albums", $aOtherAlbums);
 
-
 $smarty->display("track.tpl");
 ?>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]