Пример #1
0
     if (@rename(dirname(__FILE__) . '/__exec__/queue/' . $arrQueueList[$intEntryID]['nzb'], $appConfig->nzbfolder . $arrQueueList[$intEntryID]['nzb'])) {
         $objQueue->delete_download($intEntryID);
         $arrPlaceholders = array('ITEM' => $arrQueueList[$intEntryID]['nzb'], 'FONT_COLOR' => 'black', 'COLOR' => 'green');
         $objNZBLog->writeLine("Processed \"" . $arrQueueList[$intEntryID]['nzb'] . "\" to incoming NZB directory.");
         # Tweet ?
         if ($appConfig->twitterenabled == "yes") {
             if (function_exists('curl_init')) {
                 # Instantiate a Twitter object
                 $objTwitter = new twitter($appConfig->twitteruser, substr(base64_decode($appConfig->twitterpass), 13));
                 $strTweet = $appConfig->twittermessage;
                 if (strpos($strTweet, '%nzbgetter') !== false) {
                     $objSettings = new nzbg_conf("general");
                     $strTweet = str_replace('%nzbgetter', $objSettings->title . ' ' . $objSettings->version, $strTweet);
                 }
                 $strTweet = str_replace('%download', $arrQueueList[$intEntryID]['matchtitle'], $strTweet);
                 $objTwitter->updateStatus($strTweet);
                 $objNZBLog->writeLine("Tweeting download " . $arrQueueList[$intEntryID]['matchtitle']);
             }
         }
     } else {
         $arrPlaceholders = array('ITEM' => 'An error occured! Please try again.', 'FONT_COLOR' => 'red', 'COLOR' => 'red');
         $objNZBLog->writeLine("Failed processing \"" . $arrQueueList[$intEntryID]['nzb'] . "\" to incoming NZB directory.");
     }
 } else {
     $arrPlaceholders = array('ITEM' => 'An error occured! Please try again.', 'FONT_COLOR' => 'red', 'COLOR' => 'red');
     $objNZBLog->writeLine("Failed processing \"" . $arrQueueList[$intEntryID]['nzb'] . "\" to incoming NZB directory.");
 }
 # Replace placeholders
 $templateQueueProcess->replace_array($arrPlaceholders);
 # Add to contents
 $content = $templateQueueProcess->contents();
Пример #2
0
 if ($isQueue) {
     # Add to queue
     $arrQueue = array('matchtitle' => $downloadentry['title'], 'nzb' => $strFileNZB . '.nzb', 'datefound' => date("d-m-o G:i:s"));
     $objQueue->add_download($arrQueue);
 }
 # Filename needs to be a fixed one?
 if (!$isQueue and isset($downloadentry['fixednzbname']) and $downloadentry['fixednzbname'] != '') {
     $strNZBRenamed = $downloadentry['fixednzbname'];
     @rename($nzbFolder . $strFileNZB . '.nzb', $nzbFolder . $strNZBRenamed);
 }
 # Write the dummy file
 @touch($dummy);
 # Tweet ?
 if ($twitter_enabled == true and $isQueue == false) {
     $strTweetFinal = str_replace('%download', $current_nzb['description']['value'], $strTweet);
     $objTwitter->updateStatus($strTweetFinal);
     # Logging tweet event
     $_msg = "Tweeting download " . $current_nzb['description']['value'];
     $objNZBLog->writeLine($_msg);
     if ($run_mode) {
         $run_mode_result .= $_msg . "<br />";
     }
 }
 # Download succeeded, wegschrijven succesvolle hit
 $objDownload->set_hit($current_key);
 # Write log entry
 $_msg = "Found NZB file for " . $current_nzb['description']['value'] . " on TVnzb";
 if ($isQueue) {
     $_msg .= " (add to verification queue)";
 }
 $objNZBLog->writeLine($_msg);