Subversion Repositories eFlore/Archives.chorologie

Compare Revisions

Ignore whitespace Rev 8 → Rev 9

/trunk/bibliotheque/cartographie/carto.php
1,7 → 1,7
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 5.0.3 |
// | PHP version 4.3 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
21,7 → 21,7
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: carto.php,v 1.1 2005-02-22 12:02:57 jpm Exp $
// CVS : $Id: carto.php,v 1.2 2005-02-22 16:35:16 jpm Exp $
/**
* Fournie une image cartographique.
*
35,7 → 35,7
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $ $Date: 2005-02-22 12:02:57 $
*@version $Revision: 1.2 $ $Date: 2005-02-22 16:35:16 $
// +------------------------------------------------------------------------------------------------------+
*/
 
42,16 → 42,14
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
$_GET['chemin'] = urldecode($_GET['chemin']);
 
define('CAR_CHEMIN_TMP', '../../../tmp/carto/');
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
$image = imagecreatefrompng($_GET['chemin'].$_GET['fichier'].'.png');
chmod($_GET['chemin'].$_GET['fichier'].'.png', 755) ;
 
$image = imagecreatefrompng(CAR_CHEMIN_TMP.$fichier.'.png');
chmod (CAR_CHEMIN_TMP.$fichier.'.png', 755) ;
 
header("Expires: Wen, 01 Dec 1999 01:00:00 GMT");// Date du passé
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");// toujours modifié
header("Cache-Control: no-cache, must-revalidate");// HTTP/1.1
58,12 → 56,12
header("Pragma: no-cache"); // HTTP/1.0
header ("content-type:image/png");
imagepng($image);
unlink(CAR_CHEMIN_TMP.$fichier.'.png');
unlink($_GET['chemin'].$_GET['fichier'].'.png');
//Nous nettoyons le dossier tmp des fichiers qu'il contient:
$poignet_de_dossier = opendir(CAR_CHEMIN_TMP);
$poignet_de_dossier = opendir($_GET['chemin']);
while ($fichier_dechet = readdir($poignet_de_dossier)) {
if ($fichier_dechet != '.' && $fichier_dechet != '..') {
unlink(CAR_CHEMIN_TMP.$fichier_dechet);
unlink($_GET['chemin'].$fichier_dechet);
}
}
 
70,7 → 68,6
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
closedir($poignet_de_dossier);
exit();
 
77,10 → 74,9
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2005/02/17 10:58:00 jpm
* Ajout des fichiers pour permettre au serveur de réaliser des cartes. Ils sont à revoir complétement!
* Revision 1.1 2005/02/22 12:02:57 jpm
* Ajout des fichiers de la bibliothèque cartographique.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>