summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorTheTroll <trolldev@gmail.com>2010-02-27 02:12:43 +0100
committerTheTroll <trolldev@gmail.com>2010-02-27 02:12:43 +0100
commit32b78254c76ebd9a07ad19edf25f1f0846a33bb8 (patch)
treed517c7bef969a6498d40fb64106c41363cfc36f7 /includes
parent0c9414a9fecf2278d468acb1cf184e776b5a15c7 (diff)
downloadistreamdev-32b78254c76ebd9a07ad19edf25f1f0846a33bb8.tar.gz
istreamdev-32b78254c76ebd9a07ad19edf25f1f0846a33bb8.tar.bz2
Sessions WIP
Diffstat (limited to 'includes')
-rwxr-xr-xincludes/inc_home.php39
-rwxr-xr-xincludes/inc_session.php7
-rwxr-xr-xincludes/inc_streaminfo.php4
-rwxr-xr-xincludes/inc_streaming.php7
4 files changed, 47 insertions, 10 deletions
diff --git a/includes/inc_home.php b/includes/inc_home.php
index 0c372ac..bc9a402 100755
--- a/includes/inc_home.php
+++ b/includes/inc_home.php
@@ -9,20 +9,45 @@ print "</div>\r\n";
print "<div id=\"content\">\r\n";
// Streaming in progress
-$dir_handle = @opendir('ram');
+$dir_handle = @opendir('ram/');
if ($dir_handle)
{
- print " <span class=\"graytitle\">Streaming...</span>\r\n";
print " <ul class=\"pageitem\">\r\n";
while ($session = readdir($dir_handle))
{
- if (!is_dir($session))
+ if($session == "." || $session == ".." || $session == 'lost+found')
+ continue;
+
+ if (!is_dir('ram/' .$session))
continue;
+ // Get info
+ list($type, $realname, $title, $desc, $mode, $category, $url, $mediapath, $subdir) = readinfostream($session);
+
+ switch ($type)
+ {
+ case 1:
+ $sessionname = "Live: ";
+ $picto = "tv";
+ break;
+ case 2:
+ $sessionname = "Rec: ";
+ $picto = "rec";
+ break;
+ case 3:
+ $sessionname = "Media: ";
+ $picto = "media";
+ break;
+ default:
+ continue;
+ }
+
+ $sessionname .= $realname;
+
print " <li class=\"menu\">";
print " <a href=\"javascript:sendForm('{$session}');\">";
- print " <img src=\"images/pictos/tv.png\" />";
- print " <span class=\"name\">{$session}</span><span class=\"arrow\"></span>";
+ print " <img src=\"images/pictos/{$picto}.png\" />";
+ print " <span class=\"name\">{$sessionname}</span><span class=\"arrow\"></span>";
print " </a>";
print " </li>\r\n";
print " <form name=\"{$session}\" id=\"{$session}\" method=\"post\" action=\"index.php\">";
@@ -30,7 +55,9 @@ if ($dir_handle)
print " <input name=\"session\" type=\"hidden\" id=\"session\" value=\"{$session}\" />";
print " </form>\r\n";
}
- print " </ul>\r\n";
+ print " </ul>\r\n";
+
+ closedir($dir_handle);
}
// VDR menus
diff --git a/includes/inc_session.php b/includes/inc_session.php
index c74d780..5c06c0c 100755
--- a/includes/inc_session.php
+++ b/includes/inc_session.php
@@ -26,11 +26,14 @@ function sessioncreate($type, $name, $title, $desc, $qname, $qparams, $category,
}
$cmd = str_replace('%', '%%', $cmd);
- exec($cmd);
+ exec ($cmd);
// Write streaminfo
writeinfostream($session, $type, $name, $title, $desc, $qname, $category, $url, $mediapath, $subdir);
+ // Copy status waiter
+ exec('cp streamstatus.php ram/' .$session);
+
return $session;
}
@@ -54,4 +57,6 @@ function sessiondelete($session)
$cmd= $subcmd ."rm -rf " .$ram;
exec ($cmd);
+}
+
?>
diff --git a/includes/inc_streaminfo.php b/includes/inc_streaminfo.php
index e41b24f..4124396 100755
--- a/includes/inc_streaminfo.php
+++ b/includes/inc_streaminfo.php
@@ -32,10 +32,10 @@ function readinfostream($session)
{
$ram = "ram/" .$session ."/";
- if (!file_exists($session ."streaminfo"))
+ if (!file_exists($ram ."streaminfo"))
return array(0, "", "", "", "");
- $infofile = fopen($session ."streaminfo", 'r');
+ $infofile = fopen($ram ."streaminfo", 'r');
if (!$infofile)
return array(0, "", "", "", "");
diff --git a/includes/inc_streaming.php b/includes/inc_streaming.php
index 9da377f..a294a9d 100755
--- a/includes/inc_streaming.php
+++ b/includes/inc_streaming.php
@@ -11,11 +11,15 @@ $ram = "ram/" .$session ."/";
// Get current stream info
list($type, $realname, $title, $desc, $mode, $category, $url, $mediapath, $subdir) = readinfostream($session);
-print "<body onorientationchange=\"updateOrientation();\" onload=\"ajax();\">\r\n";
+print "<body onorientationchange=\"updateOrientation();\" onload=\"ajax('{$session}');\">\r\n";
print "<div id=\"topbar\" class=\"transparent\">\r\n";
print "<div id=\"leftnav\">\r\n";
print "<a href=\"javascript:sendForm('stopstream');\">Stop Stream</a></div>\r\n";
+
+print "<div id=\"rightnav\">\r\n";
+print "<a href=\"index.php\"><img alt=\"home\" src=\"images/home.png\" /></a></div>\r\n";
+
print "<div id=\"title\">iStreamdev</div>\r\n";
print "</div>\r\n";
@@ -43,6 +47,7 @@ print " </div>\r\n";
print " <form name=\"stopstream\" id=\"stopstream\" method=\"post\" action=\"index.php\">";
print " <input name=\"action\" type=\"hidden\" id=\"action\" value=\"stopstream\" />";
+print " <input name=\"session\" type=\"hidden\" id=\"session\" value=\"{$session}\" />";
print " <input name=\"type\" type=\"hidden\" id=\"type\" value={$type} />";
switch ($type)
{