Ok mensen, ik ben bezig met een simpel YouTube Video Feed script,maar ik ben zeer onervaren met PHP en scripten in het algemeen.

Ik krijg het script niet aan het werk en ik zou niet weten waar het aan ligt, heb veel geprobeerd maar niks wil baten. Misschien kunnen jullie mij verder helpen.

Hier is de code:


<?php

$xml = simplexml_load_file('https://gdata.youtube.com/feeds/api/users/'.$_GET['pyrobooby'].'/uploads');

$video_limit = $_GET['10'];

foreach ($xml->entry as $video)

{

if ($count < $video_limit)
{
$id = $video->id;
$url = 'http://gdata.youtube.com/feeds/api/videos/';
$video_id = substr($id, strlen($url));

?>


<div class="video">

<div class="thumbnail_container">
<div class="thumbnail" videoid="<? echo $video_id; ?>"></div>
</div>

<div class="video_details">
<div class="video_title"><? echo $video->title; ?></div>
<div class="video_description"><? echo $video->content; ?></div>
</div>

</div>

<div class="clear"> </div>


<?php
}
$count++;
}
?>
'.$_GET['pyrobooby'].' vervangen door pyrobooby
Wat voor errors krijg je dan?
Verder gebruik de [.code][./code] tags zonder de punt.
Waar komt $count vandaan?
$_GET['10'] wat is dat?
Ik heb net deze script af met behulp van een tutorial en hij doet, maar ik weet niet hoe ik de thumbnail kan laten verschijnen, het enige wat de script nu laat zien is de titel van de video en de beschrijving.

Hoe doe ik dat 'ie ook het plaatje van de video laat zien?

Hier is de script in actie te zien:

http://watdoetnederland.nl/videos.php

En hier is de code:

<?php

$xml = simplexml_load_file('https://gdata.youtube.com/feeds/api/users/pyrobooby/uploads');
$video_limit = 5;
$count = 0;

foreach ($xml->entry as $video)
{
if ($count < $video_limit)
{
$id = $video->id;
$url = 'http://gdata.youtube.com/feeds/api/videos/';
$video_id = substr($id, strlen($url));

?>


<div class="video">

<div class="thumbnail_container">
<div class="thumbnail" videoid="<? echo $video_id; ?>"></div>
</div>

<div class="video_details">
<div class="video_title"><? echo $video->title; ?></div>
<div class="video_description"><? echo $video->content; ?></div>
</div>

</div>

<div class="clear"> </div>


<?php
}
$count++;
}
?>




<?php

$xml = simplexml_load_file('http://gdata.youtube.com/feeds/api/users/pyrobooby/uploads');
$video_limit = 5;
$count = 0;
//echo '<pre>';
//print_r($xml->entry);
foreach ($xml->entry as $video)
{
    if ($count < $video_limit)
    {
        $id = $video->id;
        $url = 'http://gdata.youtube.com/feeds/api/videos/';
        $video_id = substr($id, strlen($url));
    
    ?>



<div class="video">

	<div class="thumbnail_container">
		<div class="thumbnail">
			
			<img src="http://img.youtube.com/vi/<?=$video_id;?>/default.jpg"/>
		
		</div>
	</div>
	
	<div class="video_details">
		<div class="video_title">

			<? echo $video->title; ?>

		</div>

		<div class="video_description">
			
			<? echo $video->content; ?>

		</div>
	</div>
</div>

<div class="clear"></div>

<?php

    }
	
    $count++;
}
?>


Even googlen..

Reageren