From 06f7a094d0aef395f7bcf6123f2678b1cf48429e Mon Sep 17 00:00:00 2001 From: TheTroll Date: Mon, 22 Feb 2010 18:15:11 +0100 Subject: Now show current timers (WIP) --- includes/inc_timers.php | 28 +++++++++++------- includes/inc_vdr.php | 79 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 11 deletions(-) mode change 100644 => 100755 includes/inc_timers.php (limited to 'includes') diff --git a/includes/inc_timers.php b/includes/inc_timers.php old mode 100644 new mode 100755 index bf14074..9d66e27 --- a/includes/inc_timers.php +++ b/includes/inc_timers.php @@ -7,23 +7,29 @@ print "
iStreamdev
\r\n"; print "\r\n"; print "
\r\n"; print " Timers\r\n"; -print " "; print " "; -print "
\r\n"; +a ?> diff --git a/includes/inc_vdr.php b/includes/inc_vdr.php index 7e52d4b..0a7f48a 100755 --- a/includes/inc_vdr.php +++ b/includes/inc_vdr.php @@ -94,6 +94,29 @@ function vdrgetinfostream($stream = "NULL", $ischan = 1) return array($epgtitle, $epgdesc, $channame); } +function vdrgettimerinfo($timernum=0) +{ + 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]; + $channame = vdrgetchanname($channel); + $date = $timerarray[2]; + $starthour = $timerarray[3]; + $endhour = $timerarray[4]; + $desc = $timerarray[7]; + + return array($type, $channame, $date, $starthour, $endhour, $desc); +} + function vdrgetchannum($chan = "NULL") { global $svdrpip, $svdrpport; @@ -113,6 +136,25 @@ function vdrgetchannum($chan = "NULL") return $channum; } +function vdrgetchanname($channum = 0) +{ + global $svdrpip, $svdrpport; + + $svdrp = new SVDRP($svdrpip, $svdrpport); + $svdrp->Connect(); + $channel = $svdrp->Command("LSTC " .$channum); + $svdrp->Disconnect(); + + // Get channel name + $chanarray = explode(":", $channel); + $chanarray = explode(";", $chanarray[0]); + $channame = $chanarray[0]; + $channame = substr($channame, strlen($channum)+1); + + return $channame; +} + + function vdrlistcategories() { global $vdrchannels; @@ -209,4 +251,41 @@ function vdrlistchannels($category = "NULL") } fclose($fp); } + +function vdrlisttimers() +{ + global $svdrpip, $svdrpport; + + $svdrp = new SVDRP($svdrpip, $svdrpport); + $svdrp->Connect(); + $timers = $svdrp->Command("LSTT"); + $svdrp->Disconnect(); + + foreach($timers as $timer) + { + // Extract timer # + $timerarray = explode(" ", $timer); + $timernum = $timerarray[0]; + + list($type, $channame, $date, $starthour, $endhour, $desc) = vdrgettimerinfo($timernum); + + print "
  • "; + print " "; + print " \"list\""; + + print " {$date}: {$channame}"; + + print " "; + print "
  • "; + + print "
    "; + print " "; + print " "; + print "
    "; + } +} + + + + ?> -- cgit v1.2.3