Rev 15 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?php/*vim: set expandtab tabstop=4 shiftwidth=4: */// +------------------------------------------------------------------------------------------------------+// | PHP version 4.1 |// +------------------------------------------------------------------------------------------------------+// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |// +------------------------------------------------------------------------------------------------------+// | This library is free software; you can redistribute it and/or |// | modify it under the terms of the GNU Lesser General Public |// | License as published by the Free Software Foundation; either |// | version 2.1 of the License, or (at your option) any later version. |// | |// | This library is distributed in the hope that it will be useful, |// | but WITHOUT ANY WARRANTY; without even the implied warranty of |// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |// | Lesser General Public License for more details. |// | |// | You should have received a copy of the GNU Lesser General Public |// | License along with this library; if not, write to the Free Software |// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |// +------------------------------------------------------------------------------------------------------+// CVS : $Id: eflore_photo.inc.php,v 1.6 2004-08-17 11:13:38 linda Exp $/*** Titre** Description**@package nom_du_paquetage*@subpackage nom_du_sous-paquetage_si_necessaire//Auteur original :*@author linda ANGAMA<linda_angama@yahoo.fr>//Autres auteurs :*@author Aucun*@copyright Tela-Botanica 2000-2004*@version $Revision: 1.6 $ $Date: 2004-08-17 11:13:38 $*/$res='';GEN_stockerStyleExterne('photo', GEN_CHEMIN_CLIENT.'eflore/presentations/styles/photo.css');//connexion a la baseif (DB::isError($GLOBALS['db_eflore'])){echo '<ERREUR>';echo 'Impossible d\'établir de connexion '.$GLOBALS['db_eflore']->getMessage();echo '</ERREUR>';exit;}//requete sql$req_img='select * from eflore_info_image, eflore_info_txt_a_taxon, eflore_inventaire_observation, eflore_licence, eflore_personne_contributeur';$req=' where eii_id_image=eitat_id_taxon_ref ';$req.=' and eii_id_version_projet_img=eitat_id_version_projet_taxon_ref ';$req.=' and eio_ce_image=eii_id_image ';$req.=' and eii_id_version_projet_img=eio_ce_version_projet_img ';$req.=' and eii_ce_licence_img=eli_id_licence';$req.=' and eitat_id_texte='.N_TAXON;$req.=' and eitat_id_version_projet_txt='.N_VERSION_PROJET_TAXON;$req.=' and epc_id_contributeur=eii_ce_contributeur_image';if (isset($_GET['suppr'])){$req.=' and eii_ce_contributeur_image='.CONTRIBUTEUR;}$req_img.=$req;$resultat_img=$GLOBALS['db_eflore']->query($req_img);(DB::isError($resultat_img)) ?die (BOG_afficherErreurSql(__FILE__, __LINE__, 'img:'.$resultat_img->getMessage(), $req_img)) : '' ;$nbre_ligne=$resultat_img->numRows();//-------------------------------------------PAGE AVEC LA PHOTO TAILLE REELLE-------------------------------------------------//if (isset($_GET['agrandit'])){$req_img.=' and eii_id_image='.$_GET['id'];$resultat_img=$GLOBALS['db_eflore']->query($req_img);(DB::isError($resultat_img)) ?die (BOG_afficherErreurSql(__FILE__, __LINE__, 'img:'.$resultat_img->getMessage(), $req_img)) : '' ;$ligne=& $resultat_img->fetchRow(DB_FETCHMODE_ASSOC);$req_nom='select *';$req_nom.=' from eflore_selection_nom , eflore_nom ';$req_nom.=' LEFT JOIN eflore_botaniste_intitule_abreviation ON en_ce_auteur_basio= ebia_id_intitule_botaniste_abrege';$req_nom.=' where esn_id_taxon='.N_TAXON;$req_nom.=' and esn_id_version_projet_taxon='.N_VERSION_PROJET_TAXON;$req_nom.=' and esn_id_nom=en_id_nom';if ($ligne['eio_ce_autre_nom_latin']==0){$req_nom.=' and en_id_nom='.selectNom();}else {$req_nom.=' and en_id_nom='.$ligne['eio_ce_autre_nom_latin'];}$resultat_nom=$GLOBALS['db_eflore']->query($req_nom);(DB::isError($resultat_nom)) ?die (BOG_afficherErreurSql(__FILE__, __LINE__, 'cpt:'.$resultat_nom->getMessage(), $req_nom)) : '' ;$nom=& $resultat_nom->fetchRow(DB_FETCHMODE_ASSOC);$req_cat='select * from eflore_info_image_valeur, eflore_info_image_posseder_valeur';$req_cat.=' where eiipv_id_valeur_categorie_img= eiiv_id_valeur_categorie_img ';$req_cat.=' and eiipv_id_image='.$_GET['id'];$resultat_cat=$GLOBALS['db_eflore']->query($req_cat);(DB::isError($resultat_cat)) ?die (BOG_afficherErreurSql(__FILE__, __LINE__, 'cpt:'.$resultat_cat->getMessage(), $req_cat)) : '' ;$res.='<div>';$res.='<p><a href="'.EFLORE_CHEMIN_APPLI.'&onglet=photo&deb='.$_SESSION['dep'].'">Retour à la miniature</a></p>';$res.='<p>'.EN_ID_NOM.$nom['en_nom_genre'].' '.$nom['en_epithete_espece'].' '.$nom['ebia_intitule_botaniste_abrege'].'</p>';if ($ligne['eio_ce_autre_nom_latin']!=0){$res.='<p>'.EIO_AUTRE_FLORE.$ligne['eio_autre_flore'].'</p>';}$res.='<p>'.CONTRIBUTEUR_IMG.$ligne['epc_nom_principal'].'</p>';$res.='<p>'.EII_AUTEUR_IMG.$ligne['eii_auteur_img'].'</p>';if ($ligne['eio_autre_auteur_determination']!=NULL){$res.='<p>'.EIO_AUTRE_AUTEUR_DETERMINATION.$ligne['eio_autre_auteur_determination'].'</p>';}while($cat=& $resultat_cat->fetchRow(DB_FETCHMODE_ASSOC)){switch ($cat['eiiv_ce_categorie_img']) {case 1:$res.='<p>'.NATURE.$cat['eiiv_intitule_valeur_categorie_img'].'</p>';break;case 2:$res.='<p>'.DEVELOPPEMENT.$cat['eiiv_intitule_valeur_categorie_img'].'</p>';break;case 3:$res.='<p>'.SUJET.$cat['eiiv_intitule_valeur_categorie_img'].'</p>';}}$res.='<p>'.EIS_LIEUDIT.'</p>';$form_date=substr($ligne['eio_date_observation'],0,4);if (($mois=substr($ligne['eio_date_observation'],5,2))!='00'){$form_date=$mois.'/'.$form_date;}if (($jour=substr($ligne['eio_date_observation'],8,2))!='00'){$form_date=$jour.'/'.$form_date;}$res.='<p>'.DATE_IMG.$form_date.'</p>';$info='';if ($ligne['eii_description_courte_img']!=NULL){$info=$ligne['eii_description_courte_img'];}else {$info=$ligne['eii_description_longue_img'];}if ($ligne['eii_description_courte_img']!=NULL || $ligne['eii_description_longue_img']!=NULL){$res.='<p>Informations complémentaires : '.$info.'</p>';}$res.='<div class="debord"><img src="'.$_GET['agrandit'].'"></div></div>';$res.=$ligne['eli_texte_licence'];}//-----------------------------------------PAGE AVEC L'AFFICHAGE DES MINIATURES------------------------------------------------//else{if (!isset($_GET['deb'])) {$deb=0;}else {$deb=$_GET['deb'];}$_SESSION['dep']=$deb;$img_pg=6;$img_l=3;$prec=null;$suiv=null;if (!isset($_GET['suppr'])){//affichage du lien vers le formulaire de soumission d'images$res.='<a href="'.EFLORE_CHEMIN_APPLI.'&onglet=photo&soum=1">'.FORM_AJOUT.'</a>';if ($nbre_ligne==0){$res.='<p class="plein_texte">Il n\'y a aucune illustration de ce taxon disponible</p>';}$res.='<br /><a href="'.EFLORE_CHEMIN_APPLI.'&onglet=photo&suppr=1">'.FORM_MODIF.'</a>';}else{$res.='<p><a href="'.EFLORE_CHEMIN_APPLI.'&onglet=photo&deb='.$_SESSION['dep'].'">'.AFF_MINI.'</a></p>';}//selection des lignes de la requete à traiterif (($deb+$img_pg+1)<=($nbre_ligne)){$fin=$deb+$img_pg-1;}else{$fin=$nbre_ligne-1;}//affichage des miniatures et génération des fichiers rdfif ($fin!==0){$res.=' <ul class="liste_photo">'."\n";$i=0;foreach (range($deb, $fin) as $num_ligne){if (!$ligne =& $resultat_img->fetchrow(DB_FETCHMODE_ASSOC, $num_ligne)){break;}if ($num_ligne%$img_l==0){$res.=' ';$res.='<li class="colonne">';$res.="\n ";$res.='<ul>'."\n";}$i++;$url_img=$ligne['eii_lien_vers_img'];$url_img_mini=EFLORE_CHEMIN_IMG_PLTE.'mini_photos_plte/mini_';$url_img_mini .=$ligne['eii_id_image'].'.jpg';if ($ligne['eii_lien_vers_img']!=EFLORE_CHEMIN_IMG_PLTE){$url_img .=$ligne['eii_nom_fichier_img'];}else{$url_img .=$ligne['eii_id_image'].'.jpg';}$res.=' ';$res.='<li class="ligne">'."\n";$res.=' ';$res.='<p class="info">';if (!@fopen($url_img,'r')){$res.="\n ";$res.='<img src="'.$url_img_mini.'" alt="'.$ligne['eii_description_courte_img'].' date:'.$ligne['eio_date_observation'].'" border=0 />';$res.="\n ";$res.='</a>';$res.="\n ";$res.="\n ";$res.='</p>';$res.="\n ";$res.="\n ";$res.='<p class="label">';$res.="\n ";$res.=DEFAUT_IMG.'<br />';$res.="\n ";$res.=AUTEUR.$ligne['eii_auteur_img'];$res.="\n ";$res.='</p>';$res.="\n ";$res.='</li>'."\n";}else{if (!isset($_GET['suppr'])){$res.='<a href="'.EFLORE_CHEMIN_APPLI.'&onglet=photo&agrandit='.$url_img.'&id='.$ligne['eii_id_image'].'">';}else{$res.='<a href="'.EFLORE_CHEMIN_APPLI.'&onglet=photo&modif=1&id='.$ligne['eii_id_image'].'">';}$res.="\n ";$res.='<img src="'.$url_img_mini.'" alt="'.$ligne['eii_description_courte_img'].DATE_IMG.$ligne['eio_date_observation'].'" border=0 />';$res.="\n ";$res.='</a>';$res.="\n ";$res.="\n ";$res.='</p>';$res.="\n ";$res.="\n ";$res.='<p class="label">';$res.="\n ";$res.=POIDS.$ligne['eii_poids_img'].' ko<br />';$res.="\n ";$res.=TAILLE.$ligne['eii_larg_img'].'x'.$ligne['eii_long_img'].' px<br />';$res.="\n ";$res.=AUTEUR.$ligne['eii_auteur_img'];$res.="\n ";$res.='</p>';$res.="\n ";$res.='</li>'."\n";}if ($num_ligne%$img_l==($img_l-1)){$res.=" </ul></li> \n";$res.='<li class="colonne"><span class="spacer"></span></li>';}if (!isset($_GET['suppr'])){generationRdf($ligne);}}$res.='<li class="colonne"><span class="spacer"></span></li>';$res.="</ul>\n";//affichage des liens suivant/précédentif ($deb!=0){if (($deb-$img_pg)>=0){if (!isset($_GET['suppr'])){$prec='<a href="'.EFLORE_CHEMIN_APPLI.'&onglet=photo&deb='.($deb-$img_pg).'">'.PREC.'</a>';}else{$prec='<a href="'.EFLORE_CHEMIN_APPLI.'&onglet=photo&deb='.($deb-$img_pg).'&suppr=1">'.PREC.'</a>';}}else{if (!isset($_GET['suppr'])){$prec='<a href="'.EFLORE_CHEMIN_APPLI.'"&onglet=photo&deb=0">'.PREC.'</a>';}else{$prec='<a href="'.EFLORE_CHEMIN_APPLI.'"&onglet=photo&deb=0&suppr=1">'.PREC.'</a>';}}$res.='<div class="prec">'.$prec.'</div>';}if ($deb+$img_pg<$nbre_ligne){if (!isset($_GET['suppr'])){$suiv='<a href="'.EFLORE_CHEMIN_APPLI.'&onglet=photo&deb='.($fin+1).'">'.SUIV.'</a>';}else{$suiv='<a href="'.EFLORE_CHEMIN_APPLI.'&onglet=photo&deb='.($fin+1).'&suppr=1">'.SUIV.'</a>';}$res.='<div class="suiv">'.$suiv.'</div>';}}}?>