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
|
<?php session_start();
if(!empty($_FILES))
{
require("scripts/imgClass.php");
$img = $_FILES['img'];
$ext = strtolower(substr($img['name'],-3));
$allow_ext = array("jpg",'png','gif');
if(in_array($ext,$allow_ext))
{
move_uploaded_file($img['tmp_name'],"images/galerie/".$img['name']);
Img::creerMin("images/galerie/".$img['name'],"images/galerie/min",$img['name'],70,70);
Img::convertirJPG("images/galerie/".$img['name']);
}
else
{
$erreur = "Votre fichier n'est pas une image";
}
}
?>
<div id="galerie" class="scroll-pane">
<?php
$dos = "images/galerie/min";
$dir = opendir($dos);
while($file = readdir($dir))
{
$allow_ext = array("jpg",'png','gif');
$ext = strtolower(substr($file,-3));
if(in_array($ext,$allow_ext))
{
?>
<div class="min">
<a href="images/galerie/<?php echo $file; ?>" rel="galerie"><img src="images/galerie/min/<?php echo $file; ?>"/></a>
</div>
<?php
}
}
if(isset($erreur))
{
echo $erreur;
}
?>
</div>
<div id="galerie-panel">
<h2>Liens</h2>
</div> |
Partager