Subversion Repositories eFlore/Archives.eflore-consultation-v2

Compare Revisions

Ignore whitespace Rev 176 → Rev 175

/trunk/eflore_fiche.inc.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: eflore_fiche.inc.php,v 1.4 2005-07-01 19:04:12 jp_milcent Exp $
// CVS : $Id: eflore_fiche.inc.php,v 1.3 2005-06-30 15:24:26 jpm Exp $
/**
* Affichage des fiches d'eFlore.
*
33,7 → 33,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.4 $ $Date: 2005-07-01 19:04:12 $
*@version $Revision: 1.3 $ $Date: 2005-06-30 15:24:26 $
// +------------------------------------------------------------------------------------------------------+
*/
 
92,60 → 92,35
$retour = '';
$nt = $arguments[0];
$nvp = $arguments[1];
while ($nt != 0) {
$nr = 1000;
while ($nr != 0) {
$aso_taxon = array();
$contenu = file_get_contents(sprintf(EFLORE_URL_INFO_TAXON_SUP, rawurlencode($nt), rawurlencode($nvp)));
preg_match("/<en_ce_r>(\d+)<\/en_ce_r>/", $contenu, $info);
if (isset($info[1])) {
$aso_taxon['nr'] = $info[1];
$nr = $info[1];
}
preg_match('/<etr_id_t2>(\d+)<\/etr_id_t2>/', $contenu, $info);
if (isset($info[1])) {
$aso_taxon['nt'] = $info[1];
$nt = $info[1];
} else {
$nt = 0;
}
preg_match('/<etr_id_vpt2>(\d+)<\/etr_id_vpt2>/', $contenu, $info);
if (isset($info[1])) {
$aso_taxon['nvp'] = $info[1];
$nvp = $info[1];
}
preg_match('/<en_id_n>(\d+)<\/en_id_n>/', $contenu, $info);
if (isset($info[1])) {
$aso_taxon['nn'] = $info[1];
}
if ($nt != 0) {
array_push($tab_nom_sup, $aso_taxon);
}
$contenu = file_get_contents(sprintf(EFLORE_URL_TAXON_SUP, rawurlencode($nt), rawurlencode($nvp)));
preg_match('/<en_ce_r>(\d+)</en_ce_r>/', $contenu, $info);
$aso_taxon['nr'] = $info[1];
$retour .= 'ici'.$aso_taxon['nr'];
$nr = $info[1];
preg_match('/<etr_id_t2>(\d+)</etr_id_t2>/', $contenu, $info);
$aso_taxon['nt'] = $info[1];
$nt = $info[1];
preg_match('/<etr_id_vpt2>(\d+)</etr_id_vpt2>/', $contenu, $info);
$aso_taxon['nvp'] = $info[1];
$nvp = $info[1];
preg_match('/<en_id_n>(\d+)</en_id_n>/', $contenu, $info);
$aso_taxon['nn'] = $info[1];
array_push($tab_nom_sup, $aso_taxon);
}
// Nous avons des taxons supérieurs
if (count($tab_nom_sup) > 0) {
$retour .= '<ul>'."\n";
$j = 0;
for($i = (count($tab_nom_sup)-1); $i >= 0; $i--) {
$contenu = file_get_contents(sprintf(EFLORE_URL_INFO_NOM_LATIN, rawurlencode($tab_nom_sup[$i]['nn'])));
preg_match("/<eni_in>(.+?)<\/eni_in>/", $contenu, $info);
if (isset($info[1])) {
$retour .= '<li>'.str_repeat('&nbsp;', ($j++ * 3)).$info[1].'</li>';
} else {
$retour .= '<li>'.str_repeat('&nbsp;', ($j++ * 3)).'???'.'</li>';
}
}
$retour .= '</ul>'."\n";
} else {
$retour .= 'Aucun taxon supérieur.';
$retour .= '<ul>';
$j = 0;
for($i = count($tab_nom_sup); $i > 0; $i--) {
$retour .= '<li>'.str_repeat('&nbsp;', $j++).$tab_nom_sup[$i]['nn'].'</li>';
}
$retour .= '</ul>';
return $retour;
}
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.3 2005/06/30 15:24:26 jpm
* Début des modifications pour ajout de l'arborescence de la classif.
*
* Revision 1.2 2005/06/24 09:46:43 jpm
* Test pour mathilde
*