szCheminAlbum = $chemin; $this->nbImgCol = 2; } // fin du constructeur // ============================================================= function getDate() { return $this->szDateAlbum; } function getTitre() { return $this->szTitreAlbum; } function AffichePresentation() { global $page_index, $racine; echo "
\"Entrer

Clicker sur l'image pour entrer dans l'album
"; } function ScanAllAbum($Rep) { $indice=0; $fichier ="$this->szCheminAlbum/$Rep/index.neodoc"; $pFichier = fopen($fichier,"r"); if ($pFichier == false) return 1; while ( feof($pFichier) != 1 ) { $szLigne = fgets($pFichier,120); if ($indice ==0) $this->szTitreAlbum = $szLigne; else if ( $indice ==1) $this->szDateAlbum = $szLigne; $indice++; } fclose ($pFichier); } function AfficheAbum ($Rep) { global $page_index, $racine; $indice = 0; $array = array(); $i = 0; if ($Rep == "racine") $monRepertoire = opendir($this->szCheminAlbum); else { $chemin = "$this->szCheminAlbum/$Rep/normal"; $monRepertoire = opendir($chemin); } echo "
\n"; while ($entryName = readdir ($monRepertoire)) { if (($entryName != ".") && ($entryName != "..")) $array[$i++] = $entryName; } closedir($monRepertoire); /* Sort the file in lexicographic mode. */ natcasesort ($array); $array = array_values($array); $total = sizeof($array); for ($i = 0; $i < $total; $i++) { echo " \n"; if ( $indice % $this->nbImgCol ) echo "\n"; $indice++; } echo "
"; if ($Rep == "racine") $fichier ="\"$this->szCheminAlbum/$array[$i]/mini/01.jpg\""; else $fichier ="\"$this->szCheminAlbum/$Rep/mini/$array[$i]\""; echo "
\n"; if ($Rep == "racine") echo "\n"; else echo "\n"; echo "$array[$i]
\n"; if ($Rep == "racine") $this->AfficheCommentaire ($array[$i]); echo "

Clicker sur l'image pour voir la collection

\n"; if ($Rep != "racine") { $monRepertoire = opendir($this->szCheminAlbum); $precedent =""; $suivant = ""; $bTrouve =false; while($entryName = readdir($monRepertoire)) { if ( ($entryName !=".") && ($entryName !="..") ) { if ( $bTrouve == true) { $suivant = $entryName; break; } if ( $entryName == $Rep ) $bTrouve = true; if ( $bTrouve == false) $precedent =$entryName; } // fin if } // fin while echo "\n"; if ( $precedent =="") echo "\n"; echo "\n"; if ( $suivant =="") echo "\n"; echo "
\n"; else echo "\n"; echo "back\n"; echo "home\n"; else echo "\n"; echo "suivant
\n"; } //fin if ($Rep != "racine") echo "
\n"; } // fin ScanAllAbum() function AfficheImage($Rep,$NumImg) { global $page_index, $racine; $fichier ="\"$this->szCheminAlbum/$Rep/normal/$NumImg\""; echo "$NumImg\n"; $chemin = "$this->szCheminAlbum/$Rep/normal"; $monRepertoire = opendir( $chemin ); $precedent =""; $suivant = ""; $bTrouve =false; while($entryName = readdir($monRepertoire)) { if ( ($entryName !=".") && ($entryName !="..") ) { if ( $bTrouve == true) { $suivant = $entryName; break; } if ( $entryName == $NumImg ) $bTrouve = true; if ( $bTrouve == false) $precedent =$entryName; } // fin if } // fin while echo "

\n"; if ( $precedent =="") echo "\n"; echo "\n"; if ( $suivant=="") echo "\n"; echo "
\n"; else echo "\n"; echo "back\n"; echo "home\n"; else echo "\n"; echo "suivant
\n"; } function AfficheCommentaire($nomRep) { global $racine; $commentaire=""; $fichier ="$this->szCheminAlbum/$nomRep/index.neodoc"; $pFichier = fopen($fichier,"r"); if ($pFichier == false) return 1; while ( feof($pFichier) != 1 ) { $szLigne = fgets($pFichier,120); $commentaire.=$szLigne; } fclose ($pFichier); echo "
\n"; echo "
$commentaire
\n"; } } ?>