From fc92552204c6d9fb43ab196230b279b2d1dd4597 Mon Sep 17 00:00:00 2001 From: TheTroll Date: Fri, 26 Mar 2010 17:19:31 +0100 Subject: EPG update --- bin/vdr.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/vdr.php b/bin/vdr.php index 045bb4e..8e634bb 100755 --- a/bin/vdr.php +++ b/bin/vdr.php @@ -301,11 +301,17 @@ function vdrgetepgat($channum, $at) $time = substr($epg[$i], 2); $timearray = explode(" ", $time); - $time = date('H\hi', $timearray[1]) ."-" .date('H\hi', $timearray[1]+$timearray[2]); + $starttime = $timearray[1]; + $endtime = $timearray[2]; - $date = date('Y\/m\/d', $timearray[1]); + $time = date('H\hi', $starttime) ."-" .date('H\hi', $endtime); + $date = date('Y\/m\/d', $starttime); - $endtime = $timearray[1]+$timearray[2]; + $currenttime = time(); + if (($currenttime >= $starttime) && ($currenttime < $endtime)) + $running = "yes"; + else + $running = "no"; } } @@ -315,7 +321,7 @@ function vdrgetepgat($channum, $at) if (!is_utf8($desc)) $desc = utf8_encode($desc); - return array($date, $time, $title, $desc, $endtime); + return array($date, $time, $title, $desc, $endtime, $running); } function vdrgetfullepgat($channel, $at, $programs) @@ -549,7 +555,7 @@ function vdrgetepg($channel, $time, $day, $programs, $extended) if ($extended) { - list ($chanentry['date'], $chanentry['time'], $chanentry['title'], $chanentry['desc']) = vdrgetepgat($channel, "at " .$requesteddate); + list ($chanentry['date'], $chanentry['time'], $chanentry['title'], $chanentry['desc'], $endtime, $chanentry['running']) = vdrgetepgat($channel, "at " .$requesteddate); $chanentry['name'] = vdrgetchanname($channel); return $chanentry; } -- cgit v1.2.3