From 547fd24f4b448e7b56c91c91bfc2630521c50ac6 Mon Sep 17 00:00:00 2001 From: TheTroll Date: Sun, 28 Feb 2010 12:58:58 +0100 Subject: Added a button to delete all sessions --- includes/inc_home.php | 18 +++++++++++++++--- includes/inc_session.php | 27 +++++++++++++++++++++++++++ includes/include.php | 5 +++++ 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/includes/inc_home.php b/includes/inc_home.php index c4416ba..f38518c 100755 --- a/includes/inc_home.php +++ b/includes/inc_home.php @@ -70,9 +70,21 @@ if ($dir_handle) } if (!$sessioncnt) - print "
  • none

  • \r\n"; - -print " \r\n"; +{ + print "
  • none

  • \r\n"; + print "\r\n"; +} +else +{ + print "\r\n"; + print "
    \r\n"; + print " \r\n"; + print " \r\n"; + print "
    \r\n"; +} // VDR menus if ($vdrenabled) diff --git a/includes/inc_session.php b/includes/inc_session.php index 743fcf3..1b8f755 100755 --- a/includes/inc_session.php +++ b/includes/inc_session.php @@ -47,6 +47,33 @@ function sessioncreate($type, $name, $title, $desc, $qname, $qparams, $category, } function sessiondelete($session) +{ + if ($session == 'all') + { + $dir_handle = @opendir('ram/'); + if ($dir_handle) + { + while ($session = readdir($dir_handle)) + { + 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); + + if ($type) + sessiondeletesingle($session); + } + } + } + else + return sessiondeletesingle($session); +} + +function sessiondeletesingle($session) { $ram = "ram/" .$session ."/"; diff --git a/includes/include.php b/includes/include.php index 05a2ce6..de9cfa4 100755 --- a/includes/include.php +++ b/includes/include.php @@ -54,6 +54,11 @@ function selectpage() case ("stream"): include('includes/inc_stream.php'); break; + case ("stopallstreamings"): + sessiondelete('all'); + $_SESSION['currentcat'] = NULL; + include('includes/inc_home.php'); + break; case ("listcategory"): include('includes/inc_cat.php'); break; -- cgit v1.2.3