From f53d604d4c363ff1336f9ff2faccefced45b2108 Mon Sep 17 00:00:00 2001 From: TheTroll Date: Tue, 23 Feb 2010 14:23:54 +0100 Subject: Implemented timer activation function --- includes/inc_edittimer.php | 13 ++++++------- includes/inc_vdr.php | 10 +++++++--- includes/include.php | 7 ++++--- 3 files changed, 17 insertions(+), 13 deletions(-) (limited to 'includes') diff --git a/includes/inc_edittimer.php b/includes/inc_edittimer.php index c736c03..b2ffb36 100755 --- a/includes/inc_edittimer.php +++ b/includes/inc_edittimer.php @@ -10,20 +10,19 @@ print "
iStream
\r\n"; print "\r\n"; $timer = $_REQUEST['timer']; if ($timer == -1) -{ -print "
New Timer\r\n"; -} + print "
New Timer\r\n"; else -{ -print "
Edit Timer\r\n"; -} + print "
Edit Timer\r\n"; list($type, $channame, $date, $stime, $etime, $desc) = vdrgettimerinfo($timer); // Timer name print "
\r\n"; print "
    \r\n"; -print "
  • Active
  • \r\n"; +if ($type & 0x1) + print "
  • Active
  • \r\n"; +else + print "
  • Active
  • \r\n"; print "
\r\n"; print "
    \r\n"; print "
  • Recording name
  • \r\n"; diff --git a/includes/inc_vdr.php b/includes/inc_vdr.php index ca89b87..7f1f408 100755 --- a/includes/inc_vdr.php +++ b/includes/inc_vdr.php @@ -351,16 +351,20 @@ function vdrdeltimer($timer=0) return $ret; } -function vdrsettimer($prevtimer, $channame, $date, $stime, $etime, $desc) +function vdrsettimer($prevtimer, $channame, $date, $stime, $etime, $desc, $active) { global $svdrpip, $svdrpport; $channum = vdrgetchannum($channame); + if ($active) + $type = "1"; + else + $type = "0"; if ($prevtimer == -1) - $command = "NEWT 1:" .$channum .":" .$date .":" .$stime .":" .$etime .":99:99:" .$desc; + $command = "NEWT " .$type .":" .$channum .":" .$date .":" .$stime .":" .$etime .":99:99:" .$desc; else - $command = "MODT " .$prevtimer ." 1:" .$channum .":" .$date .":" .$stime .":" .$etime .":99:99:" .$desc; + $command = "MODT " .$prevtimer ." " .$type .":" .$channum .":" .$date .":" .$stime .":" .$etime .":99:99:" .$desc; $svdrp = new SVDRP($svdrpip, $svdrpport); $svdrp->Connect(); diff --git a/includes/include.php b/includes/include.php index 6fe31ad..d244ba5 100755 --- a/includes/include.php +++ b/includes/include.php @@ -56,13 +56,14 @@ function selectpage() delete_timer($timer); break; case ("addtimer"): + $active = $_REQUEST['timer_active']; $channame = $_REQUEST['timer_chan']; $date = $_REQUEST['timer_date']; $stime = $_REQUEST['timer_starttime']; $etime = $_REQUEST['timer_endtime']; $desc = $_REQUEST['timer_name']; $prevtimer = $_REQUEST['prevtimer']; - set_timer($channame, $date, $stime, $etime, $desc, $prevtimer); + set_timer($active, $channame, $date, $stime, $etime, $desc, $prevtimer); break; case ("startstream"): $type = $_REQUEST['type']; @@ -163,9 +164,9 @@ function delete_timer($timer) include('includes/inc_timers.php'); } -function set_timer($channame, $date, $stime, $etime, $desc, $prevtimer) +function set_timer($active, $channame, $date, $stime, $etime, $desc, $prevtimer) { - $ret = vdrsettimer($prevtimer, $channame, $date, $stime, $etime, $desc); + $ret = vdrsettimer($prevtimer, $channame, $date, $stime, $etime, $desc, $active); if ($prevtimer == -1) $settype = "creat"; -- cgit v1.2.3