Author: pierre.basson@gmail.com
Date: Wed Aug 9 07:02:21 2006
New Revision: 4452
Log:
- ajout d'un squelette exemple
- reste à copier le répertoire spip-meteo/meteo vers IMG/meteo
Added:
_plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/
_plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo.html
_plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/brouillard.png (with props)
_plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/inconnu.png (with props)
_plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/lune-nuage.png (with props)
_plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/lune-nuages.png (with props)
_plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/lune.png (with props)
_plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/neige.png (with props)
_plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/nuages.png (with props)
_plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/orage.png (with props)
_plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/pluie.png (with props)
_plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/soleil-nuage.png (with props)
_plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/soleil-nuages.png (with props)
_plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/soleil.png (with props)
_plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/vent.png (with props)
_plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/verglas.png (with props)
Modified:
_plugins_branche_stable_/_spip_1_9_0_/spip-meteo/inc/meteo_fonctions.php
Modified: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/inc/meteo_fonctions.php
--- _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/inc/meteo_fonctions.php (original)
+++ _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/inc/meteo_fonctions.php Wed Aug 9 07:02:21 2006
@@ -419,4 +419,78 @@
function meteo_convertir_fahrenheit_celsius($t) {
return round( ($t - 32) * 5 / 9 );
}
+
+
+ /**
+ * balise_TEMPS
+ *
+ * @param p est un objet SPIP
+ * @return float pourcentage
+ * @author Pierre Basson
+ **/
+ function balise_TEMPS($p) {
+ $_id_prevision = champ_sql('id_prevision',$p);
+ $p->code = "meteo_calculer_temps($_id_prevision)";
+ $p->statut = 'php';
+ return $p;
+ }
+
+
+ /**
+ * meteo_calculer_icone_temps
+ *
+ * @param int id_prevision
+ * @return string image correspondant à la prévision
+ * @author Pierre Basson
+ **/
+ function meteo_calculer_temps($id_prevision) {
+ global $tableau_meteo;
+ $temps = spip_query('SELECT id_temps FROM spip_previsions WHERE id_prevision="'.$id_prevision.'"');
+ if (spip_num_rows($temps) == 0) {
+ return '';
+ } else {
+ list($id_temps) = spip_fetch_array($temps);
+ return $tableau_meteo[$id_temps];
+ }
+ }
+
+
+ /**
+ * filtre icone_meteo
+ *
+ * @param string temps
+ * @param string chemin
+ * @param string extension
+ * @return string image correspondant à la prévision
+ * @author Pierre Basson
+ **/
+ function icone_meteo($temps, $chemin='', $extension="png") {
+ if (empty($chemin))
+ $chemin = _DIR_IMG.'meteo/';
+ $img = $chemin.$temps.'.'.$extension;
+ if (file_exists($img)) {
+ include_spip('inc/logos');
+ list ($h,$l) = taille_image($img);
+ return '<img src="'.$img.'" alt="'.$temps.'" title="'.traduire_meteo($temps).'" width="'.$l.'" height="'.$h.'" />';
+ } else {
+ return '';
+ }
+
+ }
+
+
+ /**
+ * filtre traduire_meteo
+ *
+ * @param string temps
+ * @return string traduction
+ * @author Pierre Basson
+ **/
+ function traduire_meteo($temps) {
+ if (empty($temps))
+ return '';
+ return _T('meteo:meteo_'.$temps);
+ }
+
+
?>
\ No newline at end of file
Added: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo.html
--- _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo.html (added)
+++ _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo.html Wed Aug 9 07:02:21 2006
@@ -0,0 +1,17 @@
+#CACHE{0}
+<BOUCLE_meteo(METEO) {id_meteo?}>
+
+<dl>
+
+<BOUCLE_previsions(PREVISIONS) {id_meteo} {par date} {0,3}>
+
+<dt>[(#DATE|affdate)]</dt>
+<dd>[(#TEMPS|traduire_meteo) : ][(#TEMPS|icone_meteo)]</dd>
+<dd>min :#MINIMA</dd>
+<dd>max :#MAXIMA</dd>
+
+</BOUCLE_previsions>
+
+</dl>
+
+</BOUCLE_meteo>
\ No newline at end of file
Added: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/brouillard.png
Binary file - no diff available.
Propchange: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/brouillard.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/inconnu.png
Binary file - no diff available.
Propchange: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/inconnu.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/lune-nuage.png
Binary file - no diff available.
Propchange: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/lune-nuage.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/lune-nuages.png
Binary file - no diff available.
Propchange: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/lune-nuages.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/lune.png
Binary file - no diff available.
Propchange: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/lune.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/neige.png
Binary file - no diff available.
Propchange: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/neige.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/nuages.png
Binary file - no diff available.
Propchange: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/nuages.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/orage.png
Binary file - no diff available.
Propchange: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/orage.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/pluie.png
Binary file - no diff available.
Propchange: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/pluie.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/soleil-nuage.png
Binary file - no diff available.
Propchange: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/soleil-nuage.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/soleil-nuages.png
Binary file - no diff available.
Propchange: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/soleil-nuages.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/soleil.png
Binary file - no diff available.
Propchange: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/soleil.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/vent.png
Binary file - no diff available.
Propchange: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/vent.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/verglas.png
Binary file - no diff available.
Propchange: _plugins_branche_stable_/_spip_1_9_0_/spip-meteo/meteo/verglas.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream