Пример #1
0
 // get nfo
 //
 case "gn":
     if (!isset($_GET["id"])) {
         showApiError(200);
     }
     $page->users->addApiRequest($uid, $_SERVER['REQUEST_URI'], $hosthash);
     $reldata = $releases->getByGuid($_GET["id"]);
     if (!$reldata) {
         showApiError(300);
     }
     $nfo = $releases->getReleaseNfo($reldata["id"], true);
     if (!$nfo) {
         showApiError(300);
     }
     $nforaw = Utility::cp437toUTF($nfo["nfo"]);
     $page->smarty->assign('release', $reldata);
     $page->smarty->assign('nfo', $nfo);
     $page->smarty->assign('nfoutf', $nforaw);
     if (isset($_GET["raw"])) {
         header("Content-type: text/x-nfo");
         header("Content-Disposition: attachment; filename=" . str_replace(" ", "_", $reldata["searchname"]) . ".nfo");
         echo $nforaw;
         die;
     } else {
         $page->smarty->assign('rsstitle', "NFO");
         $page->smarty->assign('rssdesc', "NFO");
         $content = trim($page->smarty->fetch('apinfo.tpl'));
         printOutput($relData, $outputXML, $page, $offset);
     }
     break;
Пример #2
0
<?php

use newznab\utility\Utility;
$releases = new Releases();
if (!$page->users->isLoggedIn()) {
    $page->show403();
}
if (isset($_GET["id"])) {
    $rel = $releases->getByGuid($_GET["id"]);
    if (!$rel) {
        $page->show404();
    }
    $nfo = $releases->getReleaseNfo($rel['id']);
    $nfo['nfoUTF'] = Utility::cp437toUTF($nfo['nfo']);
    $page->smarty->assign('rel', $rel);
    $page->smarty->assign('nfo', $nfo);
    $page->title = "NFO File";
    $page->meta_title = "View Nfo";
    $page->meta_keywords = "view,nzb,nfo,description,details";
    $page->meta_description = "View Nfo File";
    $modal = false;
    if (isset($_GET['modal'])) {
        $modal = true;
        $page->smarty->assign('modal', true);
    }
    $page->content = $page->smarty->fetch('viewnfo.tpl');
    if ($modal) {
        echo $page->content;
    } else {
        $page->render();
    }
Пример #3
0
<?php

//
// Script will dump out all nfos in the system into a folder based on the date posted to usenet ./YYYYMMDD/release.nfo
// Its not very efficient to pull them all out, should really work out which day you need and go from there.
//
require_once dirname(__FILE__) . '/../../www/config.php';
$db = new \newznab\db\Settings();
$res = $db->queryDirect("select releases.searchname, releases.postdate, uncompress(releasenfo.nfo) as nfo from releases inner join releasenfo on releases.ID = releasenfo.releaseID and releasenfo.nfo is not null order by postdate");
while ($row = $db->getAssocArray($res)) {
    $dir = date("Ymd", strtotime($row["postdate"]));
    if (!file_exists($dir)) {
        mkdir($dir);
    }
    $filename = $dir . "/" . safeFilename($row["searchname"]) . ".nfo";
    if (!file_exists($filename)) {
        $fh = fopen($filename, 'w');
        fwrite($fh, \newznab\utility\Utility::cp437toUTF($row["nfo"]));
        fclose($fh);
    }
}