mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-03 09:49:30 +02:00
added single song view
This commit is contained in:
parent
49cea7da0c
commit
ab6ecea9db
4 changed files with 107 additions and 10 deletions
|
@ -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
|
||||
|
|
|
@ -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&song_id=" . $this->id . "\"> " . scrub_out($this->f_title) . "</a>";
|
||||
$this->f_link = "<a href=\"" . Config::get('web_path') . "/song.php?action=show_song&song_id=" . $this->id . "\"> " . scrub_out($this->f_title) . "</a>";
|
||||
$this->f_album_link = "<a href=\"" . Config::get('web_path') . "/albums.php?action=show&album=" . $this->album . "\"> " . scrub_out($this->f_album) . "</a>";
|
||||
$this->f_artist_link = "<a href=\"" . Config::get('web_path') . "/artists.php?action=show&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&genre_id=" . $this->genre . "\">$this->f_genre</a>";
|
||||
|
||||
|
||||
// Format the Time
|
||||
$min = floor($this->time/60);
|
||||
$sec = sprintf("%02d", ($this->time%60) );
|
||||
|
@ -702,9 +701,9 @@ 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
|
||||
|
|
39
song.php
Normal file
39
song.php
Normal file
|
@ -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();
|
||||
|
||||
?>
|
58
templates/show_song.inc.php
Normal file
58
templates/show_song.inc.php
Normal file
|
@ -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(); ?>
|
Loading…
Add table
Add a link
Reference in a new issue