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"; } # AKAs $aka = $movie->alsoknow(); $cc = count($aka); if (!empty($aka)) { echo '</TD><TD valign=top width=120><b>Also known as:</b> </td><td>'; foreach ($aka as $ak) { echo $ak["title"]; if (!empty($ak["year"])) { echo " " . $ak["year"]; } echo " => " . $ak["country"]; if (empty($ak["lang"])) { if (!empty($ak["comment"])) { echo " (" . $ak["comment"] . ")"; } } else { if (!empty($ak["comment"])) {
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; }
$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++) { $temp .= "{$country[$i]}, "; } $autodata .= rtrim(trim($temp), ",");
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'); } }