Old 23rd February 2003, 01:53   #1
Opie-T
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...
Opie-T is offline   Reply With Quote
Old 24th February 2003, 17:56   #2
FesterHead
Alumni
 
FesterHead's Avatar
 
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.

FesterHead is offline   Reply With Quote
Old 24th February 2003, 19:44   #3
Opie-T
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.
Opie-T is offline   Reply With Quote
Old 18th May 2003, 17:40   #4
trexter
Junior Member
 
Join Date: Apr 2003
Posts: 7
Is there a similiar program which stores the information in an Access database instead?

trexter is offline   Reply With Quote
Old 18th May 2003, 17:42   #5
trexter
Junior Member
 
Join Date: Apr 2003
Posts: 7
And also: Do you install this on the server or on the streaming machine?

trexter is offline   Reply With Quote
Old 18th May 2003, 23:00   #6
FesterHead
Alumni
 
FesterHead's Avatar
 
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.

FesterHead is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Shoutcast > Shoutcast Technical Support

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump