diff options
-rw-r--r-- | albums.php | 2 | ||||
-rw-r--r-- | artists.php | 32 | ||||
-rw-r--r-- | lib/class/artist.class.php | 8 | ||||
-rw-r--r-- | templates/show_album.inc | 2 | ||||
-rw-r--r-- | templates/show_albums.inc | 2 | ||||
-rw-r--r-- | templates/show_artist.inc | 4 | ||||
-rw-r--r-- | templates/show_get_albumart.inc.php | 2 | ||||
-rw-r--r-- | templates/show_songs.inc | 12 |
8 files changed, 47 insertions, 17 deletions
@@ -91,7 +91,7 @@ elseif ($_REQUEST['action'] === 'find_art') { $search = $artist . " " . $album_name; //Find out if the cover url is a local filename or an url - if (empty($_FILES['file'])){ + if (empty($_FILES['file']['tmp_name'])){ $coverurl = $_REQUEST['cover']; // Attempt to find the art with what we've got diff --git a/artists.php b/artists.php index 8e8a8612..b84e1ed1 100644 --- a/artists.php +++ b/artists.php @@ -41,8 +41,38 @@ switch($action) { show_box_top(); show_alphabet_list('artists','artists.php'); show_box_bottom(); + + // Setup the View Ojbect + $view = new View(); + $view->import_session_view(); + + $artist = new Artist($_REQUEST['artist']); - $artist->show_albums(); + + $sql = "SELECT DISTINCT(album.id) FROM song,album WHERE song.album=album.id AND song.artist='$artist->id'"; + + if ($_REQUEST['keep_view']) { + $view->initialize(); + } + + // If we aren't keeping the view then initlize it + elseif ($sql) { + if (!$sort_order) { $sort_order = 'album.name'; } + $db_results = mysql_query($sql, dbh()); + $total_items = mysql_num_rows($db_results); + if ($match != "Show_all") { $offset_limit = $_SESSION['userdata']['offset_limit']; } + $view = new View($sql, 'artists.php',$sort_order,$total_items,$offset_limit); + } + + else { $view = false; } + + if ($view->base_sql) { + $artist->show_albums($view->sql); + } + + + + //$artist->show_albums(); break; case 'show_all_songs': diff --git a/lib/class/artist.class.php b/lib/class/artist.class.php index 10843086..b43d9c90 100644 --- a/lib/class/artist.class.php +++ b/lib/class/artist.class.php @@ -78,11 +78,11 @@ class Artist { @function get_albums @discussion gets the albums for this artist */ - function get_albums() { + function get_albums($sql) { $results = array(); - $sql = "SELECT DISTINCT(album.id) FROM song,album WHERE song.album=album.id AND song.artist='$this->id' ORDER BY album.name"; +// $sql = "SELECT DISTINCT(album.id) FROM song,album WHERE song.album=album.id AND song.artist='$this->id' ORDER BY album.name"; $db_results = mysql_query($sql, dbh()); while ($r = mysql_fetch_object($db_results)) { @@ -279,12 +279,12 @@ class Artist { @function show_albums @discussion displays the show albums by artist page */ - function show_albums() { + function show_albums($sql = 0) { /* Set Vars */ $web_path = conf('web_path'); - $albums = $this->get_albums(); + $albums = $this->get_albums($sql); $this->format_artist(); $artist = $this; diff --git a/templates/show_album.inc b/templates/show_album.inc index 69814d02..2768cc3b 100644 --- a/templates/show_album.inc +++ b/templates/show_album.inc @@ -63,7 +63,7 @@ $title = scrub_out($album->name) . ' -- ' . $album->f_artist; <a href="<?php echo $web_path; ?>/albums.php?action=update_from_tags&album_id=<?php echo $album->id; ; ?>"><?php echo _("Update from tags"); ?></a><br /> <?php } ?> <?php if (batch_ok()) { ?> - <a href="<?php echo $web_path; ?>/batch.php?action=alb&id=<?php echo $album->id; ; ?>"><?php echo _('Download'); ?></a><br /> + <a href="<?php echo $web_path; ?>/batch.php?action=alb&id=<?php echo $album->id; ; ?>"><img src="<?php echo $web_path; ?>/images/icon_download.gif" border="0" /> <?php echo _('Download'); ?></a><br /> <?php } ?> </div> <?php require (conf('prefix') . '/templates/show_box_bottom.inc.php'); ?> diff --git a/templates/show_albums.inc b/templates/show_albums.inc index 4fdfc2d2..e9fb597d 100644 --- a/templates/show_albums.inc +++ b/templates/show_albums.inc @@ -61,7 +61,7 @@ foreach ($albums as $album) { <a href="<?php echo $web_path; ?>/song.php?action=album&album_id=<?php echo $album->id; ?>"><?php echo _("All"); ?></a> | <a href="<?php echo $web_path; ?>/song.php?action=album_random&album_id=<?php echo $album->id; ?>"><?php echo _("Random"); ?></a> <?php if (batch_ok()) { ?> - | <a href="<?php echo $web_path; ?>/batch.php?action=alb&id=<?php echo $album->id; ?>"><?php echo _("Download"); ?></a> + | <a href="<?php echo $web_path; ?>/batch.php?action=alb&id=<?php echo $album->id; ?>"><img src="<?php echo $web_path; ?>/images/icon_download.gif" border="0" alt="<?php echo _('Download'); ?>" /></a> <?php } ?> </td> </tr> diff --git a/templates/show_artist.inc b/templates/show_artist.inc index 748f5b75..1521f728 100644 --- a/templates/show_artist.inc +++ b/templates/show_artist.inc @@ -34,8 +34,8 @@ $web_path = conf('web_path'); <a href="#" onclick="check_songs(); return false;"><?php echo _('Select'); ?></a> </th> <th><?php echo _('Cover'); ?></th> - <th><?php echo _('Album Name'); ?></th> - <th><?php echo _('Album Year'); ?></th> + <th><a href="<?php echo $web_path; ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&artist=<?php echo $artist->id ?>&keep_view=true&sort_type=album.name&sort_order=0"><?php echo _('Album Name'); ?></th> + <th><a href="<?php echo $web_path; ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&artist=<?php echo $artist->id ?>&keep_view=true&sort_type=album.year&sort_order=0"><?php echo _('Album Year'); ?></th> <th><?php echo _('Total Tracks'); ?></th> <th><?php echo _('Action'); ?></th> </tr> diff --git a/templates/show_get_albumart.inc.php b/templates/show_get_albumart.inc.php index 246e2254..3375ae18 100644 --- a/templates/show_get_albumart.inc.php +++ b/templates/show_get_albumart.inc.php @@ -21,7 +21,7 @@ */ ?> <?php show_box_top(_('Customize Search')); ?> -<form enctype="multipart/form-data" name="coverart" method="post" action="<?php echo conf('web_path'); ?>/albums.php?action=find_art&album_id=<?php echo $album->id; ?>&artist_name=<?php echo $_POST['artist_name'];?>&album_name=<?php echo $_POST['album_name']; ?>&cover=<?php echo scrub_out($_POST['cover']); ?>" style="Display:inline;"> +<form enctype="multipart/form-data" name="coverart" method="post" action="<?php echo conf('web_path'); ?>/albums.php?action=find_art&album_id=<?php echo $album->id; ?>&artist_name=<?php echo $_REQUEST['artist_name'];?>&album_name=<?php echo $_REQUEST['album_name']; ?>&cover=<?php echo scrub_out($_REQUEST['cover']); ?>" style="Display:inline;"> <table> <tr> </tr> diff --git a/templates/show_songs.inc b/templates/show_songs.inc index 396f9848..300749ef 100644 --- a/templates/show_songs.inc +++ b/templates/show_songs.inc @@ -130,20 +130,20 @@ foreach ($song_ids as $song_id) { </a> </td> <td> - <a href="<?php echo $web_path; ?>/flag.php?action=show_flag&type=song&id=<?php echo $song->id; ?>"><?php echo _('Flag'); ?></a> + <a href="<?php echo $web_path; ?>/flag.php?action=show_flag&type=song&id=<?php echo $song->id; ?>"><img src="<?php echo $web_path; ?>/images/icon_flag.gif" "border="0" alt="<?php echo _('Flag'); ?>" title="<?php echo _('Flag'); ?>"/></a> <?php if ($GLOBALS['user']->has_access('100')) { ?> - | <a href="<?php echo $web_path; ?>/admin/flag.php?action=show_edit_song&song=<?php echo $song->id; ?>"><?php echo _('Edit'); ?></a> | + | <a href="<?php echo $web_path; ?>/admin/flag.php?action=show_edit_song&song=<?php echo $song->id; ?>"><img src="<?php echo $web_path; ?>/images/icon_edit.gif" "border="0" alt="<?php echo _('Edit'); ?>" title="<?php echo _('Edit'); ?> "/></a> | <?php if ($song->enabled) { ?> - <a href="<?php echo $web_path; ?>/admin/flag.php?action=disable&song_ids=<?php echo $song->id; ?>"><?php echo _('Disable'); ?></a> + <a href="<?php echo $web_path; ?>/admin/flag.php?action=disable&song_ids=<?php echo $song->id; ?>"><img src="<?php echo $web_path; ?>/images/icon_disable.gif" "border="0" alt="<?php echo _('Disable'); ?>" title="<?php echo _('Disable'); ?>" /></a> <?php } else { ?> - <a href="<?php echo $web_path; ?>/admin/flag.php?action=enabled&song_ids=<?php echo $song->id; ?>"><?php echo _('Enable'); ?></a> + <a href="<?php echo $web_path; ?>/admin/flag.php?action=enabled&song_ids=<?php echo $song->id; ?>"><img src="<?php echo $web_path; ?>/images/icon_enable.gif" "border="0" alt="<?php echo _('Enable'); ?>" title="<?php echo _('Enable'); ?>" /></a> <?php } //status ?> <?php } //access ?> <?php if ($GLOBALS['user']->prefs['download']) { ?> - | <a href="<?php echo $web_path; ?>/download/index.php?action=download&song_id=<?php echo $song->id; ?>&sid=<?php echo scrub_out(session_id()); ?>&fn=<?php echo rawurlencode($song->f_artist_full . " - " . $song->title . "." . $song->type); ?>"><?php echo _('Download'); ?></a> + | <a href="<?php echo $web_path; ?>/download/index.php?action=download&song_id=<?php echo $song->id; ?>&sid=<?php echo scrub_out(session_id()); ?>&fn=<?php echo rawurlencode($song->f_artist_full . " - " . $song->title . "." . $song->type); ?>"><img src="<?php echo $web_path; ?>/images/icon_download.gif" "border="0" alt="<?php echo _('Download'); ?>" title="<?php echo _('Download'); ?>" /></a> <?php } ?> <?php if ($GLOBALS['user']->prefs['direct_link']) { ?> - | <a href="<?php echo scrub_out($song->get_url()); ?>"><?php echo _('Direct Link'); ?></a> + | <a href="<?php echo scrub_out($song->get_url()); ?>"><img src="<?php echo $web_path; ?>/images/icon_link.gif" "border="0" alt="<?php echo _('Direct Link'); ?>" title="<?php echo _('Direct Link'); ?>" /></a> <?php } ?> </td> <?php if(conf('ratings')) { ?> |