| Line 19... |
Line 19... |
| 19 |
// | |
|
19 |
// | |
|
| 20 |
// | You should have received a copy of the GNU General Public License |
|
20 |
// | You should have received a copy of the GNU General Public License |
|
| 21 |
// | along with Foobar; if not, write to the Free Software |
|
21 |
// | along with Foobar; if not, write to the Free Software |
|
| 22 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
22 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
| 23 |
// +------------------------------------------------------------------------------------------------------+
|
23 |
// +------------------------------------------------------------------------------------------------------+
|
| 24 |
// CVS : $Id: eflore_fiche.inc.php,v 1.3 2005-06-30 15:24:26 jpm Exp $
|
24 |
// CVS : $Id: eflore_fiche.inc.php,v 1.4 2005-07-01 19:04:12 jp_milcent Exp $
|
| 25 |
/**
|
25 |
/**
|
| 26 |
* Affichage des fiches d'eFlore.
|
26 |
* Affichage des fiches d'eFlore.
|
| 27 |
*
|
27 |
*
|
| 28 |
* Ce script fournit le code html correspondant aux fiches d'eFlore.
|
28 |
* Ce script fournit le code html correspondant aux fiches d'eFlore.
|
| 29 |
*
|
29 |
*
|
| Line 31... |
Line 31... |
| 31 |
//Auteur original :
|
31 |
//Auteur original :
|
| 32 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
32 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
| 33 |
//Autres auteurs :
|
33 |
//Autres auteurs :
|
| 34 |
*@author Aucun
|
34 |
*@author Aucun
|
| 35 |
*@copyright Tela-Botanica 2000-2004
|
35 |
*@copyright Tela-Botanica 2000-2004
|
| 36 |
*@version $Revision: 1.3 $ $Date: 2005-06-30 15:24:26 $
|
36 |
*@version $Revision: 1.4 $ $Date: 2005-07-01 19:04:12 $
|
| 37 |
// +------------------------------------------------------------------------------------------------------+
|
37 |
// +------------------------------------------------------------------------------------------------------+
|
| 38 |
*/
|
38 |
*/
|
| Line 39... |
Line 39... |
| 39 |
|
39 |
|
| 40 |
// +------------------------------------------------------------------------------------------------------+
|
40 |
// +------------------------------------------------------------------------------------------------------+
|
| Line 90... |
Line 90... |
| 90 |
function afficherNiveauTaxoSuperieur($arguments) {
|
90 |
function afficherNiveauTaxoSuperieur($arguments) {
|
| 91 |
$tab_nom_sup = array();
|
91 |
$tab_nom_sup = array();
|
| 92 |
$retour = '';
|
92 |
$retour = '';
|
| 93 |
$nt = $arguments[0];
|
93 |
$nt = $arguments[0];
|
| 94 |
$nvp = $arguments[1];
|
94 |
$nvp = $arguments[1];
|
| 95 |
$nr = 1000;
|
- |
|
| 96 |
while ($nr != 0) {
|
95 |
while ($nt != 0) {
|
| 97 |
$aso_taxon = array();
|
96 |
$aso_taxon = array();
|
| 98 |
$contenu = file_get_contents(sprintf(EFLORE_URL_TAXON_SUP, rawurlencode($nt), rawurlencode($nvp)));
|
97 |
$contenu = file_get_contents(sprintf(EFLORE_URL_INFO_TAXON_SUP, rawurlencode($nt), rawurlencode($nvp)));
|
| 99 |
preg_match('/<en_ce_r>(\d+)</en_ce_r>/', $contenu, $info);
|
98 |
preg_match("/<en_ce_r>(\d+)<\/en_ce_r>/", $contenu, $info);
|
| 100 |
$aso_taxon['nr'] = $info[1];
|
99 |
if (isset($info[1])) {
|
| 101 |
$retour .= 'ici'.$aso_taxon['nr'];
|
100 |
$aso_taxon['nr'] = $info[1];
|
| 102 |
$nr = $info[1];
|
101 |
$nr = $info[1];
|
| - |
|
102 |
}
|
| 103 |
preg_match('/<etr_id_t2>(\d+)</etr_id_t2>/', $contenu, $info);
|
103 |
preg_match('/<etr_id_t2>(\d+)<\/etr_id_t2>/', $contenu, $info);
|
| - |
|
104 |
if (isset($info[1])) {
|
| 104 |
$aso_taxon['nt'] = $info[1];
|
105 |
$aso_taxon['nt'] = $info[1];
|
| 105 |
$nt = $info[1];
|
106 |
$nt = $info[1];
|
| - |
|
107 |
} else {
|
| - |
|
108 |
$nt = 0;
|
| - |
|
109 |
}
|
| 106 |
preg_match('/<etr_id_vpt2>(\d+)</etr_id_vpt2>/', $contenu, $info);
|
110 |
preg_match('/<etr_id_vpt2>(\d+)<\/etr_id_vpt2>/', $contenu, $info);
|
| - |
|
111 |
if (isset($info[1])) {
|
| 107 |
$aso_taxon['nvp'] = $info[1];
|
112 |
$aso_taxon['nvp'] = $info[1];
|
| 108 |
$nvp = $info[1];
|
113 |
$nvp = $info[1];
|
| - |
|
114 |
}
|
| 109 |
preg_match('/<en_id_n>(\d+)</en_id_n>/', $contenu, $info);
|
115 |
preg_match('/<en_id_n>(\d+)<\/en_id_n>/', $contenu, $info);
|
| - |
|
116 |
if (isset($info[1])) {
|
| 110 |
$aso_taxon['nn'] = $info[1];
|
117 |
$aso_taxon['nn'] = $info[1];
|
| - |
|
118 |
}
|
| - |
|
119 |
if ($nt != 0) {
|
| 111 |
array_push($tab_nom_sup, $aso_taxon);
|
120 |
array_push($tab_nom_sup, $aso_taxon);
|
| - |
|
121 |
}
|
| 112 |
}
|
122 |
}
|
| - |
|
123 |
// Nous avons des taxons supérieurs
|
| - |
|
124 |
if (count($tab_nom_sup) > 0) {
|
| 113 |
$retour .= '<ul>';
|
125 |
$retour .= '<ul>'."\n";
|
| 114 |
$j = 0;
|
126 |
$j = 0;
|
| 115 |
for($i = count($tab_nom_sup); $i > 0; $i--) {
|
127 |
for($i = (count($tab_nom_sup)-1); $i >= 0; $i--) {
|
| - |
|
128 |
$contenu = file_get_contents(sprintf(EFLORE_URL_INFO_NOM_LATIN, rawurlencode($tab_nom_sup[$i]['nn'])));
|
| - |
|
129 |
preg_match("/<eni_in>(.+?)<\/eni_in>/", $contenu, $info);
|
| - |
|
130 |
if (isset($info[1])) {
|
| 116 |
$retour .= '<li>'.str_repeat(' ', $j++).$tab_nom_sup[$i]['nn'].'</li>';
|
131 |
$retour .= '<li>'.str_repeat(' ', ($j++ * 3)).$info[1].'</li>';
|
| - |
|
132 |
} else {
|
| - |
|
133 |
$retour .= '<li>'.str_repeat(' ', ($j++ * 3)).'???'.'</li>';
|
| - |
|
134 |
}
|
| - |
|
135 |
|
| - |
|
136 |
}
|
| - |
|
137 |
$retour .= '</ul>'."\n";
|
| - |
|
138 |
} else {
|
| - |
|
139 |
$retour .= 'Aucun taxon supérieur.';
|
| 117 |
}
|
140 |
}
|
| 118 |
$retour .= '</ul>';
|
- |
|
| 119 |
return $retour;
|
141 |
return $retour;
|
| 120 |
}
|
142 |
}
|
| 121 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
143 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
| 122 |
*
|
144 |
*
|
| 123 |
* $Log: not supported by cvs2svn $
|
145 |
* $Log: not supported by cvs2svn $
|
| - |
|
146 |
* Revision 1.3 2005/06/30 15:24:26 jpm
|
| - |
|
147 |
* Début des modifications pour ajout de l'arborescence de la classif.
|
| - |
|
148 |
*
|
| 124 |
* Revision 1.2 2005/06/24 09:46:43 jpm
|
149 |
* Revision 1.2 2005/06/24 09:46:43 jpm
|
| 125 |
* Test pour mathilde
|
150 |
* Test pour mathilde
|
| 126 |
*
|
151 |
*
|
| 127 |
* Revision 1.1 2005/01/28 19:48:11 jpm
|
152 |
* Revision 1.1 2005/01/28 19:48:11 jpm
|
| 128 |
* Ajout d'une fiche de synthèse.
|
153 |
* Ajout d'une fiche de synthèse.
|