summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdocs/CHANGELOG2
-rw-r--r--lib/class/album.class.php6
-rw-r--r--lib/class/playlist.class.php4
-rw-r--r--lib/class/user.class.php2
-rw-r--r--templates/show_album_row.inc.php2
-rw-r--r--templates/show_playlist.inc.php6
-rw-r--r--templates/show_playlist_song_row.inc.php35
-rw-r--r--templates/show_playlist_songs.inc.php59
-rw-r--r--templates/show_random_albums.inc.php2
9 files changed, 111 insertions, 7 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index 4b099eca..6faed6db 100755
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -4,6 +4,8 @@
--------------------------------------------------------------------------
v.3.4-Alpha2
+ - Fixed missing artist name on Albums of the Moment
+ - Added simple Playlist element view, non-editable
- Fixed double posting of songs on a single stream with some
clients
- Updated LastFM protocol to v1.2
diff --git a/lib/class/album.class.php b/lib/class/album.class.php
index dc42aa2d..f19d26cc 100644
--- a/lib/class/album.class.php
+++ b/lib/class/album.class.php
@@ -215,10 +215,12 @@ class Album {
$this->f_title = $name;
if ($this->artist_count == '1') {
$artist = scrub_out(truncate_with_ellipsis(trim($this->artist_prefix . ' ' . $this->artist_name),Config::get('ellipsis_threshold_album')));
- $this->f_artist = "<a href=\"$web_path/artists.php?action=show&amp;artist=" . $this->artist_id . "\">" . $artist . "</a>";
+ $this->f_artist_link = "<a href=\"$web_path/artists.php?action=show&amp;artist=" . $this->artist_id . "\">" . $artist . "</a>";
+ $this->f_artist = $artist;
}
else {
- $this->f_artist = "<div title=\"$this->artist_count " . _('Artists') . "\">" . _('Various') . "</div>";
+ $this->f_artist_link = "<div title=\"$this->artist_count " . _('Artists') . "\">" . _('Various') . "</div>";
+ $this->f_artist = _('Various');
}
if ($this->year == '0') {
diff --git a/lib/class/playlist.class.php b/lib/class/playlist.class.php
index 493e335a..fcc7f028 100644
--- a/lib/class/playlist.class.php
+++ b/lib/class/playlist.class.php
@@ -108,7 +108,7 @@ class Playlist {
$results = array();
- $sql = "SELECT `object_id`,`object_type`,`dynamic_song` FROM `playlist_data` WHERE `playlist`='" . Dba::escape($this->id) . "' ORDER BY `track`";
+ $sql = "SELECT `object_id`,`object_type`,`dynamic_song`,`track` FROM `playlist_data` WHERE `playlist`='" . Dba::escape($this->id) . "' ORDER BY `track`";
$db_results = Dba::query($sql);
while ($row = Dba::fetch_assoc($db_results)) {
@@ -117,7 +117,7 @@ class Playlist {
// Do something here FIXME!
}
- $results[] = array('type'=>$row['object_type'],'object_id'=>$row['object_id']);
+ $results[] = array('type'=>$row['object_type'],'object_id'=>$row['object_id'],'track'=>$row['track']);
} // end while
return $results;
diff --git a/lib/class/user.class.php b/lib/class/user.class.php
index ca74badf..9ecc247a 100644
--- a/lib/class/user.class.php
+++ b/lib/class/user.class.php
@@ -568,7 +568,7 @@ class User {
$last_song = new Song($data['object_id']);
if ($data['date']+($song_info->time/2) >= time()) {
debug_event('Stats','Not collecting stats less then 50% of song has elapsed','3');
- return false;
+ return false;
}
// Check if lastfm is loaded, if so run the update
diff --git a/templates/show_album_row.inc.php b/templates/show_album_row.inc.php
index 649888e6..7753816e 100644
--- a/templates/show_album_row.inc.php
+++ b/templates/show_album_row.inc.php
@@ -30,7 +30,7 @@
</a>
<?php } ?>
<td><?php echo $album->f_name_link; ?></td>
-<td><?php echo $album->f_artist; ?></td>
+<td><?php echo $album->f_artist_link; ?></td>
<td><?php echo $album->song_count; ?></td>
<td><?php echo $album->year; ?></td>
<td>
diff --git a/templates/show_playlist.inc.php b/templates/show_playlist.inc.php
index 5e99b8a9..6c14210d 100644
--- a/templates/show_playlist.inc.php
+++ b/templates/show_playlist.inc.php
@@ -31,5 +31,11 @@ $web_path = Config::get('web_path');
<li><a href="<?php echo $web_path; ?>/stream.php?action=playlist_random&amp;playlist_id=<?php echo $playlist->id; ?>"><?php echo _('Play Random'); ?></a></li>
</ul>
<?php show_box_bottom(); ?>
+<?php show_box_top(); ?>
<div id="browse_content">
+<?php
+ $object_ids = $playlist->get_items();
+ require_once Config::get('prefix') . '/templates/show_playlist_songs.inc.php';
+?>
</div>
+<?php show_box_bottom(); ?>
diff --git a/templates/show_playlist_song_row.inc.php b/templates/show_playlist_song_row.inc.php
new file mode 100644
index 00000000..354f8419
--- /dev/null
+++ b/templates/show_playlist_song_row.inc.php
@@ -0,0 +1,35 @@
+<?php
+/*
+
+ Copyright (c) 2001 - 2007 Ampache.org
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License v2
+ as published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+?>
+<td><?php echo $playlist_track; ?></td>
+<td><?php echo $song->f_link; ?></td>
+<td><?php echo $song->f_artist_link; ?></td>
+<td><?php echo $song->f_album_link; ?></td>
+<td><?php echo $song->f_genre_link; ?></td>
+<td><?php echo $song->f_track; ?></td>
+<td><?php echo $song->f_time; ?></td>
+<td>
+ <?php if ($GLOBALS['user']->prefs['download']) { ?>
+ <a href="<?php echo Config::get('web_path'); ?>/stream.php?action=download&amp;song_id=<?php echo $song->id; ?>">
+ <?php echo get_user_icon('download',_('Download')); ?>
+ </a>
+ <?php } ?>
+</td>
diff --git a/templates/show_playlist_songs.inc.php b/templates/show_playlist_songs.inc.php
new file mode 100644
index 00000000..d1479a90
--- /dev/null
+++ b/templates/show_playlist_songs.inc.php
@@ -0,0 +1,59 @@
+<?php
+/*
+
+ Copyright (c) 2001 - 2007 Ampache.org
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License v2
+ as published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+// First let's setup some vars we're going to use a lot
+$web_path = Config::get('web_path');
+$ajax_url = Config::get('ajax_url');
+?>
+<table class="tabledata" cellspacing="0" cellpadding="0">
+<tr>
+ <td colspan="8">
+ <?php require Config::get('prefix') . '/templates/list_header.inc.php'; ?>
+ </td>
+</tr>
+<tr class="table-header">
+ <th><?php echo _('Track'); ?></th>
+ <th onclick="ajaxPut('<?php echo $ajax_url; ?>?action=browse&amp;sort=title');return true;" style="cursor:pointer;">
+ <?php echo _('Song Title'); ?>
+ </th>
+ <th><?php echo _('Artist'); ?></th>
+ <th><?php echo _('Album'); ?></th>
+ <th><?php echo _('Genre'); ?></th>
+ <th><?php echo _('Track'); ?></th>
+ <th><?php echo _('Time'); ?></th>
+ <th><?php echo _('Action'); ?></th>
+</tr>
+<?php
+ foreach ($object_ids as $object) {
+ $song = new Song($object['object_id']);
+ $song->format();
+ $playlist_track = $object['track'];
+?>
+<tr class="<?php echo flip_class(); ?>" id="song_<?php echo $song->id; ?>">
+ <?php require Config::get('prefix') . '/templates/show_playlist_song_row.inc.php'; ?>
+</tr>
+<?php } ?>
+<tr>
+ <td colspan="8">
+ <?php require Config::get('prefix') . '/templates/list_header.inc.php'; ?>
+ </td>
+</tr>
+</table>
diff --git a/templates/show_random_albums.inc.php b/templates/show_random_albums.inc.php
index e8e4749d..6a15e58a 100644
--- a/templates/show_random_albums.inc.php
+++ b/templates/show_random_albums.inc.php
@@ -26,7 +26,7 @@ $web_path = Config::get('web_path');
foreach ($albums as $album_id) {
$album = new Album($album_id);
$album->format();
- $name = scrub_out('[' . $album->artist . '] ' . $album->name);
+ $name = scrub_out('[' . $album->f_artist . '] ' . $album->name);
?>
<div class="random_album">
<a href="<?php echo $web_path; ?>/albums.php?action=show&amp;album=<?php echo $album_id; ?>">