From e897147a3acb1ca4baacf0f5fec976a0ea8c90ee Mon Sep 17 00:00:00 2001 From: TheTroll Date: Mon, 22 Feb 2010 21:58:26 +0100 Subject: Fixed timers edit Add new timer link to edit timer Timers are not yet settable though --- includes/inc_vdr.php | 72 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 55 insertions(+), 17 deletions(-) (limited to 'includes/inc_vdr.php') diff --git a/includes/inc_vdr.php b/includes/inc_vdr.php index 0a7f48a..79eb22e 100755 --- a/includes/inc_vdr.php +++ b/includes/inc_vdr.php @@ -94,27 +94,40 @@ function vdrgetinfostream($stream = "NULL", $ischan = 1) return array($epgtitle, $epgdesc, $channame); } -function vdrgettimerinfo($timernum=0) +function vdrgettimerinfo($timernum=-1) { global $svdrpip, $svdrpport; - $svdrp = new SVDRP($svdrpip, $svdrpport); - $svdrp->Connect(); - $timer = $svdrp->Command("LSTT " .$timernum); - $svdrp->Disconnect(); - - $timerarray = explode(":", $timer); - - $typearray = explode(" ", $timerarray[0]); - $type = $typearray[1]; - $channel = $timerarray[1]; + if ($timernum != -1) + { + $svdrp = new SVDRP($svdrpip, $svdrpport); + $svdrp->Connect(); + $timer = $svdrp->Command("LSTT " .$timernum); + $svdrp->Disconnect(); + + $timerarray = explode(":", $timer); + + $typearray = explode(" ", $timerarray[0]); + $type = $typearray[1]; + $channel = $timerarray[1]; + $date = $timerarray[2]; + $stime = $timerarray[3]; + $etime = $timerarray[4]; + $desc = $timerarray[7]; + } + else + { + $type = 1; + $channel = 1; + $date = date('Y-m-d'); + $stime = date('Hi'); + $etime = date('Hi'); + $desc = "New timer"; + } + $channame = vdrgetchanname($channel); - $date = $timerarray[2]; - $starthour = $timerarray[3]; - $endhour = $timerarray[4]; - $desc = $timerarray[7]; - - return array($type, $channame, $date, $starthour, $endhour, $desc); + + return array($type, $channame, $date, $stime, $etime, $desc); } function vdrgetchannum($chan = "NULL") @@ -252,6 +265,31 @@ function vdrlistchannels($category = "NULL") fclose($fp); } +function vdrlistchannelsdrop($chansel = "") +{ + global $vdrchannels; + + $chanselected = 0; + + $fp = fopen ($vdrchannels,"r"); + while ($line = fgets($fp, 1024)) + { + if ($line[0] == ":") + continue; + + $channels = explode(":", $line); + $channels = explode(";", $channels[0]); + $chan = $channels[0]; + if (($chan == $chansel) && !$chanselected) + { + print ""; + $chanselected = 1; + } + else + print ""; + } +} + function vdrlisttimers() { global $svdrpip, $svdrpport; -- cgit v1.2.3