Connect(); $allepg = $svdrp->Command("LSTE NOW"); $svdrp->Disconnect(); $allepgfilled = 1; } $channame = $stream; } else { $infofile = $vdrrecpath .$stream ."/info"; if (file_exists($infofile)) $info= file_get_contents($infofile); else { $infofile = $vdrrecpath .$stream ."/info.vdr"; if (file_exists($infofile)) $info= file_get_contents($infofile); else $info=""; } $allepg = explode("\n", $info); } if ($ischan) $chanfound = 0; else $chanfound = 1; $epgtitlefound = 0; $epgtitle=""; $epgdesc=""; // For all epg $count = count($allepg); for ($i = 0; $i < $count; $i++) { // Find the right chan (take the first one) if ($chanfound == 0) { if (strstr($allepg[$i], $stream) == $stream) $chanfound = 1; } else { // Now find T or C if(ereg("^C", $allepg[$i])) { // Check if it is our chan too, else search again if ($ischan) { if(!ereg("$stream$", $allepg[$i])) { $chanfound = 0; continue; } } else { $channame = substr($allepg[$i], 2); $channames = explode(" ", $channame); $channame = substr($channame, strlen($channames[0])); } } else if(ereg("^T", $allepg[$i])) $epgtitle=substr($allepg[$i], 2); else if(ereg("^D", $allepg[$i])) $epgdesc=substr($allepg[$i], 2); } } return array($epgtitle, $epgdesc, $channame); } function vdrgetchannum($chan = "NULL") { global $svdrpip, $svdrpport; $svdrp = new SVDRP($svdrpip, $svdrpport); $svdrp->Connect(); $channels = $svdrp->Command("LSTC"); $svdrp->Disconnect(); // Get channel number $channels = preg_grep(quotemeta('"'.$chan.';|'.$chan.':"'), $channels); reset($channels); $channels = explode(" ", $channels[key($channels)]); $channum = $channels[0]; return $channum; } function vdrlistcategories() { global $vdrchannels; // All chans print "