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_epg.php | 0 includes/inc_timers.php | 3 ++- includes/inc_utils.php | 0 includes/inc_vdr.php | 72 +++++++++++++++++++++++++++++++++++++------------ includes/include.php | 9 +------ index.php | 3 ++- 6 files changed, 60 insertions(+), 27 deletions(-) mode change 100644 => 100755 includes/inc_epg.php mode change 100644 => 100755 includes/inc_utils.php diff --git a/includes/inc_epg.php b/includes/inc_epg.php old mode 100644 new mode 100755 diff --git a/includes/inc_timers.php b/includes/inc_timers.php index 9d66e27..c5ce230 100755 --- a/includes/inc_timers.php +++ b/includes/inc_timers.php @@ -25,7 +25,8 @@ print " "; print " "; print " "; print "
"; -print " "; +print " "; +print " "; print "
"; print ""; diff --git a/includes/inc_utils.php b/includes/inc_utils.php old mode 100644 new mode 100755 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; diff --git a/includes/include.php b/includes/include.php index 4810227..46e758f 100755 --- a/includes/include.php +++ b/includes/include.php @@ -48,9 +48,6 @@ function selectpage() case ("timers"): gen_timers(); break; - case ("new_timer"): - gen_new_timer(); - break; case ("edit_timer"): gen_edit_timer(); break; @@ -111,13 +108,9 @@ function gen_timers() { include('includes/inc_timers.php'); } -function gen_new_timer() -{ - include('new_timer.html'); -} function gen_edit_timer() { - include('edit_timer.html'); + include('includes/inc_edittimer.php'); } diff --git a/index.php b/index.php index 6da5d22..4daef4e 100755 --- a/index.php +++ b/index.php @@ -15,11 +15,12 @@ include('includes/include.php'); iStreamdev +