Supporto The Movie Database

Hi, i have some problem with my script to get tmdb movie keywords.

This is my scripts that i use

if(key == "keywords"){
            var keyw = "";
            $.each( tmdbdata.keywords, function( i, item ) {
                keyw += "" + item.name + ", ";
            });
            $('input[name="keywords"]').val( keyw );
}

The result is: undefined, . whats wrong?

I use same metod to get backdrops with this code

if(key == "images"){
            var imgt = "";
            $.each( tmdbdata.images.backdrops, function( i, item ) {
                imgt += "https://image.tmdb.org/t/p/w300" + item.file_path + "\n";  
            });
            $('textarea[name="imagenes"]').val( imgt );
}

it's work properly

anyone can help?

3 risposte (nella pagina 1 di 1)

Jump to last post

Hi WongKentir,

I think I can assume you're using append_to_response so if that's case, you're probably looking for:

$.each( tmdbdata.keywords.keywords, function( i, item ) {

I think. If not, then I'll need to see an example request (full URL) you're making.

Wow, this great. thanks travis, Love your tips. it's work.

Short, sharp and to the point.

I’m no PHP/Script expert but you guys make learning so much easier. :)

Are you familiar with wordpress?

In other case, I do the same result with another code.

$.getJSON( url + input + "/keywords?" + apikey, function(tmdbdata) {
    $.each(tmdbdata, function(key, val) {
        if(key == "keywords"){
            var valKywd = "";
            $.each( tmdbdata.keywords, function( i, item ) {
            valKywd += "" + item.name + ", "; //
        });
            $('#new-tag-<?php echo get_option("country"); ?>').val( valKywd );
        }
    });
});

It works pretty good, but i don't want custom tax "country". i want default tax of tags, to auto fill up the taxonomy.

i already tried with: tag, tags, post-tags, but not work. Have any idea to solve this case?

SOLVED, thanks :)

Non riesci a trovare un film o una serie Tv? Accedi per crearlo.

Globale

s focalizza la barra di ricerca
p apri menu profilo
esc chiudi una finestra aperta
? apri finestra scorciatoia tastiera

Su tutte le pagine di media

b torna indietro (o al precedente quando applicabile)
e vai alla pagina di modifica

Nelle pagine delle stagioni TV

(freccia destra) vai alla stagione successiva
(freccia sinistra) vai alla stagione precedente

Nelle pagine degli episodi TV

(freccia destra) vai all'episodio successivo
(freccia sinistra) vai all'episodio precedente

Su tutte le pagine di immagini

a apri finestra aggiungi immagine

Su tutte le pagine di modifica

t apri selettore traduzione
ctrl+ s invia modulo

Sulle pagine di discussione

n crea nuova discussione
w segna come visto/non visto
p cambia publico/privato
c cambia chiuso/aperto
a apri attivita
r rispondi alla discussione
l vai all'ultima risposta
ctrl+ enter invia il tuo messaggio
(freccia destra) pagina successiva
(freccia sinistra) pagina precedente

Impostazioni

Vuoi valutare o aggiungere quest'elemento a una lista?

Accedi