Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 875 → Rev 876

/trunk/jrest/services/NameImage.php
31,7 → 31,6
*/
 
 
// in : utf8
// out : 8859
/*
46,11 → 45,9
* 4: Le service redimensionne l'image et la renvoie
*/
 
 
 
/** Constante stockant l'URL de la page d'accueil de Photoflora.*/
define('EF_URL_PHOTOFLORA', 'http://photoflora.free.fr/');
/** Constante stockant l'URL de la page de Photoflora affichant toutes les images d'un taxon donn�es.*/
/** Constante stockant l'URL de la page de Photoflora affichant toutes les images d'un taxon donné.*/
define('EF_URL_PHOTOFLORA_TAXON', EF_URL_PHOTOFLORA.'FiTax.php?NumTaxon=%s');
/** Constante stockant l'URL du dossier de photoflora contenant les images miniatures.*/
define('EF_URL_PHOTOFLORA_IMG_MIN', 'http://photoflora.free.fr/photos/%s/min/%s');
60,51 → 57,29
define('EF_URL_PHOTOFLORA_REGEXP_01', '/\/photos\/([^\/]+)\/max\/(.+)$/');
define('EF_URL_PHOTOFLORA_REGEXP_02', '/photoflora([^.]+)\.free\.fr\/max\/(.+)$/');
 
class NameImage extends Cel {
 
 
 
Class NameImage extends DBAccessor {
 
 
var $config;
function NameImage($config) {
 
$this->config=$config;
}
 
function getElement($uid){
 
 
// Num nomenclatural
$DB=$this->connectDB($this->config);
$query = "SELECT DISTINCT b.esn_id_taxon FROM eflore_nom, eflore_nom_rang," .
" eflore_selection_nom a, eflore_selection_nom b".
" WHERE a.esn_id_nom= ".$uid[0].
" AND a.esn_id_version_projet_taxon = 25 ".
" AND a.esn_id_taxon=b.esn_id_taxon ".
" AND b.esn_ce_statut=3 ".
" AND a.esn_id_version_projet_taxon=b.esn_id_version_projet_taxon" .
" AND en_ce_rang = enrg_id_rang" .
" AND en_id_nom = b.esn_id_nom" .
" AND a.esn_id_version_projet_taxon=en_id_version_projet_nom ";
$requete_num_nom = "SELECT DISTINCT b.esn_id_taxon FROM eflore_nom, eflore_nom_rang," .
" eflore_selection_nom a, eflore_selection_nom b".
" WHERE a.esn_id_nom= ".$this->proteger($uid[0]).
" AND a.esn_id_version_projet_taxon = 25 ".
" AND a.esn_id_taxon=b.esn_id_taxon ".
" AND b.esn_ce_statut=3 ".
" AND a.esn_id_version_projet_taxon=b.esn_id_version_projet_taxon" .
" AND en_ce_rang = enrg_id_rang" .
" AND en_id_nom = b.esn_id_nom" .
" AND a.esn_id_version_projet_taxon=en_id_version_projet_nom ";
$res =& $DB->query($query);
if (DB::isError($res)) {
die($res->getMessage());
}
$res_num_nom = $this->requeter($requete_num_nom);
$nt = null;
if(is_array($res_num_nom) && count($res_num_nom) > 0) {
$nt=$res_num_nom[0]['esn_id_taxon'];
}
 
while ($row =& $res->fetchrow(DB_FETCHMODE_ASSOC)) {
$nt=$row['esn_id_taxon'];
}
 
$projet_photo = 'photoflora';
$tab_retour[$projet_photo]=chercherIllustrationsServiceXml(sprintf(EF_URL_PHOTOFLORA_SERVICE, $nt));
178,7 → 153,7
date_default_timezone_set('Europe/Paris');
}
if (preg_match('/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/', $rdf_description->getAttribute('created'))) {
$aso_info['dcterms:created'] = date('j-m-Y � H:i:s', strtotime($rdf_description->getAttribute('created')));
$aso_info['dcterms:created'] = date('j-m-Y à H:i:s', strtotime($rdf_description->getAttribute('created')));
} else {
$aso_info['dcterms:created'] = $rdf_description->getAttribute('created');
}
202,11 → 177,6
*
* Revision 1.1 2007-06-06 13:31:16 ddelon
* v0.09
*
*
*
*
*/
 
?>
?>