le 13/04/2007 à 21:59
Insertion FLASH ( Youtube, wideo.fr ) pour BBCODE
<?php
//Wideo
$texte = preg_replace("/\[wideo\]([^[]+?)\[\/wideo\]/", "<object type=\"application/x-shockwave-flash\" data=\"$1\" width=\"350\" height=\"250\" base=\"http://www.wideo.fr\"><param name=\"movie\" value=\"$1\" /><param name=\"wmode\" value=\"transparent\" /><param name=\"base\" value=\"http://www.wideo.fr\" /><embed src=\"$1\" width=\"350\" height=\"250\" wmode=\"transparent\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" base=\"http://www.wideo.fr\"><a href=\"$1\" title=\"Reportage M6 Student's Party Montpellier METROPOLIS - wideo\"><img src=\"http://t.kewego.com/t/0/0678/154x114_iLyROoaftkVW_2.jpg\" alt=\"Reportage M6 Student's Party Montpellier METROPOLIS - wideo\"/></a><br /><a href=\"$1\">Reportage M6 Student's Party Montpellier METROPOLIS - wideo</a></embed></object>", $texte);
//Flash
$texte = preg_replace("/\[flash\]([^[]+?)\[\/flash\]/", "<object type=\"application/x-shockwave-flash\" data=\"$1\" width=\"468\" height=\"100\"><param name=\"movie\" value=\"$1\" /><param name=\"wmode\" value=\"transparent\" /></object>", $texte);
?>
Donc la balise bb-code qui insère la vidéo de wideo ne passe pas le validateur alors que "MA" balise bb-code "flash" génère un code valide xhtml 1.0 strict pour l'insertion de "simple" bannière flash !
Si j'essaye de rendre valide la balise d'insertion des vidéos de wideo.fr, ce dernier ne les accepte plus...