summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-11-13 04:31:50 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-11-13 04:31:50 +0000
commitab6ecea9dbc4b53a7442db6f3695d68f9ba36f99 (patch)
tree49ad7fdd12fc4b862d0debb709d9bda445202502
parent49cea7da0ca3052de33dc69e643c2364c36b22ac (diff)
downloadampache-ab6ecea9dbc4b53a7442db6f3695d68f9ba36f99.tar.gz
ampache-ab6ecea9dbc4b53a7442db6f3695d68f9ba36f99.tar.bz2
ampache-ab6ecea9dbc4b53a7442db6f3695d68f9ba36f99.zip
added single song view
-rwxr-xr-xdocs/CHANGELOG1
-rw-r--r--lib/class/song.class.php19
-rw-r--r--song.php39
-rw-r--r--templates/show_song.inc.php58
4 files changed, 107 insertions, 10 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index 5d91af9e..be94e802 100755
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -4,6 +4,7 @@
--------------------------------------------------------------------------
v.3.4-Alpha3
+ - Added single song view
- Added Play Select drop down back in
- Fixed ordering of catalogs
- Fixed multi-genre Random Play
diff --git a/lib/class/song.class.php b/lib/class/song.class.php
index d39aef1a..e912e511 100644
--- a/lib/class/song.class.php
+++ b/lib/class/song.class.php
@@ -677,7 +677,7 @@ class Song {
$this->f_title = truncate_with_ellipsis($this->title,Config::get('ellipse_threshold_title'));
// Create Links for the different objects
- $this->f_link = "<a href=\"" . Config::get('web_path') . "/stream.php?action=single_song&amp;song_id=" . $this->id . "\"> " . scrub_out($this->f_title) . "</a>";
+ $this->f_link = "<a href=\"" . Config::get('web_path') . "/song.php?action=show_song&amp;song_id=" . $this->id . "\"> " . scrub_out($this->f_title) . "</a>";
$this->f_album_link = "<a href=\"" . Config::get('web_path') . "/albums.php?action=show&amp;album=" . $this->album . "\"> " . scrub_out($this->f_album) . "</a>";
$this->f_artist_link = "<a href=\"" . Config::get('web_path') . "/artists.php?action=show&amp;artist=" . $this->artist . "\"> " . scrub_out($this->f_artist) . "</a>";
@@ -688,7 +688,6 @@ class Song {
$this->f_genre = $this->get_genre_name();
$this->f_genre_link = "<a href=\"" . Config::get('web_path') . "/genre.php?action=show_genre&amp;genre_id=" . $this->genre . "\">$this->f_genre</a>";
-
// Format the Time
$min = floor($this->time/60);
$sec = sprintf("%02d", ($this->time%60) );
@@ -702,14 +701,14 @@ class Song {
return true;
- } // format_song
+ } // format
- /*!
- * @function get_rel_path
- * @discussion returns the path of the song file stripped of the catalog path
- * used for mpd playback
- */
- function get_rel_path($file_path=0,$catalog_id=0) {
+ /**
+ * @function get_rel_path
+ * @discussion returns the path of the song file stripped of the catalog path
+ * used for mpd playback
+ */
+ function get_rel_path($file_path=0,$catalog_id=0) {
if (!$file_path) {
$info = $this->_get_info();
@@ -724,7 +723,7 @@ class Song {
$catalog_path = rtrim($catalog_path, "/");
return( str_replace( $catalog_path . "/", "", $file_path ) );
- } // get_rel_path
+ } // get_rel_path
/*!
diff --git a/song.php b/song.php
new file mode 100644
index 00000000..be55fbbf
--- /dev/null
+++ b/song.php
@@ -0,0 +1,39 @@
+<?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.
+
+*/
+
+require 'lib/init.php';
+
+show_header();
+
+// Switch on Action
+switch ($_REQUEST['action']) {
+ default:
+ case 'show_song':
+ $song = new Song($_REQUEST['song_id']);
+ $song->format();
+ $song->fill_ext_info();
+ require_once Config::get('prefix') . '/templates/show_song.inc.php';
+ break;
+} // end data collection
+
+show_footer();
+
+?>
diff --git a/templates/show_song.inc.php b/templates/show_song.inc.php
new file mode 100644
index 00000000..9f7b19e5
--- /dev/null
+++ b/templates/show_song.inc.php
@@ -0,0 +1,58 @@
+<?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.
+
+*/
+?>
+<?php show_box_top($song->title . ' ' . _('Details')); ?>
+<table class="tabledata" cellspacing="0" cellpadding="0">
+<tr>
+ <td><?php echo _('Title'); ?></td>
+ <td><?php echo scrub_out($song->title); ?></td>
+</tr>
+<tr>
+ <td><?php echo _('Artist'); ?></td>
+ <td><?php echo $song->f_artist_link; ?></td>
+</tr>
+<tr>
+ <td><?php echo _('Album'); ?></td>
+ <td><?php echo $song->f_album_link; ?> (<?php echo scrub_out($song->year); ?>)</td>
+</tr>
+<tr>
+ <td><?php echo _('Genre'); ?></td>
+ <td><?php echo $song->f_genre_link; ?></td>
+</tr>
+<tr>
+ <td><?php echo _('Bitrate'); ?></td>
+ <td><?php echo scrub_out($song->f_bitrate); ?></td>
+</tr>
+<tr>
+ <td><?php echo _('Filename'); ?></td>
+ <td><?php echo scrub_out($song->file); ?> (<?php echo $song->f_size; ?>MB)</td>
+</tr>
+<?php if ($song->update_time) { ?>
+<tr>
+ <td><?php echo _('Last Updated'); ?></td>
+ <td><?php echo date("d/m/Y H:i",$song->update_time); ?></td>
+</tr>
+<?php } ?>
+<tr>
+ <td><?php echo _('Added'); ?></td>
+ <td><?php echo date("d/m/Y H:i",$song->addition_time); ?></td>
+</table>
+<?php show_box_bottom(); ?>