Subversion Repositories Sites.gentiana.org

Rev

Rev 7 | Rev 10 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7 Rev 8
1
<?php
1
<?php
2
/**
2
/**
3
* gentiana - index.php
3
* gentiana - index.php
4
*
4
*
5
* Description :
5
* Description :
6
*
6
*
7
*@package gentiana
7
*@package gentiana
8
//Auteur original :
8
//Auteur original :
9
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
9
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
10
//Autres auteurs :
10
//Autres auteurs :
11
*@author        Aucun
11
*@author        Aucun
12
*@copyright     Tela-Botanica 1999-2007
12
*@copyright     Tela-Botanica 1999-2007
13
*@version       $Revision$ $Date$
13
*@version       $Revision$ $Date$
14
// +------------------------------------------------------------------------------------------------------+
14
// +------------------------------------------------------------------------------------------------------+
15
*/
15
*/
-
 
16
define('MAGPIE_DIR', 'api/syndication_rss/magpierss/');
-
 
17
define('MAGPIE_CACHE_DIR', 'tmp/magpie_cache');
-
 
18
define('MAGPIE_CACHE_ON', true);
-
 
19
define('RSS_URL', 'http://bourianeverte.blogspot.com/atom.xml');//http://www.tela-botanica.org/actu/backend.php3
-
 
20
define('RSS_DESCRIPTION_LONGUEUR', 200);
-
 
21
require_once MAGPIE_DIR.'rss_fetch.inc';
-
 
22
require_once 'accueil/class.html2text.inc';
-
 
23
$rss = fetch_rss(RSS_URL);
-
 
24
function recupererImage($txt)
-
 
25
{
-
 
26
	if (preg_match('/<img .*src="([^"]+)"/', $txt, $match)) {
-
 
27
		return array('src' => $match[1], 'alt' => $match[2]);
-
 
28
	}
-
 
29
	return false;
-
 
30
}
16
?>
31
?>
17
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
32
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
18
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
33
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
19
<html xmlns="http://www.w3.org/1999/xhtml">
34
<html xmlns="http://www.w3.org/1999/xhtml">
20
	<head>
35
	<head>
21
		<title>Gentiana</title>
36
		<title>Gentiana</title>
22
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
37
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
23
		<meta http-equiv="Content-style-type" content="text/css" />
38
		<meta http-equiv="Content-style-type" content="text/css" />
24
		<meta http-equiv="Content-script-type" content="text/javascript" />
39
		<meta http-equiv="Content-script-type" content="text/javascript" />
25
		<meta http-equiv="Content-language" content="fr" />
40
		<meta http-equiv="Content-language" content="fr" />
26
		<meta name="robots" content="noindex,nofollow" />
41
		<meta name="robots" content="noindex,nofollow" />
27
		<meta name="author" content="Tela Botanica" />
42
		<meta name="author" content="Tela Botanica" />
28
		<meta name="keywords" content="Gentiana, association, botanique, botanistes, isère, langue française, France, végétaux, nature, environnement, connaissance, protection, plante, plantes protégées, floristique, cartographie, découvrir, fleurs." />
43
		<meta name="keywords" content="Gentiana, association, botanique, botanistes, isère, langue française, France, végétaux, nature, environnement, connaissance, protection, plante, plantes protégées, floristique, cartographie, découvrir, fleurs." />
29
		<meta name="description" content="Sites web de l'association Gentiana" />
44
		<meta name="description" content="Sites web de l'association Gentiana" />
30
		<link rel="stylesheet" type="text/css" media="screen" href="accueil/accueil_simple.css" />
45
		<link rel="stylesheet" type="text/css" media="screen" href="accueil/accueil_simple.css" />
31
		<style type="text/css" media="screen"><!-- @import "accueil/accueil_prairie.css"; --></style>
46
		<style type="text/css" media="screen"><!-- @import "accueil/accueil_prairie.css"; --></style>
32
		<link rel="stylesheet" type="text/css" media="print" href="accueil/impression.css" />
47
		<link rel="stylesheet" type="text/css" media="print" href="accueil/impression.css" />
33
		<link rel="alternate stylesheet" type="text/css" media="screen" href="accueil/accueil_bas_debit.css" title="Connexion bas débit" />
48
		<link rel="alternate stylesheet" type="text/css" media="screen" href="accueil/accueil_bas_debit.css" title="Connexion bas débit" />
34
	</head>
49
	</head>
35
	<body>
50
	<body>
36
		<div id="centrage">
51
		<div id="centrage">
37
			<div id="cartouche">
52
			<div id="cartouche">
38
				<h1><a href="/" title="Retour à la page d'accueil"><img id="logo_gentiana" src="accueil/logo_gentiana.png" alt="Gentiana"/></a></h1>
53
				<h1><a href="/" title="Retour à la page d'accueil"><img id="logo_gentiana" src="accueil/logo_gentiana.png" alt="Gentiana"/></a></h1>
39
				<div id="zone_sites">
54
				<div id="zone_sites">
40
					<h1 id="titre_sites">Sites de l'association Gentiana</h1>
55
					<h1 id="titre_sites">Sites de l'association Gentiana</h1>
41
					<ul id="liste_sites">
56
					<ul id="liste_sites">
42
						<li id="site_asso_gentiana"><a href="#">L'association Gentiana</a></li>
57
						<li id="site_asso_gentiana"><a href="papyrus.php">L'association Gentiana</a></li>
43
						<li id="site_flore_isere"><a href="#">La flore de l'Isère</a></li>
58
						<li id="site_flore_isere"><a href="#">La flore de l'Isère</a></li>
44
						<li id="site_gestion_raisonnable"><a href="#">La gestion raisonnable</a></li>
59
						<li id="site_gestion_raisonnable"><a href="#">La gestion raisonnable</a></li>
45
					</ul>
60
					</ul>
46
				</div>
61
				</div>
47
				<div id="zone_actu">
62
				<div id="zone_actu">
48
					<h1 id="titre_actu">Actualités &bull; Agenda</h1>
63
					<h1 id="titre_actu">Actualités &bull; Agenda</h1>
-
 
64
					<ul id="liste_actu">
-
 
65
					<?php foreach ($rss->items as $item) : ?>
-
 
66
						<?php 
-
 
67
							// Si Atom nous remplissons le champ description
-
 
68
							if (isset($item['atom_content']) && !isset($item['description'])) {
-
 
69
								$item['description'] = $item['atom_content'];
-
 
70
							}
-
 
71
							// Récupération d'une image présente dans le txt
-
 
72
							$image = recupererImage($item['description']);
-
 
73
							if ($image) {
-
 
74
								$item['image'] = $image;
-
 
75
							}
-
 
76
							// Nettoyage du html
-
 
77
							$h2t = new html2text($item['description']);
-
 
78
							$item['description'] = $h2t->get_text();
-
 
79
							
-
 
80
						?>
-
 
81
						<li class="rss_actu">
-
 
82
							<h2 class="rss_titre"><a href="<?=$item['link']; ?>"><?=$item['title']; ?></a></h2>
-
 
83
							<?php if ($image) : ?>
-
 
84
							<p class="rss_image"><img class="rss_image" src="<?=$item['image']['src'];?>" alt="<?=$item['image']['alt'];?>" width="50" height="50"/></p>
-
 
85
							<?php endif; ?>
-
 
86
							<p class="rss_date">Publié le <?=strftime('%d.%m.%Y',strtotime($item['date'])); ?></p>
-
 
87
							<p class="rss_description"><? echo substr($item['description'],0, RSS_DESCRIPTION_LONGUEUR).'...'; ?></p>
-
 
88
						</li>
-
 
89
					<?php endforeach; ?>
-
 
90
					</ul>
49
				</div>
91
				</div>
50
				<div id="zone_logos">
92
				<div id="zone_logos">
51
					<h1 id="titre_logos">Les partenaires de Gentiana</h1>
93
					<h1 id="titre_logos">Les partenaires de Gentiana</h1>
52
					<ul id="liste_logos">
94
					<ul id="liste_logos">
53
						<li id="logo_cg_isere"><a href="http://www.cg38.fr/" title="Aller sur le site du Conseil Générale de l'Isère"><img src="accueil/logo_cg_isere.png" alt="Conseil Générale de l'Isère"/></a></li>
95
						<li id="logo_cg_isere"><a href="http://www.cg38.fr/" title="Aller sur le site du Conseil Générale de l'Isère"><img src="accueil/logo_cg_isere.png" alt="Conseil Générale de l'Isère"/></a></li>
54
						<li id="logo_tela_botanica"><a href="http://www.tela-botanica.org/" title="Aller sur le site de Tela Botanica"><img src="accueil/logo_tela_botanica.png" alt="Conseil Générale de l'Isère"/></a></li>
96
						<li id="logo_tela_botanica"><a href="http://www.tela-botanica.org/" title="Aller sur le site de Tela Botanica"><img src="accueil/logo_tela_botanica.png" alt="Conseil Générale de l'Isère"/></a></li>
55
						<li id="logo_rhone_alpes"><a href="http://www.rhonealpes.fr/" title="Aller sur le site de Rhône-Alpes"><img src="accueil/logo_rhone_alpes.png" alt="Rhônes-Alpes"/></a></li>
97
						<li id="logo_rhone_alpes"><a href="http://www.rhonealpes.fr/" title="Aller sur le site de Rhône-Alpes"><img src="accueil/logo_rhone_alpes.png" alt="Rhônes-Alpes"/></a></li>
56
					</ul>
98
					</ul>
57
				</div>
99
				</div>
58
			</div>        
100
			</div>        
59
		</div>
101
		</div>
60
	</body>
102
	</body>
61
</html>
103
</html>