Exemplo n.º 1
0
     $cats[] = '2030';
     $cats[] = '2040';
     $m = new Film(['Settings' => $page->settings]);
     $mi = $m->getMovieInfo($_REQUEST['add']);
     if (!$mi) {
         $m->updateMovieInfo($_REQUEST['add']);
     }
     $usermovies = $um->addMovie($page->users->currentUserId(), $_REQUEST['add'], $cats);
 } else {
     if (!isset($_REQUEST['id'])) {
         $page->show404();
     }
     $tmdb = new TMDb($page->settings->getSetting('tmdbkey'), $page->settings->getSetting('imdblanguage'));
     $m = new Film(['Settings' => $page->settings, 'TMDb' => $tmdb]);
     if (is_numeric($_REQUEST['id'])) {
         $movie = $m->fetchTMDBProperties($_REQUEST['id']);
         if ($movie !== false) {
             $obj = array($movie);
         }
     } else {
         $searchm = $tmdb->searchMovie($_REQUEST['id']);
         if ($searchm !== false) {
             if (isset($searchm['results'])) {
                 $obj = array();
                 $limit = 0;
                 foreach ($searchm['results'] as $movie) {
                     $limit++;
                     $movieinfo = $m->fetchTMDBProperties($movie['id'], true);
                     if ($movieinfo !== false) {
                         $obj[] = $movieinfo;
                     }