From 3d72b276b17a920a3f319afd2aec44d7bdf7a40e Mon Sep 17 00:00:00 2001 From: TheTroll Date: Wed, 24 Feb 2010 22:54:18 +0100 Subject: Better management of audio/video media --- includes/inc_audio.php | 120 ++++++++++++++++++++++++++++++++++++++ includes/inc_files.php | 28 +++++++++ includes/inc_media.php | 153 +++---------------------------------------------- includes/inc_mp3.php | 99 -------------------------------- includes/inc_video.php | 103 +++++++++++++++++++++++++++++++++ includes/include.php | 2 + 6 files changed, 260 insertions(+), 245 deletions(-) create mode 100755 includes/inc_audio.php delete mode 100755 includes/inc_mp3.php create mode 100755 includes/inc_video.php (limited to 'includes') diff --git a/includes/inc_audio.php b/includes/inc_audio.php new file mode 100755 index 0000000..458689f --- /dev/null +++ b/includes/inc_audio.php @@ -0,0 +1,120 @@ +\r\n"; +print "
\r\n"; +print "
\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 "
"); + + print "
\r\n"; + $idx = 1; + for ($cnt=0; $cnt < $count; $cnt++) + { + // Audio files + if (mediagettype($mediapath .$subdir .$medianame_array[$cnt]) == 2) + { + print "\""; + $next++; + } + } + + print " />\r\n"; + + $idx++; + } + } + print("
"); +} +else + print "\r\n"; + +$upsubdir = dirname($subdir); + +print "
\r\n"; +print " \r\n"; +print " \r\n"; +print " \r\n"; +print "
\r\n"; + +?> + diff --git a/includes/inc_files.php b/includes/inc_files.php index f593ba9..7a6f5a8 100755 --- a/includes/inc_files.php +++ b/includes/inc_files.php @@ -1,5 +1,7 @@ $audioext) + if (glob($dir .'*.' .$audioext)) + return 1; + return 0; +} diff --git a/includes/inc_media.php b/includes/inc_media.php index eaed547..e0f7cb9 100755 --- a/includes/inc_media.php +++ b/includes/inc_media.php @@ -1,156 +1,17 @@ \r\n"; -print "
\r\n"; -print "
\r\n"; - -if ($subdir == '/') - print "\"home\"
\r\n"; +// Use the right media type +if (mediadirhasaudio($mediapath .$subdir)) + include ('includes/inc_audio.php'); else -{ - print "Back
\r\n"; - print "
\r\n"; - print "\"home\"
\r\n"; -} - -print "
iStreamdev
\r\n"; -print "\r\n"; - -print "
\r\n"; -print " Media\r\n"; -print "
"; -print "
\r\n"; + include ('includes/inc_video.php'); ?> diff --git a/includes/inc_mp3.php b/includes/inc_mp3.php deleted file mode 100755 index 85553e6..0000000 --- a/includes/inc_mp3.php +++ /dev/null @@ -1,99 +0,0 @@ -\r\n"; -else - print "\r\n"; - -print "
\r\n"; -print "
\r\n"; -print " Back\r\n"; -print "
\r\n"; -print "
\r\n"; -print " \"home\"
\r\n"; - -global $httppath; - -print "
iStreamdev
\r\n"; -print "
\r\n"; -print "
\r\n"; -print "
\r\n"; - - print "
\r\n"; - - $count = count($medianame_array); - for ($cnt=0; $cnt < $count; $cnt++) - { - $idx=$cnt+1; - - print "\""; - $next++; - } - - print " />\r\n"; - } - - print "
"; -} -else - print "\r\n"; - -print "
"; -print " "; -print " \r\n"; -print " \r\n"; -print "
\r\n"; - -?> - diff --git a/includes/inc_video.php b/includes/inc_video.php new file mode 100755 index 0000000..d933a04 --- /dev/null +++ b/includes/inc_video.php @@ -0,0 +1,103 @@ +\r\n"; +print "
\r\n"; +print "
\r\n"; + +if ($subdir == '/') + print "\"home\"
\r\n"; +else +{ + print "Back
\r\n"; + print "
\r\n"; + print "\"home\"
\r\n"; +} + +print "
iStreamdev
\r\n"; +print "\r\n"; + +print "
\r\n"; +print " Media\r\n"; +print "
"; +print "
\r\n"; +?> diff --git a/includes/include.php b/includes/include.php index f8819dd..a409f45 100755 --- a/includes/include.php +++ b/includes/include.php @@ -10,6 +10,8 @@ include ('includes/inc_vdr.php'); include ('includes/inc_files.php'); include ('includes/inc_streaminfo.php'); +$audiotypes='mp3 aac'; + function selectpage() { $action = $_REQUEST['action']; -- cgit v1.2.3