|
|
|
|
#1 |
|
Junior Member
Join Date: Jan 2001
Posts: 15
|
Displaying time on html page
Okay, here's the thing... I'm looking for a php-code to display the time left of a song on my web page... kind-a-like the one foundon http://www.festerhead.com or http://www.industrialradio.net
Hope someone can help... |
|
|
|
|
|
#2 |
|
Alumni
Join Date: Sep 2001
Location: Maui, Hawaii
Posts: 14,108
|
I use SAM which stores tune information in a MySQL database.
When someone hits my site, I grab the servers time now (let's call this X) and query the database for the currently playng song and find out when it started (let's call this Y) and it's duration (let's call this Z). Then, I do ((Z + Y) - X) using PHP date math to get the seconds remaining. Last, the seconds remaining is passed to a JavaScript utility to do the countdown. Do a "view source" on my site for more information. |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jan 2001
Posts: 15
|
Thanx!
I'll check it out! If possible... could you give me a code sniplet???
Last edited by Opie-T; 24th February 2003 at 22:24. |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Apr 2003
Posts: 7
|
Is there a similiar program which stores the information in an Access database instead?
|
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Apr 2003
Posts: 7
|
And also: Do you install this on the server or on the streaming machine?
|
|
|
|
|
|
#6 |
|
Alumni
Join Date: Sep 2001
Location: Maui, Hawaii
Posts: 14,108
|
Short answer to your questions:
Yes and either one. Long answer to your questions: The DNAS only knows when a song played, not it's duration. If you use an mp3 database utility (some may use Microsoft Access as the underlying database), then you might be able to join up the DNAS mp3 name with the database mp3 name to get more details about the tune. This won't work too well if you have more than 1 version of the same song title/artist pair unless you force some trickery into naming tunes. |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|