5 echo "<h3>Albums</h3>\n<p>";
8 if ( isset($search) ) {
9 $where = "(artist ~* :search OR album ~* :search OR title ~* :search OR path_name ~* :search) ";
10 $params[':search'] = $search;
14 $where .= ($where == ''?
'' : ' AND ');
15 $where .= '(album ~ :album_match)';
16 $params[':album_match'] = '^'.$altr;
18 if ( $where != '' ) $where = 'WHERE '. $where;
19 $sql = 'SELECT distinct ON (lower(album)) album FROM tracks '.$where.' ORDER BY lower(album)';
20 $qry = new AwlQuery( $sql, $params );
22 if ( $qry->Exec('album') && $qry->rows() > 0 ) {
23 while ( $album = $qry->Fetch() ) {
24 $display = htmlspecialchars($album->album
);
25 if ( trim($display) == "" ) $display = "«unknown»";
26 echo " <a href=\"?type=album&l=" . urlencode($album->album
) . "$letter_get\" class=\"album\">$display</a>\n";