Image $file
\n"; $nom = preg_replace("/\..{3}/",".txt",$file); echo "\"image
"; echo "

Commentaires

"; if (! empty($_POST['pseudo']) and ! empty($_POST['contenu'])) { $pseudo = htmlentities($_POST['pseudo']); $site = htmlentities($_POST['site']); $contenu = text2html($_POST['contenu']); $query = "INSERT INTO galerie (section,fichier,pseudo,site,contenu) VALUES ('".$cat."','".$file."','".$pseudo."','".$site."','".$contenu."')"; echo $query; mysql_query($query) or die(mysql_error()); } $query = "SELECT * FROM galerie WHERE section='$cat' and fichier='$file' ORDER BY id DESC"; $result = mysql_query($query) or die(mysql_error()); if (mysql_num_rows($result) == 0) { echo ""; } else { $i=1; while($row = mysql_fetch_assoc($result)) { $i++; if ($i % 2 == 0) { $class = "gris"; } else { $class = "noir"; } ereg("([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})",$row{'date'},$regs); echo " "; } } echo ""; if (empty($_POST['pseudo']) or empty($_POST['contenu'])) { echo " "; } ?>
Aucun commentaire à ce jour
Par ".$row{'pseudo'}.", le ".$regs[3]."/".$regs[2]."/".$regs[1]." à ".$regs[4].":".$regs[5].":".$regs[6]."
"; $contenu = explode("\n",$row{'contenu'}); foreach($contenu as $key) { print "$key
\n"; } echo "
Pseudo
Site
Contenu