Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PHP Playlist

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server
View previous topic :: View next topic  
Author Message
MHz



Joined: 29 Jun 2008
Posts: 16

PostPosted: Sun Sep 07, 2008 9:50 am    Post subject: PHP Playlist Reply with quote

Hi all,

I was wondering if it is possible to create a playlist in PHP of all the songs played/currently playing/recently played, if yes, how do I do that? I searched the forum, but I couldnt find anything usefull

Thanks in advance
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Sun Sep 07, 2008 2:53 pm    Post subject: Reply with quote

If you cannot retrieve the information from the source client then you could try to get the information from the icecast playlist log.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
MHz



Joined: 29 Jun 2008
Posts: 16

PostPosted: Mon Sep 08, 2008 5:50 pm    Post subject: Reply with quote

Thanks, but then I get an entry like

Quote:
8/Sep/2008:19:41:26 +0200|/mainstream|0|Cascada - Everytime We Touch
I want it to be like this:

Quote:
8/Sep/2008:19:41:26 ATRIST - SONG


Or, if possible, like

Quote:
19:41:26 ARTIST - SONG
[/code]
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Mon Sep 08, 2008 6:16 pm    Post subject: Reply with quote

nobody is stopping you from converting the layout, we just provide the information, how you present it is completely up to you.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
MHz



Joined: 29 Jun 2008
Posts: 16

PostPosted: Tue Sep 09, 2008 12:45 pm    Post subject: Reply with quote

How can I change it then, do you have an example code?
Back to top
View user's profile Send private message
jcr
Modérateur français
Modérateur français


Joined: 14 Apr 2006
Posts: 544
Location: France, Auvergne

PostPosted: Fri Sep 12, 2008 1:53 pm    Post subject: Reply with quote

MHz wrote:

Quote:
8/Sep/2008:19:41:26 +0200|/mainstream|0|Cascada - Everytime We Touch
I want it to be like this:
Quote:
8/Sep/2008:19:41:26 ATRIST - SONG

Or, if possible, like
Quote:
19:41:26 ARTIST - SONG


From PHP, nothing prevents you from reformating strings.
ie:
Code:

$ar = explode( '|', $line ) ;
// Now you get an array with (using your sample):
// $ar[0] => '8/Sep/2008:19:41:26'
// $ar[1] => '/mainstream'
// $ar[2] => '0'
// $ar[3] => 'Cascada - Everytime We Touch'
//
// Now you can use this like you want
// ie:
$dt = explode( ':', $ar[0] ;
$re = implode( ':', array_shift( $dt ) )  . ' ' . $ar[3];

Or whatever else you need to format results.
_________________
Epsilon Friends Radio Icecast Radio on CentovaCast admin panel. Icecast hosting
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
author



Joined: 26 Dec 2008
Posts: 2
Location: Alexander NC

PostPosted: Tue Dec 30, 2008 3:02 pm    Post subject: Reply with quote

This gives me a nice 'cleaned up' list from a playlist:

Code:


$lines = file('/home/ralph/mp3/oldtimey/playlist_old.m3u');

$num = count($lines);

echo '<table border=1 class="sample" align=right><tr bgcolor=Goldenrod><td><b>Playlist - ' . $num. ' files</td></tr>
      ';

$i=0;
while ($i < $num + 1) {

echo '<tr><td>';

$temp = str_replace("_"," ",$lines[$i]);
$temp = str_replace("Blue","",$temp);
$temp = str_replace(".mp3","",$temp);
echo $temp;

echo '</td></tr>';

$i = $i + 1;

}

echo '</table><br><br>';


--Ralph[/code]
_________________
--Ralph Roberts
http://skyfest.net, http://1vid.com, http://abooks.com
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber