[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
Support Forum • View topic - Date Last Played? - spacial.com
Skip to Content
It is currently October 3rd, 2023, 7:58 am

All times are UTC - 6 hours [ DST ]




 [ 14 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: 176
Location: Vancouver, BC, Canada

_________________
Park Magic Radio
http://parkmagicradio.ca


Top
 Profile  
 
 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: 10572
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  
 
 Post subject: Re: Date Last Played?
PostPosted: March 3rd, 2020, 12:13 am 
Offline
Senior User
Senior User

Joined: July 23rd, 2007, 2:22 am
Posts: 176
Location: Vancouver, BC, Canada
Hi DJ Cassio, I can get it to pull the date from the historylist's date_played table, but when I offset it with -1 as you suggest, it takes an entire year off the last played date. Here is my PHP:

Last Played: <?php echo $currentSong->date_played -date()-1; ?>

If it was played today on March 2, 2020, it would say "2019".

Any ideas?

_________________
Park Magic Radio
http://parkmagicradio.ca


Top
 Profile  
 
 Post subject: Re: Date Last Played?
PostPosted: March 3rd, 2020, 7:39 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8306
Location: Cologne (Germany)
Take a step back and reread the post by DJ Cassio.
There's no mentioning of offsetting the date_played field.

You take the songID from the current song, query the historylist for that song and pick the second to last entry (when ordered by date descending).

There is no field in the songlist table (or the latest historylist entry for that matter) telling you the second to last time a track has played.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
 
 Post subject: Re: Date Last Played?
PostPosted: March 4th, 2020, 8:18 am 
Offline
SVS Member
SVS Member

Joined: May 8th, 2004, 9:00 am
Posts: 10572
Location: Denver, CO

_________________
- Rob Oyler, SVS
Image


Top
 Profile  
 
 Post subject: Re: Date Last Played?
PostPosted: March 4th, 2020, 10:16 pm 
Offline
Senior User
Senior User

Joined: July 23rd, 2007, 2:22 am
Posts: 176
Location: Vancouver, BC, Canada

_________________
Park Magic Radio
http://parkmagicradio.ca


Top
 Profile  
 
 Post subject: Re: Date Last Played?
PostPosted: March 5th, 2020, 7:47 am 
Offline
SVS Member
SVS Member

Joined: May 8th, 2004, 9:00 am
Posts: 10572
Location: Denver, CO

_________________
- Rob Oyler, SVS
Image


Top
 Profile  
 
 Post subject: Re: Date Last Played?
PostPosted: August 1st, 2022, 12:30 am 
Offline
Senior User
Senior User

Joined: July 23rd, 2007, 2:22 am
Posts: 176
Location: Vancouver, BC, Canada

_________________
Park Magic Radio
http://parkmagicradio.ca


Top
 Profile  
 
 Post subject: Re: Date Last Played?
PostPosted: August 9th, 2022, 6:11 am 
Offline
Junior User
Junior User

Joined: February 22nd, 2019, 1:20 pm
Posts: 27
I have read the whole post and I still do not understand where exactly you want to have placed the last date played info. I took a look into your website: Do you want to add last played info into "Recently Played" section ? or somewhere ?
Find attached a screenshot with my current played info and history - as example. I didn't use SAM page templates, the page is my own creation - but all the information displayed is used and generated with SAM tools available. My page is created as html and not php. But I think there is no difference in SAM html / php output reference. I may be corrected if I'm wrong.


Attachments:
bod history.jpg
bod history.jpg [ 49.22 KiB | Viewed 3120 times ]
Top
 Profile  
 
 Post subject: Re: Date Last Played?
PostPosted: August 10th, 2022, 8:25 pm 
Offline
Senior User
Senior User

Joined: July 23rd, 2007, 2:22 am
Posts: 176
Location: Vancouver, BC, Canada
Hello rolandwelker, thanks for your reply. Yes, you are exactly right, I wish to display the last date and time a song played in my "Currently Playing" section adjacent to the album art, alongside all the other info displayed. How did you accomplish this?

_________________
Park Magic Radio
http://parkmagicradio.ca


Top
 Profile  
 
 Post subject: Re: Date Last Played?
PostPosted: August 11th, 2022, 1:42 pm 
Offline
Junior User
Junior User

Joined: February 22nd, 2019, 1:20 pm
Posts: 27
Hi dan40, as I wrote before - I am using html output tools from SAM (Not using SAM php templates). All those info in my screenshot, last played, Info generated etc. have been generated from SAM by using the tag types and variables in SAM "Help" section, => html output section, => html output, =>Overview. As I am not familiar the way you create your output it may differ from php page generation. Initially I was in the same situation as you roughly 12 years ago, it was a mess to modify SAMs existing web templates, so I decided to create my web pages of my own using all that stuff from html output section which was much easier to create and to control. Find attached screenshots for more info. Find below objects inserted to create my history file as displayed in my pevious post:
<!--history.songtype="S"--> [Only displaying Song info - no jingles or whatever]
<!--LOOP(history,1,5)--> [Number of songs displayed]
<!--LOOP_ROW--> [Followed by Loop end]
$history.buycd$
$history.no$
$history.picture$
$history.artist$
$history.title$
$history.album$
$history.albumyear$
$history.date_played$

But as I wrote: I am not sure if these commands work within the php templates supplied with SAM. I am using those commands inside my own php or html templates created from SAM and uploaded to my my webspace.


Attachments:
variables.jpg
variables.jpg [ 106.93 KiB | Viewed 3091 times ]
Top
 Profile  
 
 Post subject: Re: Date Last Played?
PostPosted: August 12th, 2022, 10:10 pm 
Offline
Senior User
Senior User

Joined: July 23rd, 2007, 2:22 am
Posts: 176
Location: Vancouver, BC, Canada

_________________
Park Magic Radio
http://parkmagicradio.ca


Top
 Profile  
 
 Post subject: Re: Date Last Played?
PostPosted: August 12th, 2022, 10:57 pm 
Offline
Senior User
Senior User

Joined: July 23rd, 2007, 2:22 am
Posts: 176
Location: Vancouver, BC, Canada

_________________
Park Magic Radio
http://parkmagicradio.ca


Top
 Profile  
 
 Post subject: Re: Date Last Played?
PostPosted: August 13th, 2022, 12:21 pm 
Offline
Junior User
Junior User

Joined: February 22nd, 2019, 1:20 pm
Posts: 27
Yeah, I think the magic ist the word "history": => history.date_played <=, as everything regarding history like "history.artist" etc. (View my listing in my post above). You can find additional info at the buttom of the help section from SAM how to use.


Attachments:
help_02.jpg
help_02.jpg [ 213.49 KiB | Viewed 3074 times ]
Top
 Profile  
 
Display posts from previous:  Sort by  
 [ 14 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 15 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