From 902ee1ab48b46fa117aad0e3508f58df40bcbe3e Mon Sep 17 00:00:00 2001 From: TheTroll Date: Tue, 23 Feb 2010 13:58:42 +0100 Subject: Fixed empty or lonely timers Print the status of the timer modifications --- includes/inc_vdr.php | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) (limited to 'includes/inc_vdr.php') diff --git a/includes/inc_vdr.php b/includes/inc_vdr.php index d6eb269..be2f798 100755 --- a/includes/inc_vdr.php +++ b/includes/inc_vdr.php @@ -299,7 +299,17 @@ function vdrlisttimers() $timers = $svdrp->Command("LSTT"); $svdrp->Disconnect(); - foreach($timers as $timer) + if (gettype($timers) == "string") + { + if ($timers == "") + return; + else + $timersarray[] = $timers; + } + else + $timersarray = $timers; + + foreach($timersarray as $timer) { // Extract timer # $timerarray = explode(" ", $timer); @@ -309,7 +319,13 @@ function vdrlisttimers() print "
  • "; print " "; - print " \"list\""; + + if ($type & 0x8) + print " \"list\""; + else if ($type & 0x1) + print " \"list\""; + else + print " \"list\""; print " {$date}: {$channame}"; @@ -329,24 +345,29 @@ function vdrdeltimer($timer=0) $svdrp = new SVDRP($svdrpip, $svdrpport); $svdrp->Connect(); - $svdrp->Command("DELT " .$timer); + $ret = $svdrp->Command("DELT " .$timer); $svdrp->Disconnect(); + + return $ret; } -function vdrsettimer($channame, $date, $stime, $etime, $desc) +function vdrsettimer($prevtimer, $channame, $date, $stime, $etime, $desc) { global $svdrpip, $svdrpport; $channum = vdrgetchannum($channame); - $timer = "1:" .$channum .":" .$date .":" .$stime .":" .$etime .":99:99:" .$desc; - - print $timer; + if ($prevtimer == -1) + $command = "NEWT 1:" .$channum .":" .$date .":" .$stime .":" .$etime .":99:99:" .$desc; + else + $command = "MODT " .$prevtimer ." 1:" .$channum .":" .$date .":" .$stime .":" .$etime .":99:99:" .$desc; $svdrp = new SVDRP($svdrpip, $svdrpport); $svdrp->Connect(); - $svdrp->Command("NEWT " .$timer); + $ret = $svdrp->Command($command); $svdrp->Disconnect(); + + return $ret; } ?> -- cgit v1.2.3