Problem with a gallery mambot - Joomla! Forum - community, help and support


hi!
i had modified mambot "galerie répertoire". here's had:
- folder thumbnails
- folder pics , descriptions (have same name except extension)
i want code display name of pic, pic, , description.
my problem: names , pics works description works 1 picture! :s dunno why!!

code: select all

<?php
// on va récupérer le nom de l'image, sans l'extension (pour s'en servir pour la description et pour les thumbnails)
               $point = ".";
               // cherche la postion du '.'  dans le nom de l'image
               $position = strpos($picture, $point);
               // enlève tout ce qui se trouve après le "."
               $picture_name = substr($picture, 0, $position);
               
               // par défaut, la description correspont au nom du fichier
               $description = $picture_name;
               // on recherche l'existence du fichier de légende (même nom que l'image+txt à la fin)
               if (file_exists($repertoire_absolu.$description.".txt")) {
                  $ouvre = fopen($repertoire_absolu.$description.".txt","r");
                  while (!feof($ouvre)) {
                   $lecture = fgets($ouvre, 4096);
                  $donnee = explode("|",$lecture); // parsing des données basé sur "|" : 1ere partie = légende en français, 2eme partie = légende en anglais
                  
                  $description_en = $donnee[1]; // htmlentities permet de convertir les données de la description en entités html
                  $description = $donnee[0];
                  }
               }
            }

            //création du lien <a href> d'appel
            $lien_a = '<a href="'.$repertoire.$picture.'" ';
            $lien_a .='rel="lightbox['.$repertoire.']"';
            $lien_a .=' title="'.$picture_name.'">';

            // création des calques englobant les images.
            $html_body .=chr(9).chr(9).'<tr>'.chr(13);
            $html_body .=chr(9).chr(9).'<td width="35%" align="center">'.chr(13);
            $html_body .=chr(9).chr(9).chr(9).chr(9).'<h3>'.$picture_name.'</h3>'.chr(13);
            $html_body .=chr(9).chr(9).'<div class="vignette">'.chr(13);
            $html_body .=chr(9).chr(9).chr(9).'<div class="image">'.chr(13);
            $html_body .=chr(9).chr(9).chr(9).chr(9).$lien_a.chr(13);
            $html_body .=chr(9).chr(9).chr(9).chr(9).'<img src="'.$repertoire.$rep_min.$picture_name.'.jpg" border="0" width='.$largeur.' height='.$hauteur.' />'.chr(13);
            $html_body .=chr(9).chr(9).chr(9).chr(9).'</a>';
            $html_body .=chr(13).chr(9).chr(9).chr(9).' </div>';
            $html_body .=chr(9).chr(9).'</div>'.chr(13);
            $html_body .=chr(9).chr(9).'</td>'.chr(13);
            $html_body .=chr(9).chr(9).'<td width="65%">'.chr(13);
            $html_body .=chr(9).chr(9).$description.chr(13);
            $html_body .=chr(9).chr(9).'</td>'.chr(13);
            $html_body .=chr(9).chr(9).'</tr>'.chr(13);
         }
      }
      $html_body .=chr(9).''.chr(13).chr(9).'</div>'.chr(13);
      $html_body .=chr(9).''.chr(13).chr(9).'</table>'.chr(13);
   }
?>






Comments