From 434ac8390a4ca5629a070ddb00e88d534a813eee Mon Sep 17 00:00:00 2001 From: TheTroll Date: Wed, 24 Feb 2010 16:07:12 +0100 Subject: Now support playing a full dir (still buggy) inc_home.php cleanup --- includes/inc_mp3.php | 76 +++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 64 insertions(+), 12 deletions(-) mode change 100644 => 100755 includes/inc_mp3.php (limited to 'includes/inc_mp3.php') diff --git a/includes/inc_mp3.php b/includes/inc_mp3.php old mode 100644 new mode 100755 index ad84162..f8b2320 --- a/includes/inc_mp3.php +++ b/includes/inc_mp3.php @@ -2,26 +2,78 @@ print "\r\n"; print "
\r\n"; print "
\r\n"; -print " Back
\r\n"; +print " Back\r\n"; +print "
\r\n"; print "
\r\n"; print " \"home\"
\r\n"; print "
iStreamdev
\r\n"; print "\r\n"; print "
\r\n"; -print "
\r\n"; +$dir_handle = @opendir($mediapath .$subdir); +if (!$dir_handle) + print "Unable to open $mediapath .$subdir"; +else while ($medianame = readdir($dir_handle)) +{ + // Add only mp3 files + + if(strstr($medianame, ".mp3") != ".mp3") + continue; + + $medianame_array[] = $medianame; +} + +if ($medianame_array[0]) +{ + // Alphabetical sorting + sort($medianame_array); + + $cnt = 1; + foreach($medianame_array as $value) + { + $medianame2=addslashes($value); + + print "
  • \r\n"; + print " \r\n"; + print " 1{$value}???\r\n"; + print " \r\n"; + print "
  • \r\n"; + + $cnt++; + } + + print "\r\n"; + + print "
    \r\n"; + + $count = count($medianame_array); + for ($cnt=0; $cnt < $count; $cnt++) + { + $idx=$cnt+1; + + print "\r\n"; + } + + print "
    "; +} +else + print "\r\n"; + +print "
    "; +print " "; +print " \r\n"; +print " \r\n"; +print "
    \r\n"; -print "
    "; -print "\" />"; -print ""; -print "
    "; ?> -- cgit v1.2.3