예제 #1
0
 # Seasons
 if ($movie->seasons() != 0) {
     ++$rows;
     echo '<TR><TD><B>Seasons:</B></TD><TD>' . $movie->seasons() . "</TD></TR>\n";
     flush();
 }
 # Year & runtime
 echo '<TR><TD><B>Year:</B></TD><TD>' . $movie->year() . '</TD></TR>';
 $runtime = $movie->runtime();
 if (!empty($runtime)) {
     ++$rows;
     echo "<TR><TD valign=top><B>Runtime:</b></TD><TD>{$runtime} minutes</TD></TR>\n";
 }
 flush();
 # MPAA
 $mpaa = $movie->mpaa();
 if (!empty($mpaa)) {
     ++$rows;
     $mpar = $movie->mpaa_reason();
     if (empty($mpar)) {
         echo '<TR><TD><B>MPAA:</b></TD><TD>';
     } else {
         echo '<TR><TD rowspan="2"><B>MPAA:</b></TD><TD>';
     }
     echo "<table align='left' border='1' style='border-collapse:collapse;background-color:#ddd;'><tr><th style='background-color:#07f;'>Country</th><th style='background-color:#07f;'>Rating</th></tr>";
     foreach ($mpaa as $key => $mpaa) {
         echo "<tr><td>{$key}</td><td>{$mpaa}</td></tr>";
     }
     echo "</table></TD></TR>\n";
     if (!empty($mpar)) {
         echo "<TR><TD>{$mpar}</TD></TR>\n";
예제 #2
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;
 }