//Autres auteurs : *@author Aucun *@copyright Tela-Botanica 1999-2007 *@version $Revision$ $Date$ // +------------------------------------------------------------------------------------------------------+ */ // +------------------------------------------------------------------------------------------------------+ // | ENTÊTE du PROGRAMME | // +------------------------------------------------------------------------------------------------------+ // Définition de constantes define('DS', DIRECTORY_SEPARATOR); /** Constante "dynamique" stockant le chemin absolue de base de l'application recherche de plante.*/ define('GAL_CHEMIN_APPLI', dirname(realpath(__FILE__)).DS); /** Constante "dynamique" stockant le chemin relatif de base de l'application recherche de plante.*/ define('GAL_CHEMIN_APPLI_RELATIF', str_replace($_SERVER['DOCUMENT_ROOT'], '', GAL_CHEMIN_APPLI)); // Initialisation des variables $sortie = ''; $GLOBALS['_GALLERIE_']['erreur'] = ''; // Inclusion du fichier de config de l'action require_once GAL_CHEMIN_APPLI.'configuration'.DS.'gal_config.inc.php'; //+----------------------------------------------------------------------------------------------------------------+ // Récupération des paramêtres et gestion des erreurs de paramètrage if (!$this->GetParameter('dossier')) { $options['dossier'] = null; $GLOBALS['_GALERIE_']['erreur'] = "Applette GALERIE : le paramètre 'dossier' est obligatoire !"; } else { $options['dossier'] = $this->GetParameter('dossier'); } if (!$this->GetParameter('id')) { $options['id'] = microtime(); //$GLOBALS['_GALERIE_']['erreur'] = "Applette GALERIE : le paramètre 'id' est obligatoire !"; } else { $options['id'] = $this->GetParameter('id'); } if (!$this->GetParameter('largeur')) { $options['largeur'] = 160; } else { $options['largeur'] = $this->GetParameter('largeur'); } if (!$this->GetParameter('hauteur')) { $options['hauteur'] = 160; } else { $options['hauteur'] = $this->GetParameter('hauteur'); } if (!isset($options['qualite'])) { $options['qualite'] = 70; } if (!isset($options['img_largeur'])) { $options['img_largeur'] = 800; } if (!isset($options['img_hauteur'])) { $options['img_hauteur'] = 600; } if (!isset($options['img_qualite'])) { $options['img_qualite'] = 70; } // +------------------------------------------------------------------------------------------------------+ // | CORPS du PROGRAMME | // +------------------------------------------------------------------------------------------------------+ //+----------------------------------------------------------------------------------------------------------------+ // Récupération des données $noimage = 0; $GLOBALS['_GALERIE_']['id'] = $options['id']; $GLOBALS['_GALERIE_']['dossier'] = GAL_CHEMIN_RACINE.$options['dossier']; if (is_dir($GLOBALS['_GALERIE_']['dossier'])) { if ($dh = opendir($GLOBALS['_GALERIE_']['dossier'])) { while (($f = readdir($dh)) !== false) { if((substr(strtolower($f),-3) == 'jpg') || (substr(strtolower($f),-3) == 'gif') || (substr(strtolower($f),-3) == 'png')) { $noimage++; $images[] = array('filename' => $f, 'hauteur' => $h, 'largeur' => $w); array_multisort($images, SORT_ASC, SORT_REGULAR); } } closedir($dh); } } else { $GLOBALS['_GALERIE_']['erreur'] = "Applette GALERIE : le dossier d'images est introuvable à : ".$GLOBALS['_GALERIE_']['dossier']; } if($noimage) { $GLOBALS['_GALERIE_']['css']['chemin'] = GAL_CHEMIN_STYLES_RELATIF; $GLOBALS['_GALERIE_']['css']['largeur'] = $options['largeur']; $GLOBALS['_GALERIE_']['script']['chemin'] = GAL_CHEMIN_SCRIPTS_RELATIF; $GLOBALS['_GALERIE_']['images'] = array(); foreach($images as $image) { if ($image['filename'] != '') { $aso_img['fichier_nom'] = $image['filename']; $aso_img['url_img'] = 'http://'.$_SERVER['HTTP_HOST'].GAL_CHEMIN_SCRIPTS_RELATIF.'showthumb.php?img='.urlencode(GAL_CHEMIN_RACINE.$options['dossier'].DS.$image['filename']).'&width='.$options['img_largeur'].'&height='.$options['img_hauteur'].'&quality='.$options['img_qualite']; $aso_img['url_img_mini'] = 'http://'.$_SERVER['HTTP_HOST'].GAL_CHEMIN_SCRIPTS_RELATIF.'showthumb.php?img='.urlencode(GAL_CHEMIN_RACINE.$options['dossier'].DS.$image['filename']).'&width='.$options['img_largeur'].'&height='.$options['img_hauteur'].'&quality='.$options['qualite']; $GLOBALS['_GALERIE_']['images'][] = $aso_img; } } } //+----------------------------------------------------------------------------------------------------------------+ // Gestion des squelettes // Extrait les variables et les ajoutes à l'espace de noms local extract($GLOBALS['_GALERIE_']); // Démarre le buffer ob_start(); // Inclusion du fichier include GAL_CHEMIN_SQUELETTE.GAL_SQUELETTE_LISTE; // Récupérer le contenu du buffer $sortie = ob_get_contents(); // Arrête et détruit le buffer ob_end_clean(); //+----------------------------------------------------------------------------------------------------------------+ // Sortie echo $sortie; /* +--Fin du code ----------------------------------------------------------------------------------------+ * * $Log$ * * +-- Fin du code ----------------------------------------------------------------------------------------+ */ ?>