// Add the control device.
$form_array[] = array('control', 'phase_1', 4);
et avant le code ci-dessus ajoutez : // Youtube
if (USER_ID) {
$form_array[] = 'Youtube uploads';
$form_array[] = array('', 'YT_array[]', 0, 256, 3);
$form_array[] = 'Note: YouTube videos must be added in the form http://www.youtube.com/watch?v=xxxxxxxxxxx';
}
//Now we must prepare the inital form for adding the pictures to the database, and we must move them to their final location.
et avant le code ci-dessus ajoutez : // youtube
$YT_array = count($_POST['YT_array']);
if ($YT_array) {
$YT_failure_array = array();
for ($counter = 0; $counter < $YT_array; $counter++) {
// Create the failure ordinal for ordering the report of failed uploads.
$failure_cardinal = $counter + 1;
$failure_ordinal = ''.$failure_cardinal.'. ';
$YT_URI = $_POST['YT_array'][$counter];
if (!$YT_URI) continue;
if (preg_match('/youtube\.com\/watch\?v=(.*)/', $YT_URI, $matches)){
$vid = $matches[1];
$xurl = "http://www.youtube.com/api2_rest?method=youtube.videos.get_details&dev_id=xxxxxxxxxxx&video_id=$vid";
$xdata = file_get_contents($xurl);
file_put_contents("albums/edit/yt_$vid.xml", $xdata);
// todo: parse the xml properly
if (preg_match('/<thumbnail_url>(.*)<\/thumbnail_url>/', $xdata, $xmatches)){
$thumbnail = $xmatches[1];
$rh = fopen($thumbnail, 'rb');
$wh = fopen("albums/edit/yt_$vid.jpg", 'wb');
while (!feof($rh)) fwrite($wh, fread($rh, 1024));
fclose($rh);
fclose($wh);
$escrow_array[] = array('actual_name'=>"youtube_$vid.jpg", 'temporary_name'=> "yt_$vid.jpg");
} else {
$YT_failure_array[] = array( 'failure_ordinal'=>$failure_ordinal, 'URI_name'=> $YT_URI, 'error_code'=> $xdata);
}
} else {
$YT_failure_array[] = array( 'failure_ordinal'=>$failure_ordinal, 'URI_name'=> $YT_URI, 'error_code'=> 'Failed to find video');
}
}
}
Dans le block ci-dessus remplacez les "xxxxxxxxxxxx" par vos identifiants de développeur YouTube. $zip_error_count = count($zip_failure_array);
et à la suite, ajoutez ceci : $YT_error_count = count($YT_failure_array);
// Create error report if we have errors.
if (($file_error_count + $URI_error_count + $zip_error_count) > 0) {
et remplacez par ceci :
// Create error report if we have errors.
if (($file_error_count + $URI_error_count + $zip_error_count + $YT_error_count) > 0) {
// Close the error report table.
endtable()
et avant le code ci-dessus, placez ceci :
// Look for YT upload errors.
if ($YT_error_count > 0) {
// There are URI upload errors. Generate the section label.
form_label("YT errors:");
echo "<tr><td>URI</td><td>Error message</td></tr>";
// Cycle through the file upload errors.
for ($i=0; $i < $YT_error_count; $i++) {
// Print the error ordinal, file name, and error code.
echo "<tr><td>{$YT_failure_array[$i]['failure_ordinal']} {$YT_failure_array[$i]['URI_name']}</td><td>{$YT_failure_array[$i]['error_code']}</td></tr>";
}
}
$form_array = array(
sprintf($lang_upload_php['max_fsize'], $CONFIG['max_upl_size']),
array($lang_upload_php['album'], 'album', 2),
array('MAX_FILE_SIZE', $max_file_size, 4),
array($lang_upload_php['picture'], 'userpicture', 1, 1),
array($lang_upload_php['pic_title'], 'title', 0, 255, 1),
array($captionLabel, 'caption', 3, $CONFIG['max_img_desc_length']),
array($lang_upload_php['keywords'], 'keywords', 0, 255, 1),
array('event', 'picture', 4)
);
remplacez le code ci-dessus par celui-ci :
if (preg_match('/^youtube_(.*)\.jpg$/', $file_set[0], $ytmatches)){
$vid = $ytmatches[1];
$xdata = file_get_contents("albums/edit/yt_$vid.xml");
// todo: parse the xml properly
preg_match('/<description>(.*)<\/description>/', $xdata, $xmatches);
$description = substr($xmatches[1], 0, $CONFIG['max_img_desc_length']);
// todo: parse the xml properly
preg_match('/<tags>(.*)<\/tags>/', $xdata, $xmatches);
$keywords = $xmatches[1];
// todo: parse the xml properly
preg_match('/<title>(.*)<\/title>/', $xdata, $xmatches);
$title = substr($xmatches[1], 0, 255);
$form_array = array(
array($lang_upload_php['album'], 'album', 2),
array($lang_upload_php['pic_title'], 'title', 0, 255, 1, $title),
array($captionLabel, 'caption', 3, $CONFIG['max_img_desc_length'], $description),
array($lang_upload_php['keywords'], 'keywords', 0, 255, 1, $keywords),
array('control', 'phase_2', 4),
array('unique_ID', $_POST['unique_ID'], 4),
);
} else {
$form_array = array(
sprintf($lang_upload_php['max_fsize'], $CONFIG['max_upl_size']),
array($lang_upload_php['album'], 'album', 2),
array('MAX_FILE_SIZE', $max_file_size, 4),
array($lang_upload_php['picture'], 'userpicture', 1, 1),
array($lang_upload_php['pic_title'], 'title', 0, 255, 1),
array($captionLabel, 'caption', 3, $CONFIG['max_img_desc_length']),
array($lang_upload_php['keywords'], 'keywords', 0, 255, 1),
array('event', 'picture', 4)
);
}
if (isset($image_size['reduced'])) {
et remplacez par :
if (preg_match('/^youtube_(.*)\.jpg$/', $CURRENT_PIC_DATA['filename'], $ytmatches)){
$vid = $ytmatches[1];
$pic_html = '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/'. $vid . '"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'. $vid . '" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object><br /><table align=\"center\">';
} elseif (isset($image_size['reduced'])) {
Si vous ne trouvez pas if (isset($image_size['reduced'])) { dans votre fichier theme.php, ouvrez le fichier theme.php (votre-cpg/themes/sample/theme.php) et copiez/collez l'ensemble de function theme_html_picture()1YouTube internal error. Please report this issue -- including the exact method of producing this error -- to YouTube.
// Check to see if user can upload pictures. Quit with an error if he cannot.
if (!function_exists('file_put_contents')) {
function file_put_contents($n,$d) {
$f=@fopen($n,"w");
if (!$f) {
return false;
} else {
fwrite($f,$d);
fclose($f);
return true;
}
}
}
puisse lancer mon site au plus vite !pas de précipitation ! ;)
Fatal error: Call to undefined function: file_put_contents() in /home/music/public_html/gallery/upload.php on line 1996
Révisez le code que vous avez coller. Il semble qu'une fonction ne soit pas interprétée !je te ferai bien une copie du fichier upload ici, mais je sais pas si c'est autorisé !Oui c'est autorisé, mais inutile d'expédier l'intégralité du fichier. "Zoomez" sur la zone du code concerné !
// $zip_upload_count = count($_FILES['ZIP_array']['name']);
// youtube
$YT_array = count($_POST['YT_array']);
if ($YT_array) {
$YT_failure_array = array();
for ($counter = 0; $counter < $YT_array; $counter++) {
// Create the failure ordinal for ordering the report of failed uploads.
$failure_cardinal = $counter + 1;
$failure_ordinal = ''.$failure_cardinal.'. ';
$YT_URI = $_POST['YT_array'][$counter];
if (!$YT_URI) continue;
if (preg_match('/youtube\.com\/watch\?v=(.*)/', $YT_URI, $matches)){
$vid = $matches[1];
$xurl = "http://www.youtube.com/api2_rest?method=youtube.videos.get_details&dev_id=sXOUCtsNYSg&video_id=$vid";
$xdata = file_get_contents($xurl);
[u][b]file_put_contents("albums/edit/yt_$vid.xml", $xdata);[/b][/u]
// todo: parse the xml properly
if (preg_match('/<thumbnail_url>(.*)<\/thumbnail_url>/', $xdata, $xmatches)){
$thumbnail = $xmatches[1];
$rh = fopen($thumbnail, 'rb');
$wh = fopen("albums/edit/yt_$vid.jpg", 'wb');
while (!feof($rh)) fwrite($wh, fread($rh, 1024));
fclose($rh);
fclose($wh);
$escrow_array[] = array('actual_name'=>"youtube_$vid.jpg", 'temporary_name'=> "yt_$vid.jpg");
} else {
$YT_failure_array[] = array( 'failure_ordinal'=>$failure_ordinal, 'URI_name'=> $YT_URI, 'error_code'=> $xdata);
}
} else {
$YT_failure_array[] = array( 'failure_ordinal'=>$failure_ordinal, 'URI_name'=> $YT_URI, 'error_code'=> 'Failed to find video');
}
}
}
// youtube
$YT_array = count($_POST['YT_array']);
if ($YT_array) {
$YT_failure_array = array();
for ($counter = 0; $counter < $YT_array; $counter++) {
// Create the failure ordinal for ordering the report of failed uploads.
$failure_cardinal = $counter + 1;
$failure_ordinal = ''.$failure_cardinal.'. ';
$YT_URI = $_POST['YT_array'][$counter];
if (!$YT_URI) continue;
if (preg_match('/youtube\.com\/watch\?v=(.*)/', $YT_URI, $matches)){
$vid = $matches[1];
$xurl = "http://www.youtube.com/api2_rest?method=youtube.videos.get_details&dev_id=xxxxxxxxxxx&video_id=$vid";
$xdata = file_get_contents($xurl);
file_put_contents("albums/edit/yt_$vid.xml", $xdata);
// todo: parse the xml properly
if (preg_match('/<thumbnail_url>(.*)<\/thumbnail_url>/', $xdata, $xmatches)){
$thumbnail = $xmatches[1];
$rh = fopen($thumbnail, 'rb');
$wh = fopen("albums/edit/yt_$vid.jpg", 'wb');
while (!feof($rh)) fwrite($wh, fread($rh, 1024));
fclose($rh);
fclose($wh);
$escrow_array[] = array('actual_name'=>"youtube_$vid.jpg", 'temporary_name'=> "yt_$vid.jpg");
} else {
$YT_failure_array[] = array( 'failure_ordinal'=>$failure_ordinal, 'URI_name'=> $YT_URI, 'error_code'=> $xdata);
}
} else {
$YT_failure_array[] = array( 'failure_ordinal'=>$failure_ordinal, 'URI_name'=> $YT_URI, 'error_code'=> 'Failed to find video');
}
}
}
Merci d'avance!
UP :)en règle générale, si il n'y a pas de réponse, c'est que personne n'est en mesure de vous aider.
Bonjour,
Je ne me suis plus penché sur ce MOD depuis Octobre 2006 !
Il n'est pas improbable que YouTube (Google maintenant) ait modifié un point crucial !
Par ailleurs, je ne possède pas le temps pour me consacrer aux investigations nécessaires ;)
PYAP
$pic_html = '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/'. $vid . '"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'. $vid . '" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object><br /><table align=\"center\">';
J'ai enlevé: <table align=\"center\"> à cette ligne de code et c'est bon maintenant !J'ai trouvé !!!Super ;D
Si ça peut aider d'autres que moi tant mieuxOui évidement ! Tous ceux qui utilisent, ou désirent utiliser ce MOD/HACK ;)
$vid = $matches[1];
$xurl = "http://www.youtube.com/api2_rest?method=youtube.videos.get_details&dev_id=xxxxxxxxxxx&video_id=$vid";
$xdata = file_get_contents($xurl);
file_put_contents("albums/edit/yt_$vid.xml", $xdata);
// todo: parse the xml properly
if (preg_match('/<thumbnail_url>(.*)<\/thumbnail_url>/', $xdata, $xmatches)){
$thumbnail = $xmatches[1];
$rh = fopen($thumbnail, 'rb');
$wh = fopen("albums/edit/yt_$vid.jpg", 'wb');
while (!feof($rh)) fwrite($wh, fread($rh, 1024));
fclose($rh);
fclose($wh);
$vid = $matches[1];
$xurl = "http://www.youtube.com/api2_rest?method=youtube.videos.get_details&dev_id=xxxxxxxxxxx&video_id=$vid";
$ch = curl_init($xurl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$xdata = curl_exec ($ch);
curl_close ($ch);
file_put_contents("albums/edit/yt_$vid.xml", $xdata);
// todo: parse the xml properly
if (preg_match('/<thumbnail_url>(.*)<\/thumbnail_url>/', $xdata, $xmatches)){
$thumbnail = $xmatches[1];
$ch = curl_init($thumbnail);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$xdata = curl_exec ($ch);
curl_close ($ch);
file_put_contents("albums/edit/yt_$vid.jpg", $xdata);
*** Si vous obtenez un message d'erreur comme celui-ci, il est très probable que vous n'avez pas renseigné votre ID dev YouTube correctement !
Pour la vidéo dans les commentaires j'ai pas testé mais si le HTML est autorisé dans les commentaires ça ne peut que marcher (sans ce mod)merci ^^
Ce mod permet de faire ça : http://media3.fanaticf1.com/displayimage.php?pos=-1271
Fatal error: Call to undefined function: file_put_contents() in /homepages/32/d209842248/htdocs/le_site/coppermine/upload.php on line 2004Qu'ais je pu oublier????
Waouh ! Je n'avais pas vu ce MOD depuis le 31 - x - 2006bha ça faisait encore plus longtemps que je n'étais pas venu par là aussi ;D
Une limite est-elle présente sur le nombre de fichiers ou la taille ?
Nous n’imposons aucune taille maximale pour un fichier sur votre Espace Web.
Une seule limitation quand au nombre de fichiers est imposées.
Vous ne pouvez pas placer plus de 262 144 fichiers sur votre Espace Web.
Sinon impossible aussi de mettre une vidéo avi en ligneNous parlons dans ce Sujet de Vidéos Youtube et non de AVI ou autres !