本文整理汇总了PHP中Movie::fetchTmdbProperties方法的典型用法代码示例。如果您正苦于以下问题:PHP Movie::fetchTmdbProperties方法的具体用法?PHP Movie::fetchTmdbProperties怎么用?PHP Movie::fetchTmdbProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Movie
的用法示例。
在下文中一共展示了Movie::fetchTmdbProperties方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$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"])) {
$prop = $m->fetchTmdbProperties($_REQUEST["id"]);
if ($prop !== false) {
$res = array($prop);
}
} else {
$res = $m->searchTmdb($_REQUEST["id"]);
}
$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
}
}
示例2: realpath
<?php
// search tmdb or web for movie from a given name
define('FS_ROOT', realpath(dirname(__FILE__)));
require_once FS_ROOT . "/../../www/config.php";
require_once FS_ROOT . "/../../www/lib/framework/db.php";
require_once FS_ROOT . "/../../www/lib/movie.php";
require_once FS_ROOT . "/../../www/lib/util.php";
$movienameorig = "A Movie Name";
$movie = new Movie();
$moviename = $movie->parseMovieName($movienameorig);
echo "Looking up " . $movienameorig . " - " . $moviename . "\n";
// #1 tmdb
//
echo "TMDB : \n";
print_r($movie->searchTmdb($moviename));
// #2 search engine (google/bing)
//$buffer = getUrl("https://www.google.com/search?source=ig&hl=en&rlz=&btnG=Google+Search&aq=f&oq=&q=".urlencode($moviename.' site:imdb.com'));
echo "\nSE : \n";
$buffer = getUrl("http://www.bing.com/search?&q=" . urlencode($moviename . ' site:imdb.com'));
if ($buffer !== false && strlen($buffer)) {
$imdb = $movie->parseImdbFromNfo($buffer);
echo sprintf("imdbid : %s\n", $imdb);
print_r($movie->fetchImdbProperties($imdb));
echo "\nTMDB:\n";
print_r($movie->fetchTmdbProperties($imdb));
}