/** * Search IMDb for titles matching $searchTerms * @method search * @param string $searchTerms * @param array $wantedTypes *optional* imdb types that should be returned. Defaults to returning all types. * The class constants MOVIE,GAME etc should be used e.g. [imdbsearch::MOVIE, imdbsearch::TV_SERIES] * @param int $maxResults *optional* The maximum number of results to retrieve from IMDB. 0 for unlimited. Defaults to mdb_config::$maxresults * @return array array of imdb objects */ public function search($searchTerms, $wantedTypes = null, $maxResults = null) { $page = ''; $results = array(); // @TODO remove maxresults? It has no effect on imdb and why would the user want less results than possible? if ($maxResults === null) { $maxResults = $this->maxresults; } if ($this->usecache) { $this->cache_read(urlencode(strtolower($searchTerms)) . '.search', $page); } if (!$page) { // @TODO pre filter if they only pick one type $url = "http://" . $this->imdbsite . "/find?s=tt&q=" . urlencode($searchTerms); $page = $this->makeRequest($url); if ($this->storecache && $page) { $this->cache_write(urlencode(strtolower($searchTerms)) . '.search', $page); } } // Parse & filter results if (preg_match_all('!class="result_text"\\s*>\\s*<a href="/title/tt(?<imdbid>\\d{7})/[^>]*>(?<title>.*?)</a>\\s*(\\([^\\d{4}]\\)\\s*)?(\\((?<year>\\d{4})(.*?|)\\)|)(?<type>[^<]*)!ims', $page, $matches, PREG_SET_ORDER)) { foreach ($matches as $match) { if (count($results) == $maxResults) { break; } $type = $this->parseTitleType($match['type']); if (is_array($wantedTypes) && !in_array($type, $wantedTypes)) { continue; } $results[] = imdb::fromSearchResult($match['imdbid'], $match['title'], $match['year'], $type, $this); } } return $results; }
public function __construct() { parent::__construct(); }
//== tvmaze by whocares converted from former tvrage functions by pdq/putyn $torrents['tvcats'] = array(5); // change these to match your TV categories if (in_array($torrents['category'], $torrents['tvcats'])) { $tvmaze_info = tvmaze($torrents); if ($tvmaze_info) { $HTMLOUT .= tr($lang['details_tvrage'], $tvmaze_info, 1); } } //==auto imdb rewritten putyn 28/06/2011 $imdb_html = ""; if (preg_match('/^http\\:\\/\\/(.*?)imdb\\.com\\/title\\/tt([\\d]{7})/i', $torrents['url'], $imdb_tmp)) { $imdb_id = $imdb_tmp[2]; unset($imdb_tmp); if (!($imdb_html = $mc1->get_value('imdb::' . $imdb_id))) { $movie = new imdb($imdb_id); $movie->setid($imdb_id); $imdb_data['director'] = $movie->director(); $imdb_data['writing'] = $movie->writing(); $imdb_data['producer'] = $movie->producer(); $imdb_data['composer'] = $movie->composer(); $imdb_data['cast'] = $movie->cast(); $imdb_data['cast'] = array_slice($imdb_data['cast'], 0, 10); $imdb_data['genres'] = $movie->genres(); $imdb_data['plot'] = $movie->plot(); $imdb_data['plotoutline'] = $movie->plotoutline(); $imdb_data['trailers'] = $movie->trailers(); $imdb_data['language'] = $movie->language(); $imdb_data['rating'] = $movie->rating(); $imdb_data['title'] = $movie->title(); $imdb_data['year'] = $movie->year();
# written by Giorgos Giagas # # extended & maintained by Itzchak Rehberg <izzysoft AT qumran DOT org> # # http://www.izzysoft.de/ # # ------------------------------------------------------------------------- # # This program is free software; you can redistribute and/or modify it # # under the terms of the GNU General Public License (see doc/LICENSE) # # ------------------------------------------------------------------------- # # Show what we have in the Cache # ############################################################################# # $Id$ require_once "imdb.class.php"; echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n"; echo "<HTML><HEAD>\n <TITLE>IMDBPHP Cache Contents</TITLE>\n"; echo " <STYLE TYPE='text/css'>body,td,th { font-size:12px; }</STYLE>\n"; echo "</HEAD><BODY>\n"; $imdb = new imdb("0"); $movies = array(); if (is_dir($imdb->cachedir)) { $files = glob($imdb->cachedir . '*.Title'); foreach ($files as $file) { if (preg_match('!^(\\d{7})\\.Title$!i', basename($file), $match)) { $movies[] = array('imdbid' => $match[1], 'imdb' => 1); } } } if (!empty($movies)) { echo "<TABLE ALIGN='center' BORDER='1' STYLE='border-collapse:collapse;margin-top:20px;'>\n" . " <TR><TH STYLE='background-color:#ffb000'>Movie</TH><TH STYLE='background-color:#ffb000'>IMDB</TH><TH STYLE='background-color:#ffb000'>MoviePilot</TR>\n"; foreach ($movies as $movie) { $imdb->setid($movie['imdbid']); $title = $imdb->title(); echo " <TR><TD>{$title}</TD><TD ALIGN='center'>";
if (empty($content)) { return ''; } if ($cdata) { return " <{$name}><![CDATA[{$content}]]></{$name}>\n"; } return " <{$name}>{$content}</{$name}>\n"; } require_once "imdb.class.php"; // Load the API require_once "imdb_budget.class.php"; $xml = "<?xml version='1.0' encoding='iso-8859-15'?>\n<imdbdata>\n"; // start XML output foreach ($imdbids as $imdbid) { // process each ID $movie = new imdb($imdbid); $xml .= " <movie>\n" . " <imdbid>{$imdbid}</imdbid>\n" . elem('title', $movie->title()) . elem('year', $movie->year()) . elem('rating', $movie->rating()) . elem('votes', $movie->votes()) . elem('tagline', $movie->tagline(), TRUE) . elem('plot', $movie->plotoutline(), TRUE); $people = ''; foreach ($movie->prodCompany() as $person) { $people .= ";" . $person['name']; } if (!empty($people)) { $xml .= elem('company', substr($people, 1)); } $people = ''; foreach ($movie->director() as $person) { $people .= ";" . $person['name']; } if (!empty($people)) { $xml .= elem('director', substr($people, 1)); }
/* $Id: movie.php 317 2010-02-20 19:09:21Z izzy $ */ if (isset($_GET["mid"])) { $movieid = $_GET["mid"]; switch ($_GET["engine"]) { case "pilot": require "pilot.class.php"; $movie = new pilot($_GET["mid"]); $charset = "utf8"; $source = "<A HREF='?engine=imdb&mid={$movieid}'>IMDB</A> | <B CLASS='active'>MoviePilot</B>"; if ($movie->pilot_imdbfill) { $source .= '<SUP>+i</SUP>'; } break; default: require "imdb.class.php"; $movie = new imdb($_GET["mid"]); $charset = "iso-8859-1"; $source = "<B CLASS='active'>IMDB</B> | <A HREF='?engine=pilot&mid={$movieid}'>MoviePilot</A>"; break; } $movie->setid($movieid); $rows = 2; // count for the rowspan; init with photo + year echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n"; echo "<HTML><HEAD>\n <TITLE>" . $movie->title() . ' (' . $movie->year() . ")</TITLE>\n"; echo " <STYLE TYPE='text/css'>body,td,th { font-size:12px; font-family:sans-serif; } b.active { color:#b00;background-color:#fff;text-decoration:underline;}</STYLE>\n"; echo " <META http-equiv='Content-Type' content='text/html; charset={$charset}'>\n"; echo "</HEAD>\n<BODY ONLOAD='fix_colspan()'>\n<TABLE BORDER='1' ALIGN='center' STYLE='border-collapse:collapse'>"; # Title & year echo '<TR><TH COLSPAN="3" STYLE="background-color:#ffb000">'; echo $movie->title() . ' (' . $movie->year() . ")";
} else { $link = $descr; } $m = preg_match("/tt\\d{7}/", $link, $ids); if ($m) { $link = "http://www.imdb.com/title/" . $ids[0]; $db = new DB("torrents"); $db->torrent_imdb = $link; $db->update("torrent_id = '" . $db->escape($id) . "'"); preg_match("#tt(?P<imdbId>[0-9]{7,7})#", $link, $matches); if (count($matches) == 0) { continue; } $thenumbers = $matches['imdbId']; include PATH_LIBRARY . "imdb/imdb.class.php"; $movie = new imdb($thenumbers); $movieid = $thenumbers; $movie->setid($movieid); $gen = $movie->genres(); $plotoutline = $movie->plotoutline(); $mvrating = $movie->rating(); $photo_url = $movie->photo_localurl(); $db = new DB("torrents_imdb"); $db->setColPrefix("imdb_"); $db->torrent = $id; $db->genres = implode(", ", $gen); $db->plot = $plotoutline; $db->title = $movie->title(); $db->image = $photo_url; $db->rating = $mvrating; $db->insert();
/** Get all possible trailers * @method getAllTrailers * @param string mid IMDB ID * @return array [0..n] of array[url,format] of movie trailers */ function getAllTrailers($mid) { $movie = new imdb($mid); $arraytrailers = $movie->videosites(); $list = array(); foreach ($arraytrailers as $trail) { unset($tl); $tmp = strtolower($trail['url']); if (strpos($tmp, "www.moviemaze.de") !== FALSE) { $tl = $this->getFlashCodeMovieMaze($trail['url']); } elseif (strpos($tmp, "alltrailers.net") !== FALSE) { $tl = $this->getFlashCodeAllTrailers($trail['url']); } elseif (strpos($url, "imdb.com/rg/VIDEO_TITLE/GALLERY") !== FALSE) { $tl = $this->getImdbTrailers($trail['url']); } elseif (strpos($tmp, "www.movieplayer.it") !== FALSE) { $tl = $this->getMoviePlayerTrailers($trail['url']); } elseif (strpos($tmp, "azmovietrailers.com") !== FALSE) { $tl = $this->getAZMovieTrailers($trail['url']); } elseif (strpos($tmp, "youtube.com") !== FALSE) { $tl = $this->getYoutubeTrailers($trail['url']); } if (isset($tl)) { $list = array_merge($list, $tl); } } return $list; }
//############################################################################ // IMDBPHP (c) Giorgos Giagas & Itzchak Rehberg # // written by Giorgos Giagas # // extended & maintained by Itzchak Rehberg <izzysoft AT qumran DOT org> # // http://www.izzysoft.de/ # // ------------------------------------------------------------------------- # // This program is free software; you can redistribute and/or modify it # // under the terms of the GNU General Public License (see doc/LICENSE) # // ------------------------------------------------------------------------- # // Show what we have in the Cache # //############################################################################ // $Id: cache.php 253 2009-10-11 21:54:15Z izzy $ require_once "imdb.class.php"; $conf = new imdb_config(); echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n"; echo "<HTML><HEAD>\n <TITLE>IMDBPHP Cache Contents</TITLE>\n"; echo " <STYLE TYPE='text/css'>body,td,th { font-size:12px; }</STYLE>\n"; echo "</HEAD><BODY>\n"; $movie = new imdb("0"); if ($d = opendir($conf->cachedir)) { echo "<TABLE ALIGN='center' BORDER='1' STYLE='border-collapse:collapse;margin-top:20px;'>\n" . " <TR><TH STYLE='background-color:#ffb000'>Movie Details</TH><TH STYLE='background-color:#ffb000'>IMDB page</TH></TR>\n"; while (false !== ($entry = readdir($d))) { if (strstr($entry, "Title")) { $imdbid = substr($entry, 0, 7); $movie->setid($imdbid); echo " <TR><TD><a href='imdb.php?mid={$imdbid}'>" . $movie->title() . "</a></TD>" . "<TD><a href=\"http://us.imdb.com/title/tt{$imdbid}\">imdb page</a></TD></TR>\n"; } } echo "</TABLE>\n"; } echo "</BODY></HTML>";
if ($accion == "insertar_rol") { $sql = "INSERT INTO person_picture(person_id,picture_id,role_id) VALUES(" . $id_persona . "," . $id_pelicula . "," . $id_rol . ")"; } else { if ($accion == "nueva_nominacion") { $sql = "INSERT INTO nominations(year,category_id,picture_id,nominee_id) VALUES(" . $year . "," . $nuevo_nom_categoria . ",'" . $nuevo_nom_pelicula . "','" . $nuevo_nom_profesional . "')"; } else { if ($accion == "buscar_pelicula") { $search = new imdbsearch(); //$search->setsearchname($HTTP_POST_VARS["name"]); $search->setsearchname($_POST["name"]); $results = $search->results(); foreach ($results as $res) { $pelicula_nombre_orig = "" . $res->title(); $pelicula_nombre_esp = ""; $pelicula_id = "" . $res->imdbid(); $movie = new imdb($res->imdbid()); $movie->setid($res->imdbid()); $aka = $movie->alsoknow(); if (!empty($aka)) { foreach ($aka as $ak) { if ($ak["country"] == "Spain") { $pelicula_nombre_esp = $ak["title"]; break; } } } //$peliculas_buscadas.="<div>".$pelicula_nombre_orig." (".$res->year().") <a href=\"http://".$search->imdbsite."/title/tt".$pelicula_id."\">imdb page</a><input type=\"hidden\" name=\"accion\" value=\"nueva_pelicula\"/>Titulo en español: <input type=\"text\" name=\"nuevo_titulo_esp\"><input type=\"hidden\" name=\"nuevo_titulo_ing\" value=\"".$pelicula_nombre_orig."\"><input type=\"hidden\" name=\"nuevo_id_imdb\" value=\"".$pelicula_id."\"><input type=\"submit\" value=\"nueva película\"></div>"; if ($pelicula_nombre_esp != "") { $peliculas_buscadas .= "<form method=\"POST\" action=\"" . $this_page . "\">" . $pelicula_nombre_orig . "[" . $pelicula_nombre_esp . "] (" . $res->year() . ") <a href=\"http://" . $search->imdbsite . "/title/tt" . $pelicula_id . "\">imdb page</a><input type=\"hidden\" name=\"accion\" value=\"nueva_pelicula\"/><input type=\"hidden\" name=\"nuevo_titulo_esp\" value=\"" . $pelicula_nombre_esp . "\"><input type=\"hidden\" name=\"nuevo_titulo_ing\" value=\"" . $pelicula_nombre_orig . "\"><input type=\"hidden\" name=\"nuevo_id_imdb\" value=\"" . $pelicula_id . "\"><input type=\"submit\" value=\"nueva película\"></form>"; } else { $peliculas_buscadas .= "<form method=\"POST\" action=\"" . $this_page . "\">" . $pelicula_nombre_orig . " (" . $res->year() . ") <a href=\"http://" . $search->imdbsite . "/title/tt" . $pelicula_id . "\">imdb page</a><input type=\"hidden\" name=\"accion\" value=\"nueva_pelicula\"/> Titulo en español: <input type=\"text\" name=\"nuevo_titulo_esp\"><input type=\"hidden\" name=\"nuevo_titulo_ing\" value=\"" . $pelicula_nombre_orig . "\"><input type=\"hidden\" name=\"nuevo_id_imdb\" value=\"" . $pelicula_id . "\"><input type=\"submit\" value=\"nueva película\"></form>";
# ------------------------------------------------------------------------- # # Search for $name and display results # ############################################################################# # $Id: imdbsearch.php 118 2008-05-09 09:01:35Z izzy $ # Search for the movie: require_once "imdb.class.php"; // include the class file $search = new imdbsearch(); // create an instance of the search class $search->setsearchname($_GET["name"]); // tell the class what to search for (case insensitive) $results = $search->results(); // submit the search echo '<ol>'; foreach ($results as $res) { $mid = $res->imdbid(); // this is the all-important Movie ID! $movie = new imdb($mid); // create an instance of the class and pass it the IMDB ID $title = $movie->title(); // retrieve the movie title $year = $movie->year(); // obtain the year of production // $runtime = $movie->runtime(); // runtime in minutes $rating = $movie->rating(); // rating // $trailer = $movie->trailers(); // array of trailers // now do something with these data echo '<li><a href="http://www.imdb.com/title/tt' . $mid . '">' . $title . ' [' . $year . ']</a> <span>[ ' . $rating . ' ]</span></li>'; } echo '</ol>';
$detalle_buscada = $detalle_buscada . "</td></tr>"; $detalle_buscada = $detalle_buscada . "<tr><td>"; $detalle_buscada = $detalle_buscada . "<tr><td colspan='2'><input type='hidden' name='id_imdb' value='" . $id_imdb . "'><input type='hidden' name='accion' value='insertar_nominaciones'><input type='submit' value='enviar'></td></tr>"; $detalle_buscada = $detalle_buscada . "</table></form>"; } elseif ($accion == "insertar_nominaciones") { $sqls = array(); if (!exists_picture($bd, $id_imdb)) { //Hay que insertar también la película $nuevo_titulo_ing = str_replace("'", "''", $nuevo_titulo_ing); $nuevo_titulo_ing = strlen($nuevo_titulo_ing) > 60 ? substr($nuevo_titulo_ing, 0, 57) . '...' : $nuevo_titulo_ing; $nuevo_titulo_esp = str_replace("'", "''", $nuevo_titulo_esp); $nuevo_titulo_esp = strlen($nuevo_titulo_esp) > 60 ? substr($nuevo_titulo_esp, 0, 57) . '...' : $nuevo_titulo_esp; $sqls[] = "INSERT INTO pictures(aka,name,year,id) VALUES('" . $nuevo_titulo_esp . "','" . $nuevo_titulo_ing . "'," . $year . ",'" . $id_imdb . "')"; } if (isset($guardar_imagen) && $guardar_imagen === true) { $movie = new imdb($id_imdb); $movie->setid($id_imdb); //$movie->savephoto("../img/pictures/".($year-1)."/".$id_imdb.".jpg",false); $movie->savephoto("../img/pictures/" . $year . "/" . $id_imdb . ".jpg", false, 1); //$ruta=$id_imdb.".jpg"; //$movie->savephoto($ruta,false); } for ($i = 0; $i < count($categorias); $i++) { $clave = $categorias[$i] . "es"; if (isset($_POST[$clave])) { //echo $clave.": "; for ($j = 0; $j < count($_POST[$clave]); $j++) { $id_nominado = $_POST[$clave][$j]; $id_categoria = $categorias_id[$i]; if ($i == 1) { //Es el caso del guión, hay que ver de que tipo es
$a = mysql_fetch_assoc($r) or die("Puke"); $nfo = safeChar($a["nfo"]); echo "<h1>NFO for <a href=details.php?id={$id}>{$a['name']}</a></h1>\n"; echo "<tr><td valign=top alighn=center><b>Description</b></td><td class=text>\n"; echo "<pre><font face='MS Linedraw' size=2 style='font-size: 10pt; line-height: 10pt'>" . format_urls($nfo) . "</font></pre>\n"; echo "</td></tr>\n"; } //view nfo if (get_user_class() >= UC_POWER_USER && $row["nfosz"] > 0) { echo "<tr><td class=rowhead>NFO</td><td align=left><a href=viewnfo.php?id={$row['id']}><b>View NFO</b></a> (" . prefixed($row["nfosz"]) . ")</td></tr>\n"; } ////////////////Auto Imdb if ($row["url"] != "" and strpos($row["url"], imdb) and strpos($row["url"], title)) { $thenumbers = ltrim(strrchr($row["url"], 'tt'), 'tt'); $thenumbers = ereg_replace("[^A-Za-z0-9]", "", $thenumbers); $movie = new imdb($thenumbers); $movieid = $thenumbers; $movie->setid($movieid); $country = $movie->country(); $director = $movie->director(); $write = $movie->writing(); $produce = $movie->producer(); $cast = $movie->cast(); $plot = $movie->plot(); $compose = $movie->composer(); $gen = $movie->genres(); if (($photo_url = $movie->photo_localurl()) != FALSE) { $smallth = '<img src="' . $photo_url . '">'; } if (!empty($row["url"])) { $autodata .= "<a href=\"javascript: klappe_news('a4')\"><img border=\"0\" src=\"pic/plus.gif\" id=\"pica4" . $array['id'] . "\" alt=\"[Hide/Show]\"></a> Imdb Info<div id=\"ka4\" style=\"display: none;\"><font color=\"green\" size=\"3\">Information:</font><br />\n";
function show_country_txt_grafico($year, $category_id, $picture_id, $nominee_id, $db) { $consulta = $db->prepare("SELECT nominee_id,picture_id,aka,winner FROM nominations,pictures WHERE nominations.picture_id=pictures.id AND pictures.id='" . $picture_id . "' AND nominations.year=" . $year . " AND category_id=" . $category_id); $consulta->execute(); global $imagen_ganador; global $imagen_ganador; require "./" . $base_imdb . "/imdb.class.php"; while ($fila = $consulta->fetch()) { //$picture_id=$fila[1]; $movie = new imdb($picture_id); $movie->setid($picture_id); $country = $movie->country(); $paises = ""; for ($i = 0; $i < count($country); $i++) { if ($i > 0) { $paises .= ", "; } $paises .= $country[$i]; } $paises_img = str_replace(", ", "_", $paises); $winner = $fila[3]; $img = ""; if ($winner == 1) { $img = "<img src='{$imagen_ganador}'/>"; } echo "<td>" . $fila[2] . " (" . $paises; echo "){$img}</td>"; } }
//vip_torrent end // torrents after last visit if (isset($CURUSER["lastconnect"])) { $filetime = date("YmdHis", $data["added"]); $lastseen = date("YmdHis", $CURUSER["lastconnect"]); if ($lastseen <= $filetime) { $is_new = "<img src=images/new.png>"; } else { $is_new = ''; } } // torrents after last visit // imdb rating if ($btit_settings["imdbt"] == true) { require_once "imdb/imdb.class.php"; $movie = new imdb($data["imdb"]); $ratv_file = dirname(__FILE__) . '/cache/' . $data["imdb"] . '_torrents_IMDB_rating.txt'; if (file_exists($ratv_file)) { $ratv = unserialize(file_get_contents($ratv_file)); } else { $ratv = $movie->rating(); if ($data["imdb"] != 0) { write_file($ratv_file, serialize($ratv)); } } $ilink = $data["imdb"]; if ($ratv == 0) { $rt = ""; } else { $rt = "<A HREF=http://www.imdb.com/title/tt" . $ilink . "><img src='images/imdb.png' 'alt=imdb' /> " . $ratv . "</A>"; }
if (strstr($mfile, '720p')) { $screen_size = "HD 720p"; } elseif (strstr($mfile, '1080p')) { $screen_size = "HD 1080p"; } } } if (strstr($folder['name'], '720p')) { $screen_size = "HD 720p"; } elseif (strstr($folder['name'], '1080p')) { $screen_size = "HD 1080p"; } } echo ' {' . $screen_size . '} '; // Query IMDB for the title and year $movie = new imdb($imdb_id); $movie->setid($imdb_id); // Lets check the movie language error_reporting(0); // Ugly hack to get rid of that stupid notice...that comes up when no language is defined... $language = $movie->language(); error_reporting(1); // Is it a foreign language film? $foreign = false; if ($language != 'English') { $foreign = true; } $title = ''; if (!empty($title_path)) { $handle = fopen($title_path, "r"); $contents = fread($handle, filesize($title_path));
function getimdb($imdb_id, $cache_stamp, $mode = 'minor') { global $lang_functions; global $showextinfo; $thenumbers = $imdb_id; $movie = new imdb($thenumbers); $movieid = $thenumbers; $movie->setid($movieid); $target = array('Title', 'Credits', 'Plot'); switch ($movie->cachestate($target)) { case "0": return false; break; case "1": $title = $movie->title(); $year = $movie->year(); $country = $movie->country(); $countries = ""; $temp = ""; for ($i = 0; $i < count($country); $i++) { $temp .= "{$country[$i]}, "; } $countries = rtrim(trim($temp), ","); $director = $movie->director(); $director_or_creator = ""; if ($director) { $temp = ""; for ($i = 0; $i < count($director); $i++) { $temp .= $director[$i]["name"] . ", "; } $director_or_creator = "<strong><font color=\"DarkRed\">" . $lang_functions['text_director'] . ": </font></strong>" . rtrim(trim($temp), ","); } else { //for tv series $creator = $movie->creator(); $director_or_creator = "<strong><font color=\"DarkRed\">" . $lang_functions['text_creator'] . ": </font></strong>" . $creator; } $cast = $movie->cast(); $temp = ""; for ($i = 0; $i < count($cast); $i++) { if ($i > 2) { break; } $temp .= $cast[$i]["name"] . ", "; } $casts = rtrim(trim($temp), ","); $gen = $movie->genres(); $genres = $gen[0] . (count($gen) > 1 ? ", " . $gen[1] : ""); //get first two genres; $rating = $movie->rating(); $votes = $movie->votes(); if ($votes) { $imdbrating = "<b>" . $rating . "</b>/10 (" . $votes . $lang_functions['text_votes'] . ")"; } else { $imdbrating = $lang_functions['text_awaiting_five_votes']; } $tagline = $movie->tagline(); switch ($mode) { case 'minor': $autodata = "<font class=\"big\"><b>" . $title . "</b></font> (" . $year . ") <br /><strong><font color=\"DarkRed\">" . $lang_functions['text_imdb'] . ": </font></strong>" . $imdbrating . " <strong><font color=\"DarkRed\">" . $lang_functions['text_country'] . ": </font></strong>" . $countries . " <strong><font color=\"DarkRed\">" . $lang_functions['text_genres'] . ": </font></strong>" . $genres . "<br />" . $director_or_creator . "<strong><font color=\"DarkRed\"> " . $lang_functions['text_starring'] . ": </font></strong>" . $casts . "<br /><p><strong>" . $tagline . "</strong></p>"; break; case 'median': if (($photo_url = $movie->photo_localurl()) != FALSE) { $smallth = "<img src=\"" . $photo_url . "\" width=\"105\" alt=\"poster\" />"; } else { $smallth = ""; } $runtime = $movie->runtime(); $language = $movie->language(); $plot = $movie->plot(); $plots = ""; if (count($plot) != 0) { //get plots from plot page $plots .= "<font color=\"DarkRed\">*</font> " . strip_tags($plot[0], '<br /><i>'); $plots = mb_substr($plots, 0, 300, "UTF-8") . (mb_strlen($plots, "UTF-8") > 300 ? " ..." : ""); $plots .= strpos($plots, "<i>") == true && strpos($plots, "</i>") == false ? "</i>" : ""; //sometimes <i> is open and not ended because of mb_substr; $plots = "<font class=\"small\">" . $plots . "</font>"; } elseif ($plotoutline = $movie->plotoutline()) { //get plot from title page $plots .= "<font color=\"DarkRed\">*</font> " . strip_tags($plotoutline, '<br /><i>'); $plots = mb_substr($plots, 0, 300, "UTF-8") . (mb_strlen($plots, "UTF-8") > 300 ? " ..." : ""); $plots .= strpos($plots, "<i>") == true && strpos($plots, "</i>") == false ? "</i>" : ""; //sometimes <i> is open and not ended because of mb_substr; $plots = "<font class=\"small\">" . $plots . "</font>"; } $autodata = "<table style=\"background-color: transparent;\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">\n" . ($smallth ? "<td class=\"clear\" valign=\"top\" align=\"right\">\n{$smallth}\n</td>" : "") . "<td class=\"clear\" valign=\"top\" align=\"left\">\n<table style=\"background-color: transparent;\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\" width=\"350\">\n<tr><td class=\"clear\" colspan=\"2\"><img class=\"imdb\" src=\"pic/trans.gif\" alt=\"imdb\" /> <font class=\"big\"><b>" . $title . "</b></font> (" . $year . ") </td></tr>\n<tr><td class=\"clear\"><strong><font color=\"DarkRed\">" . $lang_functions['text_imdb'] . ": </font></strong>" . $imdbrating . "</td>\n" . ($runtime ? "<td class=\"clear\"><strong><font color=\"DarkRed\">" . $lang_functions['text_runtime'] . ": </font></strong>" . $runtime . $lang_functions['text_min'] . "</td>" : "<td class=\"clear\"></td>") . "</tr>\n<tr><td class=\"clear\"><strong><font color=\"DarkRed\">" . $lang_functions['text_country'] . ": </font></strong>" . $countries . "</td>\n" . ($language ? "<td class=\"clear\"><strong><font color=\"DarkRed\">" . $lang_functions['text_language'] . ": </font></strong>" . $language . "</td>" : "<td class=\"clear\"></td>") . "</tr>\n<tr><td class=\"clear\">" . $director_or_creator . "</td>\n<td class=\"clear\"><strong><font color=\"DarkRed\">" . $lang_functions['text_genres'] . ": </font></strong>" . $genres . "</td></tr>\n<tr><td class=\"clear\" colspan=\"2\"><strong><font color=\"DarkRed\">" . $lang_functions['text_starring'] . ": </font></strong>" . $casts . "</td></tr>\n" . ($plots ? "<tr><td class=\"clear\" colspan=\"2\">" . $plots . "</td></tr>" : "") . "\n</table>\n</td>\n</table>"; break; } return $autodata; case "2": return false; break; case "3": return false; break; } }
public static function Step4($modernLanguagesFlipped) { if (isset($_POST['imdbid']) && is_numeric($_POST['imdbid'])) { $movie = new imdb($_POST['imdbid']); $movie->setid($_POST['imdbid']); $db = new MDB(); $cast = $movie->cast(); $i = 0; // Insert all castmemebers while (list($key, $value) = each($cast)) { $db->insertCast($_POST['imdbid'], $value['imdb'], AddMovie::utf8ify($value['name']), ++$i); if ($i > MAXNAMES) { break; } } $directors = $movie->director(); $writers = $movie->writing(); $producers = $movie->producer(); $crew = array_merge($directors, $writers, $producers); $i = 0; // Insert all crewmemebers while (list($key, $value) = each($crew)) { $db->insertCrew($_POST['imdbid'], $value['imdb'], AddMovie::utf8ify($value['name']), ++$i); if ($i > MAXNAMES) { break; } } $genres = implode(',', $movie->genres()); $year = $movie->year(); $runtime = $movie->runtime(); if ($runtime == null) { $runtime = 1; if (isset($_POST['runtime']) && is_numeric($_POST['runtime'])) { $runtime = $_POST['runtime']; } } $title = AddMovie::utf8ify($movie->title()); $aka = $movie->alsoknow(); $englishTitle = ''; $rating = 1; if (is_numeric($_POST['rating'])) { $rating = $_POST['rating']; } if ($_POST['english-title'] != 'none') { $englishTitle = AddMovie::utf8ify($aka[$_POST['english-title']]['title']); //$englishTitle = trim($englishTitle, 1, strrpos($englishTitle, '"') - 1); } $language = 'en'; if (strlen($_POST['language']) == 2) { $language = $_POST['language']; } $success = $db->insertMovie($_POST['imdbid'], $title, $englishTitle, $language, $genres, $year, $runtime, $rating); if ($success) { header('Location: ./?message=add-success'); } else { header('Location: ./?message=add-error'); } exit; } else { AddMovie::Step1('invalid-id'); } }
if (isset($_GET["mid"])) { $movieid = $_GET["mid"]; $engine = $_GET["engine"]; switch ($engine) { case "pilot": require "pilot.class.php"; $movie = new pilot($_GET["mid"]); $charset = "utf8"; $source = "<A HREF='?engine=imdb&mid={$movieid}'>IMDB</A> | <B CLASS='active'>MoviePilot</B>"; if ($movie->get_pilot_imdbfill()) { $source .= '<SUP>+i</SUP>'; } break; default: require "imdb.class.php"; $movie = new imdb($_GET["mid"]); $charset = "iso-8859-1"; $source = "<B CLASS='active'>IMDB</B> | <A HREF='?engine=pilot&mid={$movieid}'>MoviePilot</A>"; break; } $movie->setid($movieid); $rows = 2; // count for the rowspan; init with photo + year echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n"; echo "<HTML><HEAD>\n"; echo " <TITLE>" . $movie->title() . ' (' . $movie->year() . ") [IMDBPHP2 v" . $movie->version . " Demo]</TITLE>\n"; echo " <STYLE TYPE='text/css'>body,td,th { font-size:12px; font-family:sans-serif; } b.active { color:#b00;background-color:#fff;text-decoration:underline;}</STYLE>\n"; echo " <META http-equiv='Content-Type' content='text/html; charset={$charset}'>\n"; echo "</HEAD>\n<BODY ONLOAD='fix_colspan()'>\n<TABLE BORDER='1' ALIGN='center' STYLE='border-collapse:collapse'>"; # Title & year echo '<TR><TH COLSPAN="3" STYLE="background-color:#ffb000">';
/** Get similiar movies * @method similiar_movies * @return list similiar_movies */ function similiar_movies() { if (!isset($this->similiar_movies)) { if ($this->page["Title"] == "") { $this->openpage("Title"); } $similiar_movies = $this->info_excer->truncate($this->page["Title"], "<h3>Recommendations</h3>", "<tr class=\"rating\">"); $similiar_movies = $this->info_excer->truncate($similiar_movies, "<tr>", "</tr>"); $res_where_array = array('Link' => '1', 'Name' => '3'); if ($res_array = $this->info_excer->find_pattern($similiar_movies, "/<td><a href=\"((\\s|.)+?)\">((\\s|.)+?)<\\/a><\\/td>/", true, $res_where_array)) { $counter = 0; foreach ($res_array as $res_array_each) { $this->similiar_movies[$counter]['Link'] = $res_array_each[0]; $this->similiar_movies[$counter]['Name'] = $res_array_each[1]; $imdb_id = ltrim(strrchr($res_array_each[0], 'tt'), 'tt'); $imdb_id = preg_replace("/[^A-Za-z0-9]/", "", $imdb_id); //die("ss" . $imdb_id); $imdb_sim_movies = new imdb($imdb_id); //$imdb_sim_movies->setid($imdb_id); $target = array('Title', 'Credits', 'Plot'); $imdb_sim_movies->preparecache($target, false); $this->similiar_movies[$counter]['Local'] = $imdb_sim_movies->photo_localurl(); $counter++; } } } return $this->similiar_movies; }
// torrents after last visit if (isset($CURUSER["lastconnect"])) { $filetime = date("YmdHis", $data["added"]); $lastseen = date("YmdHis", $CURUSER["lastconnect"]); if ($lastseen <= $filetime) { $is_new = "<img src=images/new.png>"; } else { $is_new = ''; } } // torrents after last visit // imdb mousehover image if ($btit_settings["imdbmh"] == true and $data["imdb"] != "") { require_once "imdb/imdb.class.php"; $tdt = ""; $movie = new imdb($data["imdb"]); $movie->photodir = './imdb/images/'; $movie->photoroot = './imdb/images/'; if (($photo_url = $movie->photo_localurl()) != FALSE) { $balon = $photo_url; } } else { if ($btit_settings["imgsw"] == false) { $tdt = ""; } else { $tdt = "torrentimg/"; } // Start baloon hack DT $hover = $data["img"]; if ($hover == "") { $balon = "nocover.jpg";
function get_imdb($imdburl) { global $INSTALLER09, $mc1; $imdb_info['id'] = $imdb_info['title'] = $imdb_info['orig_title'] = $imdb_info['year'] = $imdb_info['rating'] = $imdb_info['votes'] = $imdb_info['gen'] = $imdb_info['runtime'] = $imdb_info['country'] = $imdb_info['lanuage'] = $imdb_info['director'] = $imdb_info['produce'] = $imdb_info['write'] = $imdb_info['compose'] = $imdb_info['plotoutline'] = $imdb_info['plot'] = $imdb_info['trailers'] = $imdb_info['comment'] = ""; require_once IMDB_DIR . 'imdb.class.php'; $rurl = trim($imdburl); $thenumbers = ltrim(strrchr($rurl, 'tt'), 'tt'); $thenumbers = $thenumbers[strlen($thenumbers) - 1] == "/" ? substr($thenumbers, 0, strlen($thenumbers) - 1) : $thenumbers; $thenumbers = preg_replace("[^A-Za-z0-9]", "", $thenumbers); if (($imdb_info = $mc1->get_value('imdb_info_' . $thenumbers)) === false) { $movie = new imdb($thenumbers); $movieid = $thenumbers; $movie->setid($movieid); $cast = $movie->cast(); $imdb_info['id'] = $movieid; $imdb_info['title'] = $movie->title(); $imdb_info['orig_title'] = $movie->orig_title(); $imdb_info['year'] = $movie->year(); $mvotes = $movie->votes(); $mvrating = $movie->rating(); if (!empty($mvrating)) { $imdb_info['rating'] = "{$mvrating}"; $imdb_info['votes'] = "{$mvotes}"; } else { $imdb_info['rating'] = "N/A"; } $gen = $movie->genres(); if (!empty($gen)) { //Changed count($gen) for 4 to limit to only two genres to help keep it tidy on site for ($i = 0; $i + 1 < count($gen); $i++) { $imdb_info['gen'] .= "{$gen[$i]}, "; } $imdb_info['gen'] .= "{$gen[$i]}"; } else { $imdb_info['gen'] = "None Found"; } $runtime = $movie->runtime(); if (!empty($runtime)) { $imdb_info['runtime'] = "{$runtime}"; } else { $imdb_info['runtime'] = "N/A"; } $country = $movie->country(); if (!empty($country)) { for ($i = 0; $i + 1 < count($country); $i++) { $imdb_info['country'] .= "{$country[$i]}, "; } $imdb_info['country'] .= "{$country[$i]}"; } else { $imdb_info['country'] = "None Available"; } $mvlang = $movie->language(); if (!empty($mvlang)) { $imdb_info['lanuage'] = "{$mvlang}"; } else { $imdb_info['lanuage'] = "None Available"; } $director = $movie->director(); if (!empty($director)) { for ($i = 0; $i < count($director); $i++) { $imdb_info['director'] .= "<a target=\"_blank\" href=\"http://www.imdb.com/name/nm" . "" . $director[$i]["imdb"] . "" . "\">" . "" . $director[$i]["name"] . "" . "</a>, "; } $imdb_info['director'] .= "<a target=\"_blank\" href=\"http://www.imdb.com/name/nm" . "" . $director[$i]["imdb"] . "" . "\">" . "" . $director[$i]["name"] . "" . "</a> "; } else { $imdb_info['director'] = "None Available"; } $produce = $movie->producer(); if (!empty($produce)) { for ($i = 0; $i < count($produce); $i++) { $imdb_info['produce'] .= "<a target=\"_blank\" href=\"http://www.imdb.com/name/nm" . "" . $produce[$i]["imdb"] . "" . " \">" . "" . $produce[$i]["name"] . "" . "</a>,"; } $imdb_info['produce'] .= "<a target=\"_blank\" href=\"http://www.imdb.com/name/nm" . "" . $produce[$i]["imdb"] . "" . " \">" . "" . $produce[$i]["name"] . "" . "</a>"; } else { $imdb_info['produce'] = "None Available"; } $write = $movie->writing(); if (!empty($write)) { for ($i = 0; $i < count($write); $i++) { $imdb_info['write'] .= "<a target=\"_blank\" href=\"http://www.imdb.com/name/nm" . "" . $write[$i]["imdb"] . "" . "\">" . "" . $write[$i]["name"] . "" . "</a>, "; } $imdb_info['write'] .= "<a target=\"_blank\" href=\"http://www.imdb.com/name/nm" . "" . $write[$i]["imdb"] . "" . "\">" . "" . $write[$i]["name"] . "" . "</a> "; } $compose = $movie->composer(); if (!empty($compose)) { for ($i = 0; $i < count($compose); $i++) { $imdb_info['compose'] .= "<a target=\"_blank\" href=\"http://www.imdb.com/name/nm" . "" . $compose[$i]["imdb"] . "" . " \">" . "" . $compose[$i]["name"] . "" . "</a>, "; } } else { $imdb_info['compose'] .= "N/A"; } $plotoutline = $movie->plotoutline(); if (!empty($plotoutline)) { $imdb_info['plotoutline'] = "" . str_replace(array('<p>', '</p>', '<a href="plotsummary">See full summary</a>'), array("", ""), "{$plotoutline}") . ""; } else { $imdb_info['plotoutline'] .= "No Summary Available"; } $plot = $movie->plot(); if (!empty($plot)) { for ($i = 0; $i < count($plot); $i++) { $imdb_info['plot'] .= str_replace(array("&", "<p>", "</p>"), array("&", "", ""), "{$plot[$i]}<br /><br />"); } } else { $imdb_info['plot'] .= "No Plot Available"; } $trailers = $movie->trailers(); if (!empty($trailers)) { for ($i = 0; $i < count($trailers); $i++) { $imdb_info['trailers'] .= "<a href='" . $trailers[$i] . "' title='Trailer' target='_blank'>IMDB Trailer</a><br />"; } $imdb_info['trailers'] .= "<a href='" . $trailers[$i] . "' title='Trailer' target='_blank'>IMDB Trailer</a>"; } else { $imdb_info['trailers'] = "None Available"; } $comment = $movie->comment(); if (!empty($comment)) { $imdb_info['comment'] = "" . str_replace(array("<p>", "</p>", "<br>", "<a></a>"), array("<br />", "<br />", "<br />", ""), "{$comment}") . ""; } else { $imdb_info['comment'] = "No comments available"; } if (($photo_url = $movie->photo_localurl()) != false) { $imdb_info['poster'] = $photo_url; } $mc1->cache_value('imdb_info_' . $thenumbers, $imdb_info, 0); } return $imdb_info; }
$siteid = 0 + $_GET["siteid"]; // 1 for IMDb 2 for 豆瓣 if (!isset($id) || !$id || !is_numeric($id) || !isset($type) || !$type || !is_numeric($type) || !isset($siteid) || !$siteid || !is_numeric($siteid)) { die; } $r = sql_query("SELECT * from torrents WHERE id = " . sqlesc($id)) or sqlerr(__FILE__, __LINE__); if (mysql_num_rows($r) != 1) { die; } $row = mysql_fetch_assoc($r); switch ($siteid) { case 1: $imdb_id = parse_imdb_id($row["url"]); if ($imdb_id) { $thenumbers = $imdb_id; $movie = new imdb($thenumbers); $movieid = $thenumbers; $movie->setid($movieid); $target = array('Title', 'Credits', 'Plot'); $type == 2 ? $movie->purge_single(true) : ""; set_cachetimestamp($id, "cache_stamp"); $movie->preparecache($target, true); $Cache->delete_value('imdb_id_' . $thenumbers . '_movie_name'); $Cache->delete_value('imdb_id_' . $thenumbers . '_large', true); $Cache->delete_value('imdb_id_' . $thenumbers . '_median', true); $Cache->delete_value('imdb_id_' . $thenumbers . '_minor', true); header("Location: " . get_protocol_prefix() . "{$BASEURL}/details.php?id=" . htmlspecialchars($id)); } break; case 2: $imdb_id = parse_imdb_id($row["url"]);
function queryItem($search_attributes_r, $s_item_type) { if (is_array($this->results)) { $imdb = $this->results[$search_attributes_r['res_id']]; unset($this->results); } else { $imdb = new imdb($search_attributes_r['imdb_id']); } // WTF? $imdb->imdb_utf8recode = get_opendb_config_var('themes', 'charset') == 'utf-8' ? TRUE : FALSE; $this->addItemAttribute('title', $imdb->title()); $this->addItemAttribute('year', $imdb->year()); foreach ($imdb->alsoknow() as $alt_title) { $this->addItemAttribute('alt_title', array($alt_title['country'] => $alt_title['title'])); } if ($imdb->photo()) { $this->addItemAttribute('imageurl', $imdb->photo()); } foreach ($imdb->director() as $person) { $this->addItemAttribute('director', $person['name']); } foreach ($imdb->producer() as $person) { if (stristr($person['role'], 'executive')) { $this->addItemAttribute('exproducer', $person['name']); } else { $this->addItemAttribute('producer', $person['name']); } } foreach ($imdb->writing() as $person) { $this->addItemAttribute('writer', $person['name']); } foreach ($imdb->composer() as $person) { $this->addItemAttribute('composer', $person['name']); } foreach ($imdb->cast() as $person) { $this->addItemAttribute('actors', $person['name']); } $this->addItemAttribute('genre', $imdb->genres()); $this->addItemAttribute('imdbrating', $imdb->rating()); $this->addItemAttribute('run_time', $imdb->runtime()); $this->addItemAttribute('audio_lang', $imdb->languages()); $this->addItemAttribute('dvd_audio', $imdb->sound()); foreach ($imdb->mpaa() as $country => $rating) { $country = strtolower($country); $this->addItemAttribute($country . '_age_rating', $rating); } $age_certification_codes_r = $this->getConfigValue('age_certification_codes'); if (!is_array($age_certification_codes_r) && strlen($age_certification_codes_r) > 0) { // single value $age_certification_codes_r = array($age_certification_codes_r); } if (is_array($age_certification_codes_r)) { reset($age_certification_codes_r); while (list(, $country) = @each($age_certification_codes_r)) { $country = strtolower($country); $ageRating = $this->getItemAttribute($country . '_age_rating'); // echo('<pre>'); // print_r($ageRating); // echo('</pre>'); if ($ageRating !== FALSE) { $this->addItemAttribute('age_rating', $ageRating); break; // found it! } } } $this->addItemAttribute('plot', $imdb->plot()); /** aspect ratio is not supported by imdbphp yet. * <div class="info"> <h5>Aspect Ratio:</h5> 2.35 : 1 <a class="tn15more inline" href="/rg/title-tease/aspect/title/tt0083944/technical">more</a> </div> if(preg_match("!<h5>Aspect Ratio:</h5>[\s]*([0-9\.]*)[\s]*:[\s]*([0-9\.]*)!", $pageBuffer, $matches)) { $this->addItemAttribute('ratio', $matches[1]); }*/ return TRUE; }
$HTMLOUT .= "<tr><td style='vertical-align:top'><b>{$lang['details_description']}</b></td><td><a href=\"javascript: klappe_news('a1')\"><img border=\"0\" src=\"pic/plus.gif\" id=\"pica1\" alt=\"[Hide/Show]\" /></a><div id=\"ka1\" style=\"display: none;\"><div style='background-color:#d9e2ff;width:100%;height:150px;overflow: auto'>" . str_replace(array("\n", " "), array("<br />\n", " "), format_comment($row["descr"])) . "</div></div></td></tr>"; } //==09 Poster mod if (!empty($row["poster"])) { $HTMLOUT .= tr("{$lang['details_poster']}", "<a href=\"javascript: klappe_news('a2')\"><img border=\"0\" src=\"pic/plus.gif\" id=\"pica2\" alt=\"[Hide/Show]\" /></a><div id=\"ka2\" style=\"display: none;\"><img src='" . $row["poster"] . "' alt='Poster' title='Poster' /></div>", 1); } else { $HTMLOUT .= tr("{$lang['details_poster']}", "<a href=\"javascript: klappe_news('a2')\"><img border=\"0\" src=\"pic/plus.gif\" id=\"pica2\" alt=\"[Hide/Show]\" /></a><div id=\"ka2\" style=\"display: none;\"><img src='{$INSTALLER09['pic_base_url']}noposter.png' alt='Poster' title='Poster' /></div>", 1); } //==09 auto imdb mod $smallth = ''; if ($row["url"] != "" and strpos($row["url"], 'imdb') and strpos($row["url"], 'title')) { $rurl = trim($row["url"]); $thenumbers = ltrim(strrchr($rurl, 'tt'), 'tt'); $thenumbers = $thenumbers[strlen($thenumbers) - 1] == "/" ? substr($thenumbers, 0, strlen($thenumbers) - 1) : $thenumbers; $thenumbers = preg_replace("[^A-Za-z0-9]", "", $thenumbers); $movie = new imdb($thenumbers); $movieid = $thenumbers; $movie->setid($movieid); $country = $movie->country(); $director = $movie->director(); $write = $movie->writing(); $produce = $movie->producer(); $cast = $movie->cast(); $plot = $movie->plot(); $compose = $movie->composer(); $gen = $movie->genres(); $plotoutline = $movie->plotoutline(); $trailers = $movie->trailers(); $mvlang = $movie->language(); $mvrating = $movie->rating(); if (($photo_url = $movie->photo_localurl()) != FALSE) {
fclose($myfp); // $fdescr=$row["descr"]; tr("<a href=\"javascript: klappe_news('descr')\"><span class=\"nowrap\"><img class=\"minus\" src=\"pic/trans.gif\" alt=\"Show/Hide\" id=\"picdescr\" title=\"" . $lang_detail['title_show_or_hide'] . "\" /> " . $lang_details['row_description'] . "</span></a>", "<div id='kdescr'>" . ($Advertisement->enable_ad() && $torrentdetailad ? "<div align=\"left\" style=\"margin-bottom: 10px\" id=\"ad_torrentdetail\">" . $torrentdetailad[0] . "</div>" : "") . format_comment($fdescr) . "</div>", 1); } if (get_user_class() >= $viewnfo_class && $CURUSER['shownfo'] != 'no' && $row["nfosz"] > 0) { if (!($nfo = $Cache->get_value('nfo_block_torrent_id_' . $id))) { $nfo = code($row["nfo"], $view == "magic"); $Cache->cache_value('nfo_block_torrent_id_' . $id, $nfo, 604800); } tr("<a href=\"javascript: klappe_news('nfo')\"><img class=\"plus\" src=\"pic/trans.gif\" alt=\"Show/Hide\" id=\"picnfo\" title=\"" . $lang_detail['title_show_or_hide'] . "\" /> " . $lang_details['text_nfo'] . "</a><br /><a href=\"viewnfo.php?id=" . $row[id] . "\" class=\"sublink\">" . $lang_details['text_view_nfo'] . "</a>", "<div id='knfo' style=\"display: none;\"><pre style=\"font-size:10pt; font-family: 'Courier New', monospace;\">" . $nfo . "</pre></div>\n", 1); } if ($imdb_id && $showextinfo['imdb'] == 'yes' && $CURUSER['showimdb'] != 'no') { $thenumbers = $imdb_id; $Cache->new_page('imdb_id_' . $thenumbers . '_large', 1296000, true); if (!$Cache->get_page()) { $movie = new imdb($thenumbers); $movieid = $thenumbers; $movie->setid($movieid); $target = array('Title', 'Credits', 'Plot'); switch ($movie->cachestate($target)) { case "0": if ($row['cache_stamp'] == 0 || $row['cache_stamp'] != 0 && time() - $row['cache_stamp'] > $auto_obj->timeout) { //not exist or timed out tr($lang_details['text_imdb'] . $lang_details['row_info'], $lang_details['text_imdb'] . $lang_details['text_not_ready'] . "<a href=\"retriver.php?id=" . $id . "&type=1&siteid=1\">" . $lang_details['text_here_to_retrieve'] . $lang_details['text_imdb'], 1); } else { tr($lang_details['text_imdb'] . $lang_details['row_info'], "<img src=\"pic/progressbar.gif\" alt=\"\" /> " . $lang_details['text_someone_has_requested'] . $lang_details['text_imdb'] . " " . min(max(time() - $row['cache_stamp'], 0), $auto_obj->timeout) . $lang_details['text_please_be_patient'], 1); } break; case "1": reset_cachetimestamp($row['id']); $country = $movie->country();
if (isset($_POST["movieid"])) { // Editing existing movie? $movieid = $_POST["movieid"]; $movie = $moviedm->get($movieid); if (!$movie) { $movie = new Movie(); } // Update movie $movie = fillObject($movie, $_POST, array(), array('movieid', 'autoupdate', 'submit')); // Save movie $movie->id = $moviedm->save($movie); // Save its image if (isset($movie->imdbid) && strlen(trim($movie->imdbid)) > 0) { // IMDB engine require_once $loc . "/lib/imdbphp/imdb.class.php"; $m = new imdb($movie->imdbid); $m->savephoto($photopath . $movie->id . ".jpg"); } // Save its cover if (isset($_FILES["cover"]) && isset($_FILES["cover"]["size"]) && $_FILES["cover"]["size"] > 0) { $movie->addCover("cover", $coverpath); } // Go to the next auto update step if (isset($_POST["autoupdate"]) && $_POST["autoupdate"]) { header("Location: ./?go=imdbupdate&lastid=" . $movie->id); exit; } else { header("Location: ./?go=movie&id=" . $movie->id); exit; } }
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // //////////////////////////////////////////////////////////////////////////////////// error_reporting(E_ALL); ini_set("display_errors", 1); require "include/functions.php"; require "imdb/imdb.class.php"; dbconn(false); global $TABLE_PREFIX; $THIS_BASEPATH = dirname(__FILE__); $LANGPATH = $THIS_BASEPATH . "/language/english"; require_once $LANGPATH . "/lang_main.php"; $movie = new imdb($_GET["mid"]); if (isset($_GET["mid"])) { $movieid = $_GET["mid"]; $movie->setid($movieid); $movie->photodir = './imdb/images/'; $movie->photoroot = './imdb/images/'; $rows = 2; // count for the rowspan; init with photo + year //get current style $resheet = get_result("SELECT(SELECT `style_url` FROM `{$TABLE_PREFIX}style` WHERE `id`=" . $CURUSER["style"] . ") `style_url`, (SELECT `language_url` FROM `{$TABLE_PREFIX}language` WHERE `id`=" . $CURUSER["language"] . ") `language_url`", true, $btit_settings["cache_duration"]); if (!$resheet) { $STYLEPATH = "{$THIS_BASEPATH}/style/xbtit_default"; $STYLEURL = "{$BASEURL}/style/xbtit_default"; } else { $resstyle = $resheet[0]; $STYLEPATH = "{$THIS_BASEPATH}/" . $resstyle["style_url"];
# extended & maintained by Itzchak Rehberg <izzysoft AT qumran DOT org> # # http://www.izzysoft.de/ # # ------------------------------------------------------------------------- # # This program is free software; you can redistribute and/or modify it # # under the terms of the GNU General Public License (see doc/LICENSE) # # ------------------------------------------------------------------------- # # Show what we have in the Cache # ############################################################################# # $Id: cache.php 236 2009-10-06 15:23:07Z izzy $ require_once "imdb.class.php"; require_once "pilot.class.php"; echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n"; echo "<HTML><HEAD>\n <TITLE>IMDBPHP Cache Contents</TITLE>\n"; echo " <STYLE TYPE='text/css'>body,td,th { font-size:12px; }</STYLE>\n"; echo "</HEAD><BODY>\n"; $imdb = new imdb("0"); $pilot = new pilot("0"); $movies = array(); if ($d = opendir($imdb->cachedir)) { while (false !== ($entry = readdir($d))) { if (strstr($entry, "Title")) { $imdbid = substr($entry, 0, 7); if (preg_match('|.pilot$|', $entry)) { $movies[$imdbid]['pilot'] = 1; } else { $movies[$imdbid]['imdb'] = 1; } } } } if (!empty($movies)) {
<?php require_once "include/imdb.class.php"; $foo = imdb::get_details("tt1045778"); var_dump($foo); //imdb::flush_cache(); // echo imdb::cache("Austin Powers in Goldmember", null, imdb::CACHE_TITLE_PAGE);