1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
| <?php
$erreur = "rentrer le nombre de chansons";
if (!empty($_POST['nombrechamp'])){
$nombre=$_POST['nombrechamp'];
$value= ' value="'.$nombre.'" ';
}
?>
<H1>Création du player</H1>
<div class="chapeau">Lisez le tutorial avant, puis suivez les instructions:</div>
<form class="form_album" action="http://www.pipolass.net/-Album-" method="post">
NOMBRE DE CHANSONS <input class="input_nb" type="text" name="nombrechamp" <?php if (isset($value)){ echo $value; }?> />
<input type="submit" value="OK" /> <br /><br />
<?php
if (!empty($_POST['nombrechamp'])){
$erreur = "ATTENTION pas de caractère spéciaux dans le nom de l'album. <br /> Ni d'espace!! utilisez le '_' si besoin <br /> Tous les champs obligatoire sauf URL image (taille image optimale 95x95)";
echo "Titre album : ".'<input class="input_moy" type="text" name="album">'.'<br />'.'<br />';
$n=1;
while($n<=$nombre)
{
echo "URL mp3 ".$n.' <input class="input_long" type="text" name="chanson'.$n.'"'.' /> '."Titre".' <input class="input_moy" type="text" name="titre'.$n.'"'.' />'.' <br />';
echo "URL image ".' <input class="input_long" type="text" name="image'.$n.'"'.' /> '."Artiste ".'<input class="input_moy" type="text" name="artiste'.$n.'"'.' />'.' <br /> <br />';
$n++;
}
echo ' <br /> <input type="submit" value="créer Album" />';
}
if (isset($_POST['album'])){
$j=1;
$flag=true;
while($j<=$nombre){
if ((empty($_POST['album']))OR(empty($_POST['artiste'.$j]))OR(empty($_POST['chanson'.$j]))OR(empty($_POST['titre'.$j]))){
$flag = false;
}
$j++;
}
if($flag==true){
$j=1;
$contenu="";
while($j<=$nombre){
if ((!empty($_POST['chanson'.$j]))AND(!empty($_POST['artiste'.$j]))AND(!empty($_POST['titre'.$j]))){
$urlmp3 = $_POST['chanson'.$j];
$nomartiste = $_POST['artiste'.$j];
$nomtitre = $_POST['titre'.$j];
$nomimage = $_POST['image'.$j];
$contenutext = "\n<track>\n<url>".$urlmp3."</url>\n<nomart>".$nomartiste."</nomart>\n<titre>".$nomtitre."</titre>\n<image>".$nomimage."</image>\n</track>\n";
$contenu.=$contenutext;
$j++;
}
else{
$j++;
}
}
$erreur = "Merci le fichier de l'album est créer";
$info = "<TEXTAREA rows=14 cols=48>
<html><!--[if !IE]> Standard XHTML object instanciation <!--><object id='flash00' type='application/x-shockwave-flash' data='http://www.pipolass.net/squelettes/IMG/playermusicpipolass.swf' width='425' height='270'>
<!--><![endif]--><!--[if IE]><object id='flash00' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='425' height='270'><![endif]-->
<param name='movie' value='http://www.pipolass.net/squelettes/IMG/playermusicpipolass.swf'>
<param name='quality' value='high' />
<param name='flashvars' value='liste=http://www.pipolass.net/album_".$_POST['album']."' />
</object></html></TEXTAREA>";
$text = fopen("album_".$_POST['album'].".xml", "w+");
fputs($text,"<album>$contenu</album>");
fclose($text);
}
else{
$erreur = "veuillez remplir tous les champs <br /><br /> ATTENTION pas de caractère spéciaux dans le nom de l'album. <br /> Ni d'espace!! utilisez le '_' si besoin <br /> Tous les champs obligatoire sauf URL image";
}
}
echo '<div class="error">'.$erreur.'</div>';
if(isset($info)){
echo '<code>'.$info.'</code>';
echo '<div class="error">Copiez coller le texte ci dessus dans le nouvel article que vous allez créer pour votre album </div>';
}
?>
</form> |
Partager