Example #1
0
 public static function setTimelimit($timelimit)
 {
     self::$torrentTimelimit = $timelimit;
     $id = Sessionmanager::getUserId();
     $unixTime = strtotime($timelimit);
     Kernel::mysqli()->query("UPDATE usersetting SET timelimit=FROM_UNIXTIME({$unixTime}) WHERE id={$id}");
 }
Example #2
0
 public function generateAjax()
 {
     $this->contentType = Kernel::CONTENT_TYPE_XML;
     $removeNode = Util::tagToXml('remove', $this->rootNode);
     if (isset($this->url->getPageParams()->filter)) {
         if (!empty($_POST)) {
             //Kernel::addInfo(Kernel::INFOBOX_INFO, "Filter test! ".$_POST['filter']." ".$_POST['timelimit']);
             AVM::setFilter($_POST['filter']);
             AVM::setTimelimit($_POST['timelimit']);
             $this->feedList();
         }
     } else {
         if (isset($this->url->getPageParams()->watched)) {
             if (isset($this->url->getPageParams()->id)) {
                 $id = $this->url->getPageParams()->id;
                 $type = $this->url->getPageParams()->watched;
                 if ($type == 'movie') {
                     Kernel::mysqli()->query("INSERT INTO movie (id, name, year, url, format, watched, file, torrent, ver)\n\t\t\t\t\t\t\t\t\t\t\t SELECT id, name, year, url, format, NOT watched, file, torrent, (ver + 1) FROM movie WHERE id={$id} ORDER BY ver DESC LIMIT 1");
                     Kernel::addInfo(Kernel::INFOBOX_OK, "Watched status changed!");
                     Util::objToXml((object) array('id' => $id), $removeNode, 'movie');
                 } else {
                     if ($type == 'episode') {
                         Kernel::mysqli()->query("INSERT INTO episode (id, serieid, seasonid, episode, title, format, watched, file, torrent, ver)\n\t\t\t\t\t\t\t\t\t\t\t SELECT id, serieid, seasonid, episode, title, format, NOT watched, file, torrent, (ver + 1) FROM episode WHERE id={$id} ORDER BY ver DESC LIMIT 1");
                         Kernel::addInfo(Kernel::INFOBOX_OK, "Watched status changed!");
                         Util::objToXml((object) array('id' => $id), $removeNode, 'episode');
                     }
                 }
             }
         }
     }
 }
Example #3
0
 private function getFileDetailsObjFromUrl()
 {
     $pathInfo = explode(':', $this->url->getPageParams()->current);
     $torrentInfo = explode(':', $this->url->getPageParams()->root);
     $torrentId = Kernel::mysqli()->escape_string($torrentInfo[1]);
     $details = NULL;
     $unhandledResult = Kernel::mysqli()->query("SELECT * FROM unhandled WHERE id = {$torrentId}");
     if (is_object($unhandledResult)) {
         $unhandledObj = $unhandledResult->fetch_object();
         $data = $this->getTorrentData($unhandledObj->torrent);
         if ($pathInfo[0] == 'torrent') {
             $details = AVM::getDetailsObj($data['info']['name']);
         } else {
             if (isset($data['info']['files'])) {
                 foreach ($data['info']['files'] as $file) {
                     $file = $file['path'][count($file['path']) - 1];
                     if ($pathInfo[1] == hash('md4', $file)) {
                         $details = AVM::getDetailsObj($file);
                         break;
                     }
                 }
             }
         }
         $unhandledResult->close();
     }
     return $details;
 }