예제 #1
0
        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)) {
    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) {
        if ($movie['imdb']) {
            $imdb->setid($imdbid);
            $title = $imdb->title();
        } else {
            $pilot->setid($imdbid);
            $title = $pilot->title();
        }
        echo " <TR><TD>{$title}</TD><TD>";
        // IMDB
        if ($movie['imdb']) {
            echo "<a href='movie.php?engine=imdb&mid={$imdbid}'>Cache</a> | ";
        } else {
            echo "Cache | ";
        }
        echo "<a href='http://us.imdb.com/title/tt{$imdbid}'>Remote</TD><TD>";
        // MoviePilot
        if ($movie['pilot']) {
            echo "<a href='movie.php?engine=pilot&mid={$imdbid}'>Cache</a> | ";
예제 #2
0
        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));
    }
    $people = '';
예제 #3
0
 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();
     $imdb_data['runtime'] = $movie->runtime();
     $imdb_data['votes'] = $movie->votes();
     $imdb_data['country'] = $movie->country();
     $imdb = array('country' => 'Country', 'director' => 'Directed by', 'writing' => 'Writing by', 'producer' => 'Produced by', 'cast' => 'Cast', 'plot' => 'Description', 'composer' => 'Music', 'genres' => 'All genres', 'plotoutline' => 'Plot outline', 'trailers' => 'Trailers', 'language' => 'Language', 'rating' => 'Rating', 'title' => 'Title', 'year' => 'Year', 'runtime' => 'Runtime', 'votes' => 'Votes');
     foreach ($imdb as $foo => $boo) {
         if (isset($imdb_data[$foo]) && !empty($imdb_data[$foo])) {
             if (!is_array($imdb_data[$foo])) {
                 $imdb_html .= "<span style='font-weight:bold;color:#800517'>" . $boo . ":</span>&nbsp;" . $imdb_data[$foo] . "<br />\n";
             } elseif (is_array($imdb_data[$foo]) && in_array($foo, array('director', 'writing', 'producer', 'composer', 'cast', 'trailers'))) {
                 foreach ($imdb_data[$foo] as $pp) {
                     if ($foo == 'cast') {
                         $imdb_tmp[] = "<a href='http://www.imdb.com/name/nm" . $pp['imdb'] . "' target='_blank' title='" . (!empty($pp['name']) ? $pp['name'] : 'unknown') . "'>" . (isset($pp['thumb']) ? "<img src='" . $pp['thumb'] . "' alt='" . $pp['name'] . "' border='0' width='20' height='30' />" : $pp['name']) . "</a> as <span style='font-weight:bold'>" . (!empty($pp['role']) ? $pp['role'] : 'unknown') . "</span>";
                     } elseif ($foo == 'trailers') {
                         $imdb_tmp[] = "<a href='" . $pp . "' target='_blank'>" . $pp . "</a>";
예제 #4
0
                }
                $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();
            }
            header("location: " . page("torrent", "details", "", "", "", "id=" . $id));
        } else {
            $db = new DB("torrents");
            $db->delete("torrent_id = {$id}");
            throw new Exception("Could not upload torrent file. please contact staff.");
        }
    } catch (Exception $e) {
        echo error(_t($e->getMessage())) . "<br />";
    }
}
try {
예제 #5
0
         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() . ")";
 echo "<SPAN STYLE='float:right;text-align:right;display:inline !important;font-size:75%;'>Source: [{$source}]</SPAN>";
 echo "</TH></TR>\n";
 flush();
 # Photo
 echo '<TR><TD id="photocol" rowspan="29" valign="top">';
 if (($photo_url = $movie->photo_localurl()) != FALSE) {
     echo '<img src="' . $photo_url . '" alt="Cover">';
 } else {
     echo "No photo available";
예제 #6
0
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;
    }
}
예제 #7
0
             $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">';
 echo "[IMDBPHP2 v" . $movie->version . " Demo] Movie Details for '" . $movie->title() . "' (" . $movie->year() . ")";
 echo "<SPAN STYLE='float:right;text-align:right;display:inline !important;font-size:75%;'>Source: [{$source}]</SPAN>";
 echo "</TH></TR>\n";
 flush();
 # Photo
 echo '<TR><TD id="photocol" rowspan="29" valign="top">';
 if (($photo_url = $movie->photo_localurl()) != FALSE) {
     echo '<img src="' . $photo_url . '" alt="Cover">';
 } else {
     echo "No photo available";
예제 #8
0
 $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) {
     $smallth = '<img width="85" src="' . $photo_url . '" alt="Imdb Picture" />';
 }
 $imdb = '';
 $imdb .= "<a href=\"javascript: klappe_news('a3')\"><img border=\"0\" src=\"pic/plus.gif\" id=\"pica3\" alt=\"[Hide/Show]\" /></a><div id=\"ka3\" style=\"display: none;\">\n";
 $imdb .= "<strong><font color=\"blue\">#######################################################################</font><br />\n";
 $imdb .= "<font color=\"red\" size=\"3\">Information:</font><br />\n";
 $imdb .= "<font color=\"blue\">#######################################################################</font></strong><br />\n";
 $imdb .= "<strong><font color=\"red\"> Title: </font></strong>" . "" . $movie->title() . "<br />\n";
 $imdb .= "<strong><font color=\"red\"> Year: </font></strong>" . "" . $movie->year() . "<br />\n";
 $imdb .= "<strong><font color=\"red\"> Runtime: </font></strong>" . "" . $movie->runtime() . "" . " mins<br />\n";
 $imdb .= "<strong><font color=\"red\"> Votes: </font></strong>" . "" . $movie->votes() . "<br />\n";
 if (!empty($mvrating)) {
     $imdb .= "<strong><font color=\"red\"> Rating: </font></strong>" . "{$mvrating}<br />\n";
 }
 if (!empty($mvlang)) {
     $imdb .= "<strong><font color=\"red\"> Language: </font></strong>" . "{$mvlang}<br />\n";
 }
 if (!empty($country)) {
     $imdb .= "<strong><font color=\"red\"> Country: </font></strong>";
     for ($i = 0; $i + 1 < count($country); $i++) {
         $imdb .= "{$country[$i]}, ";
     }
     $imdb .= "{$country[$i]}<br />\n";
예제 #9
0
 $cast = $movie->cast();
 $plot = $movie->plot();
 $plot_outline = $movie->plotoutline();
 $compose = $movie->composer();
 $gen = $movie->genres();
 //$comment = $movie->comment();
 $similiar_movies = $movie->similiar_movies();
 if (($photo_url = $movie->photo_localurl()) != FALSE) {
     $smallth = "<img src=\"" . $photo_url . "\" width=\"105\" onclick=\"Preview(this);\" alt=\"poster\" />";
 } else {
     $smallth = "<img src=\"pic/imdb_pic/nophoto.gif\" alt=\"no poster\" />";
 }
 $autodata = '<a href="http://www.imdb.com/title/tt' . $thenumbers . '">http://www.imdb.com/title/tt' . $thenumbers . "</a><br /><strong><font color=\"navy\">------------------------------------------------------------------------------------------------------------------------------------</font><br />\n";
 $autodata .= "<font color=\"darkred\" size=\"3\">" . $lang_details['text_information'] . "</font><br />\n";
 $autodata .= "<font color=\"navy\">------------------------------------------------------------------------------------------------------------------------------------</font></strong><br />\n";
 $autodata .= "<strong><font color=\"DarkRed\">" . $lang_details['text_title'] . "</font></strong>" . "" . $movie->title() . "<br />\n";
 $autodata .= "<strong><font color=\"DarkRed\">" . $lang_details['text_also_known_as'] . "</font></strong>";
 $temp = "";
 foreach ($movie->alsoknow() as $ak) {
     $temp .= $ak["title"] . $ak["year"] . ($ak["country"] != "" ? " (" . $ak["country"] . ")" : "") . ($ak["comment"] != "" ? " (" . $ak["comment"] . ")" : "") . ", ";
 }
 $autodata .= rtrim(trim($temp), ",");
 $runtimes = str_replace(" min", $lang_details['text_mins'], $movie->runtime_all());
 $autodata .= "<br />\n<strong><font color=\"DarkRed\">" . $lang_details['text_year'] . "</font></strong>" . "" . $movie->year() . "<br />\n";
 $autodata .= "<strong><font color=\"DarkRed\">" . $lang_details['text_runtime'] . "</font></strong>" . $runtimes . "<br />\n";
 $autodata .= "<strong><font color=\"DarkRed\">" . $lang_details['text_votes'] . "</font></strong>" . "" . $movie->votes() . "<br />\n";
 $autodata .= "<strong><font color=\"DarkRed\">" . $lang_details['text_rating'] . "</font></strong>" . "" . $movie->rating() . "<br />\n";
 $autodata .= "<strong><font color=\"DarkRed\">" . $lang_details['text_language'] . "</font></strong>" . "" . $movie->language() . "<br />\n";
 $autodata .= "<strong><font color=\"DarkRed\">" . $lang_details['text_country'] . "</font></strong>";
 $temp = "";
 for ($i = 0; $i < count($country); $i++) {
예제 #10
0
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("&amp;", "", ""), "{$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;
}
예제 #11
0
 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;
 }
예제 #12
0
 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');
     }
 }
예제 #13
0
//############################################################################
// 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>";
         //			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=\"ver_detalle\"/><input type=\"hidden\" name=\"id_imdb\" value=\"" . $pelicula_id . "\"><input type=\"hidden\" name=\"pelicula_nombre_esp\" value=\"" . $pelicula_nombre_esp . "\"><input type=\"submit\" value=\"ver detalle\"></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=\"ver_detalle\"/> <input type=\"hidden\" name=\"id_imdb\" value=\"" . $pelicula_id . "\"><input type=\"submit\" value=\"ver detalle\"></form>";
         }
     }
 } elseif ($accion == "ver_detalle") {
     $search = new imdbpsearch();
     $movie = new imdb($id_imdb);
     $movie->setid($id_imdb);
     $pelicula_nombre_orig = "" . $movie->title();
     $buscando = $pelicula_nombre_orig;
     $detalle_buscada = $detalle_buscada . "<form method=\"POST\" action=\"" . $this_page . "\">";
     $detalle_buscada = $detalle_buscada . "<table><tr>";
     $detalle_buscada = $detalle_buscada . "<td>";
     $detalle_buscada = $detalle_buscada . "<span style='font-weight:bold;font-size:18px;'>" . $pelicula_nombre_orig . " (" . $movie->year() . ")</span><br>";
     if (!exists_picture($bd, $id_imdb)) {
         $detalle_buscada = $detalle_buscada . "<span style='color:red;'>No existe, se creará con el nombre: </span><input type='hidden' name='nuevo_titulo_ing' value='" . $pelicula_nombre_orig . "'><input type='text' name='nuevo_titulo_esp' value='" . $pelicula_nombre_esp . "'>";
     } else {
         $detalle_buscada = $detalle_buscada . "<span style='color:red;'>(Existe)</span>";
     }
     $detalle_buscada = $detalle_buscada . "</td><td><img src='" . $movie->photo(true) . "' height='200'><br><input type='checkbox' name='guardar_imagen' value='true'>¿Guardar imagen como portada?</td>";
     $detalle_buscada = $detalle_buscada . "</tr>";
     $detalle_buscada = $detalle_buscada . "<tr><td>";
     $director = $movie->director();
     if (!empty($director)) {
예제 #15
0
 $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>&nbsp;Imdb Info<div id=\"ka4\" style=\"display: none;\"><font color=\"green\" size=\"3\">Information:</font><br />\n";
 }
 $autodata .= "<br />\n";
 $autodata .= "<strong><font color=\"yellow\"> Title: </font></strong>" . "" . $movie->title() . "<br />\n";
 $autodata .= "<strong><font color=\"red\"> Also known as: </font></strong>";
 foreach ($movie->alsoknow() as $ak) {
     $autodata .= "" . $ak["title"] . "" . "" . $ak["year"] . "" . "" . $ak["country"] . "" . " (" . "" . $ak["comment"] . "" . ")" . ", ";
 }
 $autodata .= "<br />\n<strong><font color=\"red\"> Year: </font></strong>" . "" . $movie->year() . "<br />\n";
 $autodata .= "<strong><font color=\"red\"> Runtime: </font></strong>" . "" . $movie->runtime() . "" . " mins<br />\n";
 $autodata .= "<strong><font color=\"red\"> Votes: </font></strong>" . "" . $movie->votes() . "<br />\n";
 $autodata .= "<strong><font color=\"red\"> Rating: </font></strong>" . "" . $movie->rating() . "<br />\n";
 $autodata .= "<strong><font color=\"red\"> Language: </font></strong>" . "" . $movie->language() . "<br />\n";
 $autodata .= "<strong><font color=\"red\"> Country: </font></strong>";
 for ($i = 0; $i + 1 < count($country); $i++) {
     $autodata .= "{$country[$i]}, ";
 }
 $autodata .= "{$country[$i]}";
 $autodata .= "<br />\n<strong><font color=\"red\"> All Genres: </font></strong>";
예제 #16
0
파일: imdb.php 프로젝트: Karpec/gizd
    if (!$resheet) {
        $STYLEPATH = "{$THIS_BASEPATH}/style/xbtit_default";
        $STYLEURL = "{$BASEURL}/style/xbtit_default";
    } else {
        $resstyle = mysqli_fetch_array($resheet);
        $STYLEPATH = "{$THIS_BASEPATH}/" . $resstyle["style_url"];
        $STYLEURL = "{$BASEURL}/" . $resstyle["style_url"];
        $LANGPATH2 = $THIS_BASEPATH . "/" . $resstyle["language_url"];
    }
    if ($LANGPATH != $LANGPATH2) {
        require_once $LANGPATH2 . "/lang_main.php";
    }
    $style_css = load_css("main.css");
    //end style
    echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n";
    echo "<HTML><HEAD>\n <TITLE>" . $movie->title() . ' (' . $movie->year() . ")</TITLE>\n";
    ?>
<link rel="stylesheet" type="text/css" href="<?php 
    echo $STYLEURL;
    ?>
/main.css" />
<?php 
    echo "</HEAD>\n<BODY ONLOAD='fix_colspan()' class=\"listaimdb\" style=\"margin: 0px; 0px 0px 0px;\">\n<TABLE border='1'  ALIGN='center' STYLE='border-collapse:collapse' width=100% class=\"listaimdb\">";
    # Title & year
    echo '<TR><td COLSPAN="3" class="header"><center><b>';
    echo $movie->title() . ' (' . $movie->year() . ")</b></center></td></tr>\n";
    flush();
    # Photo
    echo '<TR><TD rowspan="29" valign="top" class="lista">';
    if (($photo_url = $movie->photo_localurl()) != FALSE) {
        echo '<img src="' . $photo_url . '" width="100" height="140" alt="Cover">';