}
 foreach ($_POST as $key => $value) {
     if (strpos($key, $prefijo_nominacion_actor) === 0) {
         //Empieza por el prefijo de nominación de actores, es un actor nominado
         if ($value > 0) {
             //echo "<b>Actor:</b> ";
             //Si es positivo, el actor si está nominado, el valor es la categoría
             //y la parte final de la clave, el id del actor/actriz
             $id_actor = substr($key, strlen($prefijo_nominacion_actor));
             $sql = "INSERT INTO nominations(year,category_id,picture_id,nominee_id) VALUES(" . $year . "," . $value . ",'" . $id_imdb . "','" . $id_actor . "')";
             //echo $sql."<br>";
             $sqls[] = $sql;
             //Si el actor/actriz no existe, hay que crearlo
             if (!exists_person($bd, $id_actor)) {
                 $person = new imdb_person($id_actor);
                 $person->setid($id_actor);
                 $nuevo_profesional_nombre = $person->name();
                 $sqls[] = "INSERT INTO people(id,name) VALUES('" . $id_actor . "','" . $nuevo_profesional_nombre . "')";
             }
             $id_rol = get_role($bd, $value);
             if ($id_rol > 0) {
                 //La categoria tiene rol, hay que insertarlo
                 $sqls[] = "INSERT INTO person_picture(person_id,picture_id,role_id) VALUES(" . $id_actor . ",'" . $id_imdb . "'," . $id_rol . ")";
             }
         }
     }
 }
 foreach ($sqls as $i => $valor) {
     //echo $i.": ".$valor."<br>";
     $bd->exec($valor);
     $filas_afectadas++;
Esempio n. 2
0
         require "pilot_person.class.php";
         $person = new pilot_person($_GET["mid"]);
         $charset = "utf8";
         $source = "<A HREF='?engine=imdb&mid={$pid}'>IMDB</A> | <B CLASS='active'>MoviePilot</B>";
         if ($person->get_pilot_imdbfill()) {
             $source .= '<SUP>+i</SUP>';
         }
         break;
     default:
         require "imdb_person.class.php";
         $person = new imdb_person($_GET["mid"]);
         $charset = "iso-8859-1";
         $source = "<B CLASS='active'>IMDB</B> | <A HREF='?engine=pilot&mid={$pid}'>MoviePilot</A>";
         break;
 }
 $person->setid($pid);
 echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n";
 echo "<HTML><HEAD>\n";
 echo " <TITLE>" . $person->name() . " [IMDBPHP2 v" . $person->version . " Demo]</TITLE>\n";
 echo " <STYLE TYPE='text/css'>body,td,th { font-size:12px; font-family:sans-serif; }</STYLE>\n";
 echo "</HEAD>\n<BODY>\n<TABLE BORDER='1' ALIGN='center' STYLE='border-collapse:collapse'>";
 # Name
 echo '<TR><TH COLSPAN="3" STYLE="background-color:#ffb000">';
 echo "[IMDBPHP2 v" . $person->version . " Demo] Details for " . $person->name();
 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 rowspan="28" valign="top">';
 if (($photo_url = $person->photo_localurl()) != FALSE) {
     echo '<div align="center"><img src="' . $photo_url . '" alt="Cover"></div>';
function show_imdb_awards($bd, $id)
{
    global $base_imdb;
    require_once "./" . $base_imdb . "/imdb_person.class.php";
    $person = new imdb_person($id);
    $person->setid($id);
    $aw = $person->awards();
    $aw_count = count($aw['Academy_Awards_USA']['entries']);
    //$aw_count=count($aw['Irish_Film_and_Television_Awards']['entries']);
    if ($aw_count > 0) {
        echo "<table><tr><th>Año</th><th>Resultado</th><th>Categoría</th><th>Película</th></tr>";
    }
    foreach ($aw['Academy_Awards_USA']['entries'] as $fila) {
        $won = $fila['won'] == 1 ? "Ganador" : "Nominado";
        $category = $fila['category'];
        if (!is_synonym($bd, $category, 1) && $fila['award'] == 'Oscar') {
            //Película, la ignoramos, nos interesan las categorías personales
            //Premios honoríficos también los ignoramos, nos interesan los competitivos
            echo "<tr><td>" . $fila['year'] . "</td><td>" . $won . "</td><td>" . get_category_synonym($bd, $category) . "</td><td>";
            foreach ($fila['pictures'] as $film_id => $film_title) {
                echo "<a href='movie.php?mid=" . $film_id . "&engine=imdb'>" . $film_title . "</a>";
            }
            echo "</td></tr>";
        }
    }
    if ($aw_count > 0) {
        echo "</table>";
    }
    echo "</td></tr>";
}