NZBGetter is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with NZBGetter. If not, see <http://www.gnu.org/licenses/>. */ error_reporting(E_ALL & ~E_NOTICE); # Load some clas libs require_once "../classes/nzbg_conf.class.php"; require_once "../classes/nzbg_log.class.php"; # Path to NZB queue $strPath = dirname(__FILE__) . "/../../__exec__/queue/"; # Create objects $appConfig = new nzbg_conf("config"); $objQueue = new nzbg_conf("queue"); $objNZBLog = new nzbg_log($appConfig); $arrQueue = $objQueue->get_xml_as_array(); $intID = $_GET['intID']; $strOldNZB = htmlspecialchars_decode($arrQueue[$_GET['intID']]['nzb']); $strNewNZB = strtolower($_GET['strNZBFile']); $strNewNZB = str_replace("/", "-", $strNewNZB); $strNewNZB = str_replace("&", "-", $strNewNZB); if (strpos($strNewNZB, ".nzb") === false) { $strNewNZB .= ".nzb"; } if (@rename($strPath . $strOldNZB, $strPath . $strNewNZB)) { # Update Queue record $arrUpdate = array('nzb' => htmlspecialchars($strNewNZB)); $objQueue->edit_download($intID, $arrUpdate); $objNZBLog->writeLine("Renamed " . $strOldNZB . " to " . $strNewNZB);
$templateJQ = new nzbg_template("jquery.log"); $jquery_depend = $templateJQ->contents(); break; case "run": # Load log template $templateRun = new nzbg_template("run"); $content = $templateRun->contents(); # This page has some page dependant jquery functionality $templateJQ = new nzbg_template("jquery.run"); $jquery_depend = $templateJQ->contents(); break; default: # No action, so it must be main $templateMain = new nzbg_template("main"); # Check queue $objQueue = new nzbg_conf("queue"); $intQueueRecords = $objQueue->count_records(); if ($intQueueRecords > 0) { $templateMainQueueMsg = new nzbg_template("main.queue.message"); $templateMainQueueMsg->replace("NUMBER", $intQueueRecords); $templateMain->replace("QUEUE_MESSAGE", $templateMainQueueMsg->contents()); } else { $templateMain->replace("QUEUE_MESSAGE", ""); } if ($appGeneral->ipmessageread == 0) { $templateIPMessage = new nzbg_template("main.ip.message"); $templateIPMessage->replace("CURRENTIP", getip()); $templateMain->replace("IP_MESSAGE", $templateIPMessage->contents()); # This page has some page dependant jquery functionality $templateJQ = new nzbg_template("jquery.main.ip.message"); $jquery_depend = $templateJQ->contents();
<?php /* NZBGetter 1.1a - http://sourceforge.net/projects/nzbgetter/ NZBGetter is a PHP Script for linux based systems to spider NZB index sites for NZB files matching your predefined search patterns. The script downloads matching NZB files and passes them to your Usenet Reader. Copyright 2009 Youri Tromp This file is part of NZBGetter. NZBGetter is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. NZBGetter is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with NZBGetter. If not, see <http://www.gnu.org/licenses/>. */ error_reporting(E_ALL & ~E_NOTICE); # Lets write the config file require_once "../classes/nzbg_conf.class.php"; $appGeneral = new nzbg_conf("general"); $appGeneral->ipmessageread = 1; $appGeneral->save();
NZBGetter is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. NZBGetter is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with NZBGetter. If not, see <http://www.gnu.org/licenses/>. */ error_reporting(E_ALL & ~E_NOTICE); # Lets write the config file require_once "../classes/nzbg_conf.class.php"; # Create download list object $objQueue = new nzbg_conf("queue"); # Path to NZB queue $strPath = dirname(__FILE__) . "/../../__exec__/queue/"; $html = '<br />There are currently no NZB files in the queue <br /><br />'; $arrQueue = $objQueue->get_xml_as_array(); if (count($arrQueue) > 0) { $html = '<br />Total of NZB files in queue: ' . $objQueue->count_records(); $html .= '<br /><br /><table id="tblDownloadList">'; $html .= '<thead>'; $html .= '<tr>'; $html .= '<th>Match on title</th>'; $html .= '<th>Date of match</th>'; $html .= '<th>NZB file</th>'; $html .= '<th>NZB size</th>'; $html .= '<th></th>'; $html .= '<th></th>';
} elseif (!is_numeric($strNZBIndexDays)) { echo 3; } elseif (!is_numeric($strNZBIndexResults)) { echo 4; } else { $appConfig = new nzbg_conf("config"); $appConfig->wgetpath = $strWgetFolder; $appConfig->nzbfolder = $strnzbfolder; $appConfig->tvnzbfeed = htmlspecialchars($strRSSTvNZB); $appConfig->tvnzbhd = htmlspecialchars($strTvNZBHD); $appConfig->tvnzbsd = htmlspecialchars($strTvNZBSD); $appConfig->nzbindexfeed = htmlspecialchars($strNZBIndex); $appConfig->nzbindexdays = htmlspecialchars($strNZBIndexDays); $appConfig->nzbindexresults = htmlspecialchars($strNZBIndexResults); $appConfig->logfilename = htmlspecialchars($strLogFile); $appConfig->maxloglines = $intMaxLinesLog; $appConfig->twitterenabled = $strTwitterEnabled; $appConfig->twitteruser = $strTwitterUser; $appConfig->twitterpass = base64_encode("f*bH3jbJHd3@b" . $strTwitterPass); $appConfig->twittermessage = $strTwitterMessage; $appConfig->save(); $appSettings = new nzbg_conf("general"); # First time settings save if ($appSettings->settingsapplied == 0) { $appSettings->settingsapplied = 1; $appSettings->save(); } $objNZBLog = new nzbg_log($appConfig); $objNZBLog->writeLine('Saved new NZBGetter settings'); echo 1; }
(at your option) any later version. NZBGetter is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with NZBGetter. If not, see <http://www.gnu.org/licenses/>. */ error_reporting(E_ALL & ~E_NOTICE); # Lets write the config file require_once "../classes/nzbg_conf.class.php"; require_once "../classes/nzbg_log.class.php"; # Show downloadlist $show_list = true; # Create download list object $objDownload = new nzbg_conf("download"); # Needs to be save type if (isset($_GET['type']) and $_GET['type'] == "save") { $strDLSource = $_GET['strDLSource']; $strDLTitle = htmlspecialchars($_GET['strDLTitle']); $strDLMatch = htmlspecialchars($_GET['strDLMatch']); $strDLHow = $_GET['strDLHow']; $intMinSize = (int) $_GET['intMinSize']; $strDLQual = htmlspecialchars($_GET['strDLQual']); $arrNew = array("type" => $strDLSource, "title" => $strDLTitle, "findstring" => $strDLMatch, "downloadtype" => $strDLHow); if ($strDLSource == "tvnzb") { $arrNew["quality"] = $strDLQual; } if ($strDLSource == "nzbindex") { $arrNew["minsize"] = $intMinSize; }
$strTweet = str_replace('%nzbgetter', $objSettings->title . ' ' . $objSettings->version, $strTweet); } $twitter_enabled = true; } else { $_msg = "PHP cURL is not enabled, so no tweets are send!"; $objNZBLog->writeLine($_msg); if ($run_mode) { $run_mode_result = $_msg . "<br />"; } } } # Instantiate download list object and retreive download list as an array $objDownload = new nzbg_conf("download"); $arrDownloadList = $objDownload->get_xml_as_array(); # Instantiate queue list object $objQueue = new nzbg_conf("queue"); # Instantiate a rss object to retreive tvnzb feed $obj_tvnzb = new rss_php(); $obj_tvnzb->load($appConfig->tvnzbfeed); # There are no problems loading the RSS if ($obj_tvnzb->errorcode == 0) { # Load the tvnzb feed into an array $arrTVNzbs = $obj_tvnzb->getItems(true); # Well, let's loop tvnzb foreach ($arrTVNzbs as $current_nzb) { $current_key = 0; # We need to compare it against our downloadlist foreach ($arrDownloadList as $downloadentry) { # Type needs to be tvnzb if ($downloadentry['type'] == "tvnzb") { # Fetch title from feed and get string to compare, all to be lowercase