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_media.php | 50 +++++++++++++++++++++++++------- includes/inc_mp3.php | 76 +++++++++++++++++++++++++++++++++++++++++-------- includes/inc_stream.php | 2 -- includes/include.php | 76 +++++++++++-------------------------------------- streammusic.php | 14 +++++---- 5 files changed, 128 insertions(+), 90 deletions(-) mode change 100644 => 100755 includes/inc_mp3.php mode change 100644 => 100755 streammusic.php diff --git a/includes/inc_media.php b/includes/inc_media.php index 9da2798..fe09f32 100755 --- a/includes/inc_media.php +++ b/includes/inc_media.php @@ -26,11 +26,25 @@ else print "
iStreamdev
\r\n"; print "\r\n"; + print "
\r\n"; -print " Media\r\n"; -print "
"; -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 "
    "; ?> diff --git a/includes/inc_stream.php b/includes/inc_stream.php index ff15d51..aa3179b 100755 --- a/includes/inc_stream.php +++ b/includes/inc_stream.php @@ -203,7 +203,6 @@ else print " "; print " "; break; - default: case 2: $dir = dirname($name); print " "; @@ -212,7 +211,6 @@ else case 3: $mediapath = $_REQUEST['mediapath']; $subdir = $_REQUEST['subdir']; - $dir = dirname($name); print " "; print " \r\n"; print " \r\n"; diff --git a/includes/include.php b/includes/include.php index 5985ffa..716d1a6 100755 --- a/includes/include.php +++ b/includes/include.php @@ -28,32 +28,33 @@ function selectpage() switch ($action) { case ("stream"): - gen_stream(); + include('includes/inc_stream.php'); break; case ("listcategory"): - gen_category(); + include('includes/inc_cat.php'); break; case ("listchannels"): - gen_channels(); + include('includes/inc_chan.php'); break; case ("recordings"): - gen_recordings(); + include('includes/inc_rec.php'); break; case ("media"): - gen_media(); + include('includes/inc_media.php'); break; case ("epg"): - gen_epg(); + include('includes/inc_epg.php'); break; case ("timers"): - gen_timers(); + include('includes/inc_timers.php'); break; case ("edittimer"): - gen_edit_timer(); + include('includes/inc_edittimer.php'); break; case ("deletetimer"): $timer = $_REQUEST['timer']; delete_timer($timer); + include('includes/inc_timers.php'); break; case ("addtimer"): $active = $_REQUEST['timer_active']; @@ -64,6 +65,7 @@ function selectpage() $desc = $_REQUEST['timer_name']; $prevtimer = $_REQUEST['prevtimer']; set_timer($active, $channame, $date, $stime, $etime, $desc, $prevtimer); + include('includes/inc_timers.php'); break; case ("startstream"): $type = $_REQUEST['type']; @@ -77,60 +79,18 @@ function selectpage() $mediapath = $_REQUEST['mediapath']; $subdir = $_REQUEST['subdir']; start_stream($type, $name, $title, $desc, $qname, $qparams, $category, $url, $mediapath, $subdir); + include('includes/inc_stream.php'); break; - default: - gen_home(); + case ("playdir"): + include('includes/inc_mp3.php'); + break; + default: + $_SESSION['currentcat'] = NULL; + include('includes/inc_home.php'); break; } } -function gen_home() -{ - $_SESSION['currentcat'] = NULL; - include('includes/inc_home.php'); -} - -function gen_category() -{ - include('includes/inc_cat.php'); -} - -function gen_channels() -{ - include('includes/inc_chan.php'); -} - -function gen_stream() -{ - include('includes/inc_stream.php'); -} - - -function gen_recordings() -{ - include('includes/inc_rec.php'); -} - -function gen_media() -{ - include('includes/inc_media.php'); -} - -function gen_epg() -{ - include('includes/inc_epg.php'); -} -function gen_timers() -{ - include('includes/inc_timers.php'); -} -function gen_edit_timer() -{ - include('includes/inc_edittimer.php'); -} - - - function start_stream($type, $name, $title, $desc, $qname, $qparams, $category, $url, $mediapath, $subdir) { global $httppath, $ffmpegpath, $segmenterpath; @@ -181,8 +141,6 @@ function set_timer($active, $channame, $date, $stime, $etime, $desc, $prevtimer) $message = "
  • {$retarray[0]}

  • "; else $message = "
  • Timer {$settype}ed successfully

  • "; - - include('includes/inc_timers.php'); } ?> diff --git a/streammusic.php b/streammusic.php old mode 100644 new mode 100755 index ab93cce..8dbcbfe --- a/streammusic.php +++ b/streammusic.php @@ -1,16 +1,18 @@ -- cgit v1.2.3