Bonjour,

j'ai un script qui gère mes albums photos :



index.php

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 <?php 
$curdir = @$_GET["dir"];
if(!$curdir) $curdir = ".";
?>
      <table align="right" dir="rtl" border="0">
<?php
echo "<tr><td>";
echo "".$curdir."<br><br>\n";
echo "</td></tr>";
$dir = opendir($curdir);
while($p=readdir($dir)) {
    if(is_dir($curdir."/".$p)&&($p!=".")) {
        if($p=="..") {
            if($curdir!=".") {
              $tmp = strrpos($curdir,"/"); ?>
                  <tr><td align="center">
                  <?php
                  echo "<a href='?frame=menu&dir=".substr($curdir,0,$tmp)."'
                     target=menu>Retour</a></td></tr>";
               }
            } else {
               echo "<tr><td><a href='?frame=menu&dir=".$curdir."/".$p."' target=menu>".$p."</a>";
            } ?>
            </td></tr>
            <?php
         }
      }
      closedir($dir);
      $dir = opendir($curdir);
      while($p=readdir($dir)) {
         if(is_file($curdir."/".$p)) {
            $ext = strtolower(substr($p, strrpos($p, '.') + 1));
            if(   ($ext=="jpg") || ($ext=="jpeg")
               || ($ext=="gif")
               || ($ext=="bmp")
               || ($ext=="png")) { ?>
               <td align="center" width="200px">
               <?php
				$pos_point = strpos($p, '.');
$titre = substr($p, 0, $pos_point); 
echo $titre;
				echo "<br>";
              ?>
             <a href="<?php echo $curdir."/".$p ?>" target='_blank'><img src="<?php echo $curdir."/".$p ?>" width="100px" height="100px" /></a>
               </td>
               <?php
            }
         }
		  } ?> </tr> </table>
          <?php
      closedir($dir);
      ?>
le principe est simple :

j'ai un dossier "general" qui contient :

* mon fichier "index.php" pour lire mes albums.
* des sous-dossiers(album1, album2, ...) et chaque sous-dossier représente un album bien sur !

voici la structure :

general/

..........index.php

..........album1/
....................photo1.jpg
....................photo2.png

..........album2/
....................photo3.jpg
....................photo4.png

..........album3/
....................photo5.jpg
....................photo6.png


ça marche !

quand je clique sur le nom de l'album(nom album = nom sous-dossier) les photos s'affichent !

quand je clique sur une photo elle s'ouvre dans un nouvel onglet(et c'est normal vu le target='_blank') !

maintenant je cherche un script qui me permet de faire un diapo(pour chaque sous-dossier c'est à dire album) !


Je vous remercie d'avance.