From ff270318f7859bb99de1dc679ad3093c31f304dd Mon Sep 17 00:00:00 2001 From: TheTroll Date: Wed, 24 Feb 2010 17:20:04 +0100 Subject: Now redirect single files to playlist frontend (still buggy, file is not played yert) Remove audiotypes conf (we only support native safari ext) --- includes/inc_media.php | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'includes/inc_media.php') diff --git a/includes/inc_media.php b/includes/inc_media.php index 441ce3f..d0f94c1 100755 --- a/includes/inc_media.php +++ b/includes/inc_media.php @@ -1,6 +1,7 @@ "; print "
  • Current path:

    {$subdir}

  • "; // Option to play dir +$audioextarray = explode(' ', $audiotypes); +$playlist = 0; +foreach ($audioextarray as $num => $audioext) +{ + if (glob($mediapath .$subdir .'*.' .$audioext)) + $playlist = 1; +} -if (glob($mediapath .$subdir ."*.mp3")) +if ($playlist) { print "
  • \r\n"; print " \r\n"; @@ -63,6 +71,8 @@ if ($medianame_array[0]) { // Alphabetical sorting sort($medianame_array); + + $audiocnt=0; foreach($medianame_array as $value) { @@ -88,9 +98,7 @@ if ($medianame_array[0]) $fileext = end(explode(".", $value)); // Check if it is supported - if ( preg_match("/" .$fileext ." /", $videotypes) - || preg_match("/" .$fileext ." $/", $videotypes) - ) + if ( preg_match("/" .$fileext ." /", $videotypes) || preg_match("/" .$fileext ." $/", $videotypes) ) { print "
  • \r\n"; print " \r\n"; @@ -106,12 +114,12 @@ if ($medianame_array[0]) print " "; print "\r\n"; } - else if ( preg_match("/" .$fileext ." /", $audiotypes) - || preg_match("/" .$fileext ."$/", $audiotypes) - ) + else if ( preg_match("/" .$fileext ." /", $audiotypes) || preg_match("/" .$fileext ."$/", $audiotypes) ) { + $audiocnt++; + print "
  • \r\n"; - print " \r\n"; + print " \r\n"; print " \r\n"; print " $value\r\n"; print " \r\n"; -- cgit v1.2.3