Subversion Repositories eFlore/Archives.chorologie

Compare Revisions

Ignore whitespace Rev 11 → Rev 12

/trunk/bibliotheque/cartographie/carto.php
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.2 2005-02-22 16:35:16 jpm Exp $
// CVS : $Id: carto.php,v 1.3 2005-02-22 19:35:08 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.2 $ $Date: 2005-02-22 16:35:16 $
*@version $Revision: 1.3 $ $Date: 2005-02-22 19:35:08 $
// +------------------------------------------------------------------------------------------------------+
*/
 
42,38 → 42,49
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
$_GET['chemin'] = urldecode($_GET['chemin']);
session_name($_GET['session']);
session_start();
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
$image = imagecreatefrompng($_GET['chemin'].$_GET['fichier'].'.png');
chmod($_GET['chemin'].$_GET['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
header("Pragma: no-cache"); // HTTP/1.0
header ("content-type:image/png");
imagepng($image);
unlink($_GET['chemin'].$_GET['fichier'].'.png');
//Nous nettoyons le dossier tmp des fichiers qu'il contient:
$poignet_de_dossier = opendir($_GET['chemin']);
while ($fichier_dechet = readdir($poignet_de_dossier)) {
if ($fichier_dechet != '.' && $fichier_dechet != '..') {
unlink($_GET['chemin'].$fichier_dechet);
$image = imagecreatefrompng($_SESSION['chemin'].$_SESSION['fichier'].'.png');
if (!$image) {
echo session_name();
echo session_id();
trigger_error($image);
} else {
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
header("Pragma: no-cache"); // HTTP/1.0
header ("content-type:image/png");
chmod($_SESSION['chemin'].$_SESSION['fichier'].'.png', 755);
imagepng($image);
unlink($_SESSION['chemin'].$_SESSION['fichier'].'.png');
//Nous nettoyons le dossier tmp des fichiers qu'il contient:
$poignet_de_dossier = opendir($_SESSION['chemin']);
while ($fichier_dechet = readdir($poignet_de_dossier)) {
if ($fichier_dechet != '.' && $fichier_dechet != '..') {
unlink($_SESSION['chemin'].$fichier_dechet);
}
}
closedir($poignet_de_dossier);
}
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
closedir($poignet_de_dossier);
exit();
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.2 2005/02/22 16:35:16 jpm
* Mise en forme.
* Utilisation de constantes pour les chemins d'accès aux fichiers.
* Ajout de commentaires.
*
* Revision 1.1 2005/02/22 12:02:57 jpm
* Ajout des fichiers de la bibliothèque cartographique.
*
/trunk/bibliotheque/cartographie/carto_carte.class.php
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_carte.class.php,v 1.2 2005-02-22 16:35:16 jpm Exp $
// CVS : $Id: carto_carte.class.php,v 1.3 2005-02-22 19:35:08 jpm Exp $
/**
* Classe Carto_Carte.
*
34,7 → 34,7
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $ $Date: 2005-02-22 16:35:16 $
*@version $Revision: 1.3 $ $Date: 2005-02-22 19:35:08 $
// +------------------------------------------------------------------------------------------------------+
*/
 
326,11 → 326,14
$this->historique = $this->id;
$obj = serialize($this);
$_SESSION['carte'] = $obj ;
$_SESSION['carte'] = $obj;
}
$res .= sprintf(CAR_CHEMIN_CARTE, urlencode(CAR_CHEMIN_TMP), $this->id.$id_image).'"';
$_SESSION['chemin'] = CAR_CHEMIN_TMP;
$_SESSION['fichier'] = $this->id.$id_image;
$res .= CAR_CHEMIN_CARTE.'"';
$res .= ' name="image" onmouseover="javascript:show(\'d\');" onmouseout="javascript:show(\'d\');" />'."\n";
$res .= '<input type="hidden" name="historique_cartes" value="'.$this->historique.'" /></p>';
$res .= '<input type="hidden" name="historique_cartes" value="'.$this->historique.'" />'."\n";
$res .= '</p>'."\n";
$res .= '</form>'."\n";
return $res;
}
794,7 → 797,12
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.2 2005/02/22 16:35:16 jpm
* Mise en forme.
* Utilisation de constantes pour les chemins d'accès aux fichiers.
* Ajout de commentaires.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>