1 <script language
="javascript"><!--
3 var args
= show_hide
.arguments
;
4 var tbody
= document
.getElementById('album-' + args
[0]);
5 var control
= document
.getElementById('control-' + args
[0]);
6 // alert(tbody.style.display);
7 if ( tbody
.style
.display
== 'none' ) {
8 tbody
.style
.display
= '';
9 control
.innerHTML
= '–';
12 tbody
.style
.display
= 'none';
13 control
.innerHTML
= '+';
21 function artist_track( $trk, $link_title, $row_class = "" ) {
22 global $letter_get, $ltrtype;
24 $safe_title = htmlspecialchars($link_title);
25 $duration = preg_replace( "/^[0:]{1,4}/", "", $trk->duration
);
26 $enqueue = sprintf( "enqueue('%s','%s','%s')", rawurlencode($trk->artist
),
27 rawurlencode($trk->album
), rawurlencode($trk->title
) );
29 <a class="track$row_class" onclick="$enqueue" title="$trk->path_name">$safe_title</a>
31 <td class="track$row_class" width="7%">$duration</td>
32 <td class="track$row_class" width="4%">
33 <a class="alphabetica" href="edit_track.php$track_link_url" title="Edit Track Info">E</a>
41 echo '<h3>'.htmlspecialchars($a).'</h3>';
43 $qa = 'SELECT artist, album, title, tracknum, path_name, duration::interval(0), ';
44 $qa .= 'extract( EPOCH FROM duration)::int AS secs, quality, get_last_played(hash_key) AS last_played ';
45 $qa .= 'FROM tracks WHERE lower(artist) = lower(?) ';
46 $qa .= 'ORDER BY lower(album), setpart, tracknum';
47 $qry = new AwlQuery($qa, $a);
48 if ( $qry->Exec() && $qry->rows() > 0 ) {
49 echo '<table class="album_list" cellspacing="0">
54 while ( $track = $qry->Fetch() ) {
55 if ( $track->album
!= '' && $track->album
!= $last_album ) {
56 if ( $rownum != 0 ) echo '</tbody>';
57 echo '<tr class="th4">';
59 echo '<td width="3%" class="th4"><span class="expand_hide" id="control-'.$id.'" onclick="show_hide('.$id.')" title="Expand section">+</span></td>';
60 echo '<td width="86%" class="th4" style="text-align:left"><a class="th4" onclick="';
61 printf( "enqueue('%s','%s','')", rawurlencode($track->artist
), rawurlencode($track->album
) );
62 echo '" title="Play Entire Album">'.htmlspecialchars($track->album
).'</a></td>';
63 echo '<td width="7%"> </td>';
64 echo '<td width="4%" class="th4"><a class="alphabetica" class="track" href="edit_track.php?l='
65 . rawurlencode($track->album
) . '&a='
66 . rawurlencode($track->artist
) . '" title="Edit Album Info">E</a>
68 <tbody id="album-'.$id.'" style="display:none;">
71 $last_album = $track->album
;
73 else if ( $rownum == 0 ) {
74 echo '<tr class="th4">';
76 echo '<td width="3%" class="th4"><span class="expand_hide" id="control-'.$id.'" onclick="show_hide('.$id.')" title="Expand section">+</span></td>';
77 echo '<td class="th4" colspan="3" style="text-align:left">Unkown Album</td></tr>
78 <tbody id="album-'.$id.'" style="display:none;">
83 echo '<tr class="th4">';
85 $rowclass = ($rownum %
2);
86 echo '<td colspan="2" style="text-align:left;" class="track'.$rowclass.'">';
87 echo artist_track($track, ($track->tracknum
> 0 ?
$track->tracknum
.': ' : '') . $track->title
, $rowclass );
93 if ( $rownum != 0 ) echo '</tbody>';