Youtube titel

Gestart doorRobertt5 reacties18 weergaven

6 berichten · pagina 1 van 1

Robertt

Lid · Topicstarter

Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hallo,

Ik probeer via een code achter de titel te komen van youtube filmpje ik heb nu dit

[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]function[/COLOR] getYouTube[COLOR= #007700]([/COLOR][COLOR= #0000BB]$id[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$wat[/COLOR][COLOR= #007700])
{[/COLOR]
    [COLOR= #0000BB]$link[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"http://gdata.youtube.com/feeds/api/videos/"[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$id[/COLOR][COLOR= #007700];[/COLOR]
    [COLOR= #0000BB]$xml[/COLOR] [COLOR= #007700]= new[/COLOR] DOMDocument[COLOR= #007700];[/COLOR]
    [COLOR= #0000BB]$xml[/COLOR] [COLOR= #007700]->[/COLOR]load[COLOR= #007700]([/COLOR][COLOR= #0000BB]$link[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$xml[/COLOR][COLOR= #007700]->[/COLOR]getElementsByTagName[COLOR= #007700]([/COLOR][COLOR= #0000BB]$wat[/COLOR][COLOR= #007700])->[/COLOR]item[COLOR= #007700]([/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700])->[/COLOR]nodeValue[COLOR= #007700];
}[/COLOR]
?>


GEBRUIKEN:
[COLOR= #0000BB]<?php
$titel[/COLOR] [COLOR= #007700]=[/COLOR] getYouTube[COLOR= #007700]([/COLOR][COLOR= #DD0000]YOUTUBE ID[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]title[/COLOR][COLOR= #007700]);[/COLOR]
?>


Maar snap hier niks van? Wie kan me helpen
Afbeelding
0
Jort

Lid

Berichten
524
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
$categorie[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM `categorie`"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$categorie[/COLOR][COLOR= #007700])){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div class="button"><a href="?p=categorie&catogorie=[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]categorie[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]">[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/ucfirst"]ucfirst[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]categorie[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]</a></div>[/COLOR][COLOR= #007700];
}[/COLOR]
?>
0
Robertt

Lid · Topicstarter

Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nieuwe vraag!
0
Berichten
2.692
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Offtopic: Lol emo Mijn functie yummie
Ontopic:
Zet de volgende code in je config of in een ander bestand dat word geincluded:
(NIKS AAN VERANDEREN AUB emo)

[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]function[/COLOR] getYouTube[COLOR= #007700]([/COLOR][COLOR= #0000BB]$id[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$wat[/COLOR][COLOR= #007700])
{[/COLOR]
    [COLOR= #0000BB]$link[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"http://gdata.youtube.com/feeds/api/videos/"[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$id[/COLOR][COLOR= #007700];[/COLOR]
    [COLOR= #0000BB]$xml[/COLOR] [COLOR= #007700]= new[/COLOR] DOMDocument[COLOR= #007700];[/COLOR]
    [COLOR= #0000BB]$xml[/COLOR] [COLOR= #007700]->[/COLOR]load[COLOR= #007700]([/COLOR][COLOR= #0000BB]$link[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$xml[/COLOR][COLOR= #007700]->[/COLOR]getElementsByTagName[COLOR= #007700]([/COLOR][COLOR= #0000BB]$wat[/COLOR][COLOR= #007700])->[/COLOR]item[COLOR= #007700]([/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700])->[/COLOR]nodeValue[COLOR= #007700];
}[/COLOR]
?>


Zet dit op de plek neer waar je het nodig hebt:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] getYouTube[COLOR= #007700]([/COLOR][COLOR= #DD0000]YOUTUBE ID[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]title[/COLOR][COLOR= #007700]);[/COLOR]
?>
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
YOUTUBE ID moet je veranderen naar bijvoorbeeld D7K3wFXJFsQ
dan is $titel de titel van het filmpje wink
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren