Ejemplo n.º 1
0
<?php

if (!$page->users->isLoggedIn()) {
    $page->show403();
}
$um = new UserMovies(['Settings' => $page->settings]);
if (isset($_REQUEST["del"])) {
    $um->delMovie($page->users->currentUserId(), $_REQUEST["del"]);
}
$cat = new Category(['Settings' => $page->settings]);
$tmpcats = $cat->getChildren(Category::CAT_PARENT_MOVIE);
$categories = [];
foreach ($tmpcats as $c) {
    $categories[$c['id']] = $c['title'];
}
$movies = $um->getMovies($page->users->currentUserId());
$results = [];
foreach ($movies as $mov => $m) {
    $movcats = explode('|', $m['categoryid']);
    if (is_array($movcats) && sizeof($movcats) > 0) {
        $catarr = [];
        foreach ($movcats as $movcat) {
            if (!empty($movcat)) {
                $catarr[] = $categories[$movcat];
            }
        }
        $m['categoryNames'] = implode(', ', $catarr);
    } else {
        $m['categoryNames'] = '';
    }
    $results[$mov] = $m;
Ejemplo n.º 2
0
<?php

use newznab\libraries\Tmdb\TMDB;
if (!$page->users->isLoggedIn()) {
    $page->show403();
}
$um = new UserMovies(['Settings' => $page->settings]);
if (isset($_REQUEST['del'])) {
    $usermovies = $um->delMovie($page->users->currentUserId(), $_REQUEST['del']);
} else {
    if (isset($_REQUEST['add'])) {
        // Derive cats from user preferences.
        $cats = array();
        $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);
<?php

require_once WWW_DIR . "/lib/site.php";
require_once WWW_DIR . "/lib/TMDb.php";
require_once WWW_DIR . "/lib/movie.php";
require_once WWW_DIR . "/lib/usermovies.php";
if (!$users->isLoggedIn()) {
    $page->show403();
}
$um = new UserMovies();
if (isset($_REQUEST["del"])) {
    $usermovies = $um->delMovie($users->currentUserId(), $_REQUEST["del"]);
} elseif (isset($_REQUEST["add"])) {
    //
    // derive cats from user preferences
    //
    $cats = array();
    $cats[] = "2030";
    $cats[] = "2040";
    $m = new Movie(false);
    $mi = $m->getMovieInfo($_REQUEST["add"]);
    if (!$mi) {
        $m->updateMovieInfo($_REQUEST["add"]);
    }
    $usermovies = $um->addMovie($users->currentUserId(), $_REQUEST["add"], $cats);
} else {
    if (!isset($_REQUEST["id"])) {
        $page->show404();
    }
    $m = new Movie(false);
    if (is_numeric($_REQUEST["id"])) {