コード例 #1
0
ファイル: SpotNntp.php プロジェクト: rmeijer/spotweb
 function getNzb($segList)
 {
     $nzb = '';
     foreach ($segList as $seg) {
         $nzb .= implode('', $this->getBody('<' . $seg . '>'));
     }
     # foreach
     $spotParser = new SpotParser();
     return gzinflate($spotParser->unspecialZipStr($nzb));
 }
コード例 #2
0
ファイル: index.php プロジェクト: Nerd-alert/spotweb
     /* Get the NZB file */
     $nzb = false;
     if (is_array($xmlar['segment'])) {
         foreach ($xmlar['segment'] as $seg) {
             $nzb .= implode("", $nzb_spotnntp->getBody("<" . $seg . ">"));
         }
         # foreach
     } else {
         $nzb .= implode("", $nzb_spotnntp->getBody("<" . $xmlar['segment'] . ">"));
     }
     # if
     if ($nzb !== false) {
         if ($settings['nzb_download_local'] == true) {
             $myFile = $settings['nzb_local_queue_dir'] . $xmlar['title'] . ".nzb";
             $fh = fopen($myFile, 'w') or die("Unable to open file");
             $stringData = gzinflate($spotParser->unspecialZipStr($nzb));
             fwrite($fh, $stringData);
             fclose($fh);
             echo "NZB toegevoegd aan queue : " . $myFile;
         } else {
             Header("Content-Type: application/x-nzb");
             Header("Content-Disposition: attachment; filename=\"" . $xmlar['title'] . ".nzb\"");
             echo gzinflate($spotParser->unspecialZipStr($nzb));
         }
     } else {
         echo "Unable to get NZB file: " . $nzb_spotnntp->getError();
     }
     # else
 } catch (Exception $x) {
     die($x->getMessage());
 }