Skip to Content
It is currently October 24th, 2019, 12:09 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Date Last Played?
PostPosted: September 25th, 2019, 10:47 am 
Offline
Senior User
Senior User

Joined: July 23rd, 2007, 2:22 am
Posts: 117
Hi team, I saw a webpage using SAM/PHP that showed the last date a song was played.

In class.song.php I saw that there was this code:

Code:
public $date_played;


However, when I added it to display.playing.php, it shows me the current date and time, even if the track has been played more than once. I need it to display the last time it was played, not that it's being played right now.

How do I achieve this? Is there another variable in class.song.php I can add? Where can I get a list of the variables that are not listed in this file?

_________________
Park Magic Radio
http://parkmagicradio.ca


Top
 Profile  
Reply with quote  
 Post subject: Re: Date Last Played?
PostPosted: September 26th, 2019, 8:23 am 
Offline
SVS Member
SVS Member

Joined: May 8th, 2004, 9:00 am
Posts: 10449
Location: Denver, CO
Since you are displaying the currently playing song info, date_played is updated in the songlist table immediately upon playing, you will have to search the historylist (the song ID) table to get the last time it played before the current playing (offset the results by 1 to eliminate the current playing date).

_________________
- Rob Oyler, SVS
Image


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group