mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-31 10:18:55 +00:00
Fix some of the notices for userimdbids, etc.
This commit is contained in:
+65
-61
@@ -1,86 +1,90 @@
|
||||
<?php
|
||||
use newznab\libraries\Tmdb\TMDB;
|
||||
|
||||
if (!$page->users->isLoggedIn())
|
||||
|
||||
if (!$page->users->isLoggedIn()) {
|
||||
$page->show403();
|
||||
|
||||
$um = new UserMovies();
|
||||
|
||||
|
||||
if (isset($_REQUEST["del"]))
|
||||
{
|
||||
$usermovies = $um->delMovie($page->users->currentUserId(), $_REQUEST["del"]);
|
||||
}
|
||||
elseif (isset($_REQUEST["add"]))
|
||||
{
|
||||
//
|
||||
// derive cats from user preferences
|
||||
//
|
||||
|
||||
$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";
|
||||
$cats[] = '2030';
|
||||
$cats[] = '2040';
|
||||
|
||||
$m = new Movie(false);
|
||||
$mi = $m->getMovieInfo($_REQUEST["add"]);
|
||||
if (!$mi)
|
||||
$m->updateMovieInfo($_REQUEST["add"]);
|
||||
$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"]))
|
||||
$usermovies = $um->addMovie($page->users->currentUserId(), $_REQUEST['add'], $cats);
|
||||
} else {
|
||||
if (!isset($_REQUEST['id'])) {
|
||||
$page->show404();
|
||||
|
||||
$m = new Movie(false);
|
||||
|
||||
if (is_numeric($_REQUEST["id"]))
|
||||
{
|
||||
$prop = $m->fetchTmdbProperties($_REQUEST["id"]);
|
||||
if ($prop !== false)
|
||||
$res = array($prop);
|
||||
}
|
||||
else
|
||||
{
|
||||
$res = $m->searchTmdb($_REQUEST["id"]);
|
||||
}
|
||||
|
||||
$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;
|
||||
}
|
||||
if ($limit > 4) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$imdbids = array();
|
||||
if ($res)
|
||||
{
|
||||
foreach ($res as $movie)
|
||||
{
|
||||
if (isset($movie['title']) && isset($movie['imdb_id']))
|
||||
{
|
||||
$imdbids[] = str_replace("tt", "", $movie['imdb_id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
// no results
|
||||
|
||||
if (isset($obj) && count($obj) > 0) {
|
||||
foreach ($obj as $movie) {
|
||||
if (isset($movie['title']) && isset($movie['imdb_id'])) {
|
||||
$imdbids[] = str_replace('tt', '', $movie['imdb_id']);
|
||||
}
|
||||
}
|
||||
|
||||
if (count($imdbids) == 0)
|
||||
{
|
||||
if (count($imdbids) == 0) {
|
||||
print "<h3 style='padding-top:30px;'>No results found</h3>";
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$ourmovieimdbs = array();
|
||||
if (count($imdbids) > 0)
|
||||
{
|
||||
$m = new Movie();
|
||||
if (count($imdbids) > 0) {
|
||||
$m = new Film(['Settings' => $page->settings, 'TMDb' => $tmdb]);
|
||||
$allmovies = $m->getMovieInfoMultiImdb($imdbids);
|
||||
foreach ($allmovies as $ourmovie)
|
||||
if ($ourmovie["relimdb"] != "")
|
||||
$ourmovieimdbs[$ourmovie["imdbID"]] = $ourmovie["imdbID"];
|
||||
foreach ($allmovies as $ourmovie) {
|
||||
if ($ourmovie['relimdb'] != '') {
|
||||
$ourmovieimdbs[$ourmovie['imdbid']] = $ourmovie['imdbid'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$userimdbs = array();
|
||||
$usermovies = $um->getMovies($page->users->currentUserId());
|
||||
foreach ($usermovies as $umovie)
|
||||
$userimdbs[$umovie["imdbID"]] = $umovie["imdbID"];
|
||||
foreach ($usermovies as $umovie) {
|
||||
$userimdbs[$umovie['imdbid']] = $umovie['imdbid'];
|
||||
}
|
||||
|
||||
$page->smarty->assign('data', $res);
|
||||
$page->smarty->assign('data', $obj);
|
||||
$page->smarty->assign('ourmovies', $ourmovieimdbs);
|
||||
$page->smarty->assign('userimdbs', $userimdbs);
|
||||
|
||||
|
||||
+18
-25
@@ -1,44 +1,39 @@
|
||||
<?php
|
||||
|
||||
|
||||
if (!$page->users->isLoggedIn())
|
||||
if (!$page->users->isLoggedIn()) {
|
||||
$page->show403();
|
||||
}
|
||||
|
||||
$um = new UserMovies();
|
||||
|
||||
if (isset($_REQUEST["del"]))
|
||||
{
|
||||
$um = new UserMovies(['Settings' => $page->settings]);
|
||||
if (isset($_REQUEST["del"])) {
|
||||
$um->delMovie($page->users->currentUserId(), $_REQUEST["del"]);
|
||||
}
|
||||
|
||||
$cat = new Category;
|
||||
$tmpcats = $cat->getChildren(Category::CAT_PARENT_MOVIE, true, $page->userdata["categoryexclusions"]);
|
||||
$cat = new Category(['Settings' => $page->settings]);
|
||||
$tmpcats = $cat->getChildren(Category::CAT_PARENT_MOVIE);
|
||||
$categories = array();
|
||||
foreach($tmpcats as $c)
|
||||
$categories[$c['ID']] = $c['title'];
|
||||
foreach ($tmpcats as $c) {
|
||||
$categories[$c['id']] = $c['title'];
|
||||
}
|
||||
|
||||
$movies = $um->getMovies($page->users->currentUserId());
|
||||
$results = array();
|
||||
foreach ($movies as $mov=>$m)
|
||||
{
|
||||
$movcats = explode('|', $m['categoryID']);
|
||||
if (is_array($movcats) && sizeof($movcats) > 0)
|
||||
{
|
||||
foreach ($movies as $mov => $m) {
|
||||
$movcats = explode('|', $m['categoryid']);
|
||||
if (is_array($movcats) && sizeof($movcats) > 0) {
|
||||
$catarr = array();
|
||||
foreach ($movcats as $movcat)
|
||||
{
|
||||
if (!empty($movcat))
|
||||
foreach ($movcats as $movcat) {
|
||||
if (!empty($movcat)) {
|
||||
$catarr[] = $categories[$movcat];
|
||||
}
|
||||
}
|
||||
$m['categoryNames'] = implode(', ', $catarr);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$m['categoryNames'] = '';
|
||||
|
||||
}
|
||||
$results[$mov] = $m;
|
||||
|
||||
$results[$mov] = $m;
|
||||
}
|
||||
$page->smarty->assign('movies', $results);
|
||||
|
||||
@@ -48,6 +43,4 @@ $page->meta_keywords = "couch,potato,movie,add";
|
||||
$page->meta_description = "Manage Your Movies";
|
||||
|
||||
$page->content = $page->smarty->fetch('mymoviesedit.tpl');
|
||||
$page->render();
|
||||
|
||||
|
||||
$page->render();
|
||||
@@ -1,51 +1,51 @@
|
||||
<h1>{$page->title}</h1>
|
||||
|
||||
<p>
|
||||
Use this page to manage movies added to your personal list. If the movie becomes available it will be added to an <a href="{$smarty.const.WWW_TOP}/rss?t=-4&dl=1&i={$userdata.id}&r={$userdata.rsstoken}">Rss Feed</a> you can use to automatically download. To add more movies use the <a href="{$smarty.const.WWW_TOP}/mymovies">My Movies</a> search feature.
|
||||
Use this page to manage movies added to your personal list. If the movie becomes available it will be added to an <a href="{$smarty.const.WWW_TOP}/rss?t=-4&dl=1&i={$userdata.id}&r={$userdata.rsstoken}">Rss Feed</a> you can use to automatically download. To add more movies use the <a href="{$smarty.const.WWW_TOP}/mymovies">My Movies</a> search feature.
|
||||
</p>
|
||||
|
||||
{if $movies|@count > 0}
|
||||
|
||||
<table class="data highlight Sortable" id="browsetable">
|
||||
<tr>
|
||||
<table class="data highlight Sortable" id="browsetable">
|
||||
<tr>
|
||||
|
||||
<th></th>
|
||||
<th>name</th>
|
||||
<th>category</th>
|
||||
<th>added</th>
|
||||
<th class="mid">options</th>
|
||||
</tr>
|
||||
|
||||
{foreach from=$movies item=movie}
|
||||
<tr class="{cycle values=",alt"}">
|
||||
|
||||
<td class="mid">
|
||||
|
||||
<div class="movcover">
|
||||
<img class="shadow" src="{$smarty.const.WWW_TOP}/covers/movies/{if $movie.cover == 1}{$movie.imdbid}-cover.jpg{else}no-cover.jpg{/if}" width="120" border="0" alt="{$movie.title|escape:"htmlall"}" />
|
||||
<div class="movextra">
|
||||
<a class="rndbtn" target="_blank" href="{$site->dereferrer_link}http://www.imdb.com/title/tt{$movie.imdbid}" title="View Imdb">Imdb</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
<h2>{$movie.title|escape:"htmlall"} ({$movie.year})</h2>
|
||||
{if $movie.tagline != ''}<b>{$movie.tagline}</b><br />{/if}
|
||||
{if $movie.plot != ''}{$movie.plot}<br /><br />{/if}
|
||||
{if $movie.genre != ''}<b>Genre:</b> {$movie.genre}<br />{/if}
|
||||
{if $movie.director != ''}<b>Director:</b> {$movie.director}<br />{/if}
|
||||
{if $movie.actors != ''}<b>Starring:</b> {$movie.actors}<br /><br />{/if}
|
||||
</td>
|
||||
<td class="less">{if $movie.categoryNames != ''}{$movie.categoryNames|escape:"htmlall"}{else}All{/if}</td>
|
||||
<td class="less" title="Added on {$movie.createddate}">{$movie.createddate|date_format}</td>
|
||||
<td class="mid"><a href="{$smarty.const.WWW_TOP}/mymoviesedit?del={$movie.imdbid}" rel="remove" title="Remove from my movies">Remove</a></td>
|
||||
<th></th>
|
||||
<th>name</th>
|
||||
<th>category</th>
|
||||
<th>added</th>
|
||||
<th class="mid">options</th>
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
||||
</table>
|
||||
{foreach from=$movies item=movie}
|
||||
<tr class="{cycle values=",alt"}">
|
||||
|
||||
<td class="mid">
|
||||
|
||||
<div class="movcover">
|
||||
<img class="shadow" src="{$smarty.const.WWW_TOP}/covers/movies/{if $movie.cover == 1}{$movie.imdbid}-cover.jpg{else}no-cover.jpg{/if}" width="120" border="0" alt="{$movie.title|escape:"htmlall"}" />
|
||||
<div class="movextra">
|
||||
<a class="rndbtn" target="_blank" href="{$site->dereferrer_link}http://www.imdb.com/title/tt{$movie.imdbid}" title="View IMDB">IMDB</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
<h2>{$movie.title|escape:"htmlall"} ({$movie.year})</h2>
|
||||
{if $movie.tagline != ''}<b>{$movie.tagline}</b><br />{/if}
|
||||
{if $movie.plot != ''}{$movie.plot}<br /><br />{/if}
|
||||
{if $movie.genre != ''}<b>Genre:</b> {$movie.genre}<br />{/if}
|
||||
{if $movie.director != ''}<b>Director:</b> {$movie.director}<br />{/if}
|
||||
{if $movie.actors != ''}<b>Starring:</b> {$movie.actors}<br /><br />{/if}
|
||||
</td>
|
||||
<td class="less">{if $movie.categoryNames != ''}{$movie.categoryNames|escape:"htmlall"}{else}All{/if}</td>
|
||||
<td class="less" title="Added on {$movie.createddate}">{$movie.createddate|date_format}</td>
|
||||
<td class="mid"><a href="{$smarty.const.WWW_TOP}/mymoviesedit?del={$movie.imdbid}" rel="remove" title="Remove from my movies">Remove</a></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
||||
</table>
|
||||
|
||||
{else}
|
||||
|
||||
{/if}
|
||||
{/if}
|
||||
Reference in New Issue
Block a user