diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-12-27 18:38:14 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-12-27 18:38:14 +0000 |
commit | 2e6c6e4646596c2485a6fb7bce491deb9c3ad95c (patch) | |
tree | 7c6839703eb606b81c408b17ce92b234a002cb41 /templates/show_recently_played.inc.php | |
parent | b75f24356951b8b9d31029232be223e03dd3e8e6 (diff) | |
download | ampache-2e6c6e4646596c2485a6fb7bce491deb9c3ad95c.tar.gz ampache-2e6c6e4646596c2485a6fb7bce491deb9c3ad95c.tar.bz2 ampache-2e6c6e4646596c2485a6fb7bce491deb9c3ad95c.zip |
added X ago to the recently played
Diffstat (limited to 'templates/show_recently_played.inc.php')
-rw-r--r-- | templates/show_recently_played.inc.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/templates/show_recently_played.inc.php b/templates/show_recently_played.inc.php index 164d797b..3693dc27 100644 --- a/templates/show_recently_played.inc.php +++ b/templates/show_recently_played.inc.php @@ -18,6 +18,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Define the time places starting at 0 */ +$time_unit = array('',_('seconds ago'),_('minutes ago'),_('hours ago'),_('days ago'),_('weeks ago'),_('months ago'),_('years ago')); + ?> <?php show_box_top(_('Recently Played')); ?> <table> @@ -26,10 +30,22 @@ <td><?php echo _('Song'); ?></td> <td><?php echo _('Album'); ?></td> <td><?php echo _('Artist'); ?></td> + <td> </td> </tr> <?php foreach ($data as $row) { $row_user = new User($row['user']); $song = new Song($row['object_id']); + $amount = intval(time() - $row['date']); + $time_place = '0'; + + while ($amount >= 1) { + $final = $amount; + $time_place++; + $amount = floor($amount/60); + } + + $time_string = $final . ' ' . $time_unit[$time_place]; + $song->format_song(); ?> <tr> @@ -41,6 +57,7 @@ <td><?php echo $song->f_link; ?></td> <td><?php echo $song->f_album_link; ?></td> <td><?php echo $song->f_artist_link; ?></td> + <td><?php echo $time_string; ?></td> </tr> <?php } ?> </table> |