Пример #1
0
 $trivia = $movie->trivia();
 $gc = count($trivia);
 if ($gc > 0) {
     ++$rows;
     echo '<tr><td valign=top><b>Trivia:</b></td><td>';
     echo "There are {$gc} entries in the trivia list - like these:<br><ul>";
     for ($i = 0; $i < 5; ++$i) {
         if (empty($trivia[$i])) {
             break;
         }
         echo "<li>" . preg_replace("/http\\:\\/\\/" . str_replace(".", "\\.", $movie->imdbsite) . "\\/name\\/nm(\\d{7})\\//", "person.php?mid=\\1", $trivia[$i]) . "</li>";
     }
     echo "</ul></td></tr>\n";
 }
 # Soundtracks
 $soundtracks = $movie->soundtrack();
 $gc = count($soundtracks);
 if ($gc > 0) {
     ++$rows;
     echo '<tr><td valign=top><b>Soundtracks:</b></td><td>';
     echo "There are {$gc} soundtracks listed - like these:<br>";
     echo "<table align='center' border='1' style='border-collapse:collapse;background-color:#ddd;'><tr><th style='background-color:#07f;'>Soundtrack</th><th style='background-color:#07f;'>Credit 1</th><th style='background-color:#07f;'>Credit 2</th></tr>";
     foreach ($soundtracks as $soundtrack) {
         if (isset($soundtrack["credits"][0])) {
             $credit1 = preg_replace("/http\\:\\/\\/" . str_replace(".", "\\.", $movie->imdbsite) . "\\/name\\/nm(\\d{7})\\//", "person.php?mid=\\1", $soundtrack["credits"][0]['credit_to']) . " (" . $soundtrack["credits"][0]['desc'] . ")";
         } else {
             $credit1 = '';
         }
         if (isset($soundtrack["credits"][1])) {
             $credit2 = preg_replace("/http\\:\\/\\/" . str_replace(".", "\\.", $movie->imdbsite) . "\\/name\\/nm(\\d{7})\\//", "person.php?mid=\\1", $soundtrack["credits"][1]['credit_to']) . " (" . $soundtrack["credits"][1]['desc'] . ")";
         } else {