From 6d2af1fac7bd066b75ebd237cc538e29fd21b729 Mon Sep 17 00:00:00 2001 From: TheTroll Date: Wed, 24 Feb 2010 14:16:31 +0100 Subject: Now support media sources instead of only one media path (see the $mediasources config variable) Changed the way we browse dirs (with a mediapath and a subdir) --- includes/inc_home.php | 51 ++++++++++++++++++++++++------------ includes/inc_media.php | 62 +++++++++++++++++++++----------------------- includes/inc_stream.php | 63 ++++++++++++++++++++++++++------------------- includes/inc_streaminfo.php | 10 +++++-- includes/include.php | 8 +++--- 5 files changed, 113 insertions(+), 81 deletions(-) (limited to 'includes') diff --git a/includes/inc_home.php b/includes/inc_home.php index 4996969..9515860 100755 --- a/includes/inc_home.php +++ b/includes/inc_home.php @@ -1,30 +1,47 @@ \r\n"; print "
\r\n"; print "
iStreamdev
\r\n"; print "
\r\n"; print "
\r\n"; + +// VDR menus if ($vdrenabled) { - print " VDR\r\n"; - print " "; + print " VDR\r\n"; + print " "; +} + +// Media menus +print " MEDIA\r\n"; +print " "; print "
"; ?> diff --git a/includes/inc_media.php b/includes/inc_media.php index f39272a..9da2798 100755 --- a/includes/inc_media.php +++ b/includes/inc_media.php @@ -1,45 +1,41 @@ \r\n"; print "
\r\n"; print "
\r\n"; -if ($dir == $mediapath) + +if ($subdir == '/') print "\"home\"
\r\n"; else - print "Back
\r\n"; -if ($dir != $mediapath) { + 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"; print "
"; - print " "; - print " "; + print " "; + print " "; print " "; switch ($type) { case 1: print " "; break; - case 2: - case 3: + case 3: + print " \r\n"; + print " \r\n"; + // NO BREAK + case 2: print " "; break; @@ -166,48 +169,56 @@ else foreach ($quality as $qname => $qparams) { - print " \r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; + print " \r\n"; switch ($type) { case 1: - print " \r\n"; + print " \r\n"; break; - case 2: case 3: - print " \r\n"; + $mediapath = $_REQUEST['mediapath']; + $subdir = $_REQUEST['subdir']; + print " \r\n"; + print " \r\n"; + // NO BREAK + case 2: + print " \r\n"; break; } - print "
"; + print " "; } - print "
"; + print " "; switch ($type) { case 1: - print " "; - print " "; + print " "; + print " "; break; default: case 2: $dir = dirname($name); - print " "; - print " "; + print " "; + print " "; break; case 3: + $mediapath = $_REQUEST['mediapath']; + $subdir = $_REQUEST['subdir']; $dir = dirname($name); - print " "; - print " "; + print " "; + print " \r\n"; + print " \r\n"; break; } - print "
\r\n"; + print " \r\n"; } diff --git a/includes/inc_streaminfo.php b/includes/inc_streaminfo.php index a45920c..5342573 100755 --- a/includes/inc_streaminfo.php +++ b/includes/inc_streaminfo.php @@ -8,7 +8,7 @@ 3 : Media */ -function writeinfostream($type=0, $name="", $title="", $desc="", $mode="", $category="", $url="") +function writeinfostream($type=0, $name="", $title="", $desc="", $mode="", $category="", $url="", $mediapath="", $subdir="") { $infofile = fopen("ram/streaminfo", 'w'); @@ -19,6 +19,8 @@ function writeinfostream($type=0, $name="", $title="", $desc="", $mode="", $cate fwrite($infofile, "mode=" .$mode ."\n"); fwrite($infofile, "category=" .$category ."\n"); fwrite($infofile, "url=" .$url ."\n"); + fwrite($infofile, "mediapath=" .$mediapath ."\n"); + fwrite($infofile, "subdir=" .$subdir ."\n"); fclose($infofile); } @@ -46,11 +48,15 @@ function readinfostream() $category = substr($line, strlen("category="), -1); else if (!strncmp($line, "url=", strlen("url="))) $url = substr($line, strlen("url="), -1); + else if (!strncmp($line, "mediapath=", strlen("mediapath="))) + $mediapath = substr($line, strlen("mediapath="), -1); + else if (!strncmp($line, "subdir=", strlen("subdir="))) + $subdir = substr($line, strlen("subdir="), -1); } fclose($infofile); - return array($type, $name, $title, $desc, $mode, $category, $url); + return array($type, $name, $title, $desc, $mode, $category, $url, $mediapath, $subdir); } function infostreamexist() diff --git a/includes/include.php b/includes/include.php index 2bf7aa8..5985ffa 100755 --- a/includes/include.php +++ b/includes/include.php @@ -74,7 +74,9 @@ function selectpage() $qparams = $_REQUEST['qparams']; $category = $_REQUEST['category']; $url = $_REQUEST['url']; - start_stream($type, $name, $title, $desc, $qname, $qparams, $category, $url); + $mediapath = $_REQUEST['mediapath']; + $subdir = $_REQUEST['subdir']; + start_stream($type, $name, $title, $desc, $qname, $qparams, $category, $url, $mediapath, $subdir); break; default: gen_home(); @@ -129,7 +131,7 @@ function gen_edit_timer() -function start_stream($type, $name, $title, $desc, $qname, $qparams, $category, $url) +function start_stream($type, $name, $title, $desc, $qname, $qparams, $category, $url, $mediapath, $subdir) { global $httppath, $ffmpegpath, $segmenterpath; @@ -150,7 +152,7 @@ function start_stream($type, $name, $title, $desc, $qname, $qparams, $category, exec ($cmd); // Write streaminfo - writeinfostream($type, $name, $title, $desc, $qname, $category, $url); + writeinfostream($type, $name, $title, $desc, $qname, $category, $url, $mediapath, $subdir); include('includes/inc_stream.php'); } -- cgit v1.2.3