Posté : 20-02-2007 22:55
<?php
if(!isset($mainfile)) { !include!("mainfile.php"); }
global $pdst; $pdst=1;
!include! ('header.php');
$dev_id = "HSkI3UPljNU";// request your DEV_ID at http://www.youtube.com/signup?next=my_profile_dev
$account = "jipexu";//
$incrementby=3;
$stream=file_get_contents("http://www.youtube.com/api2_rest?method=youtube.videos.list_by_user&dev_id=$dev_id&user=$account");
//mise en tableau
preg_match_all('#<id>(.*?)</id>#',$stream,$regs); ;
$array_id=$regs[1];
preg_match_all('#<author>(.*?)</author>#',$stream,$regs);
$array_author=$regs[1];
preg_match_all('#<title>(.*?)</title>#',$stream,$regs);
$array_title=$regs[1];
preg_match_all('#<length_seconds>(.*?)</length_seconds>#',$stream ,$regs);
$array_length_seconds=$regs[1];
preg_match_all('#<rating_avg>(.*?)</rating_avg>#',$stream,$regs);
$array_rating_avg=$regs[1];
preg_match_all('#<rating_count>(.*?)</rating_count>#',$stream,$re gs);
$array_rating_count=$regs[1];
preg_match_all('#<description>(.*?)</description>#',$stream,$regs );
$array_description=$regs[1];
preg_match_all('#<view_count>(.*?)</view_count>#',$stream,$regs);
$array_view_count=$regs[1];
preg_match_all('#<upload_time>(.*?)</upload_time>#',$stream,$regs );
$array_upload_time=$regs[1];
preg_match_all('#<comment_count>(.*?)</comment_count>#',$stream,$ regs);
$array_comment_count=$regs[1];
preg_match_all('#<tags>(.*?)</tags>#',$stream,$regs);
$array_tags=$regs[1];
preg_match_all('#<url>(.*?)</url>#',$stream,$regs);
$array_url=$regs[1];
preg_match_all('#<thumbnail_url>(.*?)</thumbnail_url>#',$stream,$ regs);
$array_thumbnail_url=$regs[1];
$input = array ("Neo", "Morpheus", "Trinitée", "Cypher", "Tank");
$nb_video=count($array_id);
function random_bloc() {
global $array_id;
srand ((double) microtime() * 10000000);
$video_ran = array_rand ($array_id, 3);
$content.="<object width=\"425\" height=\"350\"><param name=\"movie\" value=\"http://www.youtube.com/v/$video_ran\"></param><param name=\"wmode\" value=\"transparent\"></param><!embed! src=\"http://www.youtube.com/v/$video_ran\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"425\" height=\"350\"></!embed!></object>";
return ($content);
};
/////////////////////////////////////////////////////////////////
/
//////////////////////mise en forme date
for($i=0; $i<count($array_upload_time) ; $i++) {
$b .=strftime ( "%A %e %B %Y, %r_" ,$array_upload_time[$i]);
};
$array_upload_time=preg_split ('#_#',$b);
//////////////////////mise en forme date
for($i=0; $i<$nb_video ; $i++)
{$affichage.="<tr><td>
<strong>".translate("Author")." : </strong>".preg_replace('#jipexu#',"Jean Pierre Barbary",$array_author[$i])."<br/>
<strong>".translate("Title:")." </strong>$array_title[$i]<br />
<strong>Durée : </strong>$array_length_seconds[$i]<br />
<strong>Moyenne vote : </strong>$array_rating_avg[$i]<br />
<strong>".translate("Votes: ")."</strong>$array_rating_count[$i]<br />
<strong>Description : </strong>$array_description[$i]<br />
<strong>Vu : </strong>$array_view_count[$i]<br />
<strong>Date de mise en lig ne : </strong>$array_upload_time[$i]<br />
<strong>".translate("Comment")." : </strong>$array_comment_count[$i]<br />
<strong>Mots clef : </strong>$array_tags[$i]<br />
<a href=\"$array_url[$i]\" title=\"Voir la video sur le site web&nbs p;de youtube, channel Travel in chinese ear th\">Voir</a><br/
<img src =\"$array_thumbnail_url[$i]\" title=\"$array_title[$i]\" alt=\" $array_title[$i] : $array_description[$i]\">
<br /></td><td><object width =\"425\" height=\"350\"><param name=\"movie\" value=\"http://www.youtube.com/v/$array_id[$i]\"></param><param name=\"wmode\" value=\"transparent\"></param><!embed! src=\"http://www.youtube.com/v/$array_id[$i]\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"425\" height=\"350\"></!embed!></object><br /></td> </tr> ";
}
echo "<div class=\"titrgkc\">Vidéos [$nb_video]</div><br /><hr />please be&nb sp;cool on work...<table>
<table border=\"1\">
$affichage
</table>
<br />$nav_block";
!include! ('footer.php');
/////////////////////////////////////////////////////////////////
?>
|