Subversion Repositories eFlore/Archives.herbiers

Rev

Rev 14 | Rev 16 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 14 Rev 15
Line 17... Line 17...
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: hb_rss.php,v 1.6 2006-10-31 15:33:15 jp_milcent Exp $
22
// CVS : $Id: hb_rss.php,v 1.7 2006-10-31 16:03:42 jp_milcent Exp $
23
/**
23
/**
24
* Générateur de flux RSS pour les Herbiers 
24
* Générateur de flux RSS pour les Herbiers 
25
*
25
*
26
*@package bazar
26
*@package bazar
27
//Auteur original :
27
//Auteur original :
28
*@author        Florian SCHMITT <florian@ecole-et-nature.org>
28
*@author        Florian SCHMITT <florian@ecole-et-nature.org>
29
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
29
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
30
*
30
*
31
*@copyright     Tela-Botanica 2000-2006
31
*@copyright     Tela-Botanica 2000-2006
32
*@version       $Revision: 1.6 $ $Date: 2006-10-31 15:33:15 $
32
*@version       $Revision: 1.7 $ $Date: 2006-10-31 16:03:42 $
33
// +------------------------------------------------------------------------------------------------------+
33
// +------------------------------------------------------------------------------------------------------+
34
*/
34
*/
Line 35... Line 35...
35
 
35
 
36
//==================================== LES FLUX RSS==================================
36
//==================================== LES FLUX RSS==================================
Line 44... Line 44...
44
define('HBR_RSS_LOGOSITE','http://www.tela-botanica.org/sites/commun/generique/images/logos/logo_tela_ombre.png');//Logo du site indiqué dans les flux rss
44
define('HBR_RSS_LOGOSITE','http://www.tela-botanica.org/sites/commun/generique/images/logos/logo_tela_ombre.png');//Logo du site indiqué dans les flux rss
45
define('HBR_RSS_MANAGINGEDITOR', 'accueil@tela-botanica.org') ;//Managing editor du site
45
define('HBR_RSS_MANAGINGEDITOR', 'accueil@tela-botanica.org') ;//Managing editor du site
46
define('HBR_RSS_WEBMASTER', 'jpm@tela-botanica.org') ; //Mail Webmaster du site
46
define('HBR_RSS_WEBMASTER', 'jpm@tela-botanica.org') ; //Mail Webmaster du site
47
define('HBR_RSS_CATEGORIE', 'Botanique, Herbiers'); //catégorie du flux RSS
47
define('HBR_RSS_CATEGORIE', 'Botanique, Herbiers'); //catégorie du flux RSS
48
$GLOBALS['_HERBIER_']['rss']['flux'] = array('herbier', 'collection', 'equipe', 'note');
48
$GLOBALS['_HERBIER_']['rss']['flux'] = array('herbier', 'collection', 'equipe', 'note');
49
$GLOBALS['_HERBIER_']['rss']['url'] = new Net_URL('http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);
49
$GLOBALS['_HERBIER_']['rss']['url'] = new Net_URL('http://'.$_SERVER['HTTP_HOST'].'/client/herbier/herbier_rss.php');
50
// TODO : à mettre dans le fichier de langue
50
// TODO : à mettre dans le fichier de langue
51
define('HBR_PAS_D_ANNONCES', 'Pas d\'annonce'); //Message pas d'annonce
51
define('HBR_PAS_D_ANNONCES', 'Pas d\'annonce'); //Message pas d'annonce
Line 52... Line 52...
52
 
52
 
53
if (isset($_GET['type'])) { 
53
if (isset($_GET['type'])) { 
Line 164... Line 164...
164
		$aso_infos = array();
164
		$aso_infos = array();
165
		$aso_infos['title'] = 'Flux RSS : '.$flux;
165
		$aso_infos['title'] = 'Flux RSS : '.$flux;
166
		$GLOBALS['_HERBIER_']['rss']['url']->addQueryString('type', $flux);
166
		$GLOBALS['_HERBIER_']['rss']['url']->addQueryString('type', $flux);
167
		$aso_infos['link'] = str_replace('&', '&amp;', $GLOBALS['_HERBIER_']['rss']['url']->getURL());
167
		$aso_infos['link'] = str_replace('&', '&amp;', $GLOBALS['_HERBIER_']['rss']['url']->getURL());
168
		$aso_infos['description'] = 'Flux RSS sur les '.$flux.'s.';
168
		$aso_infos['description'] = 'Flux RSS sur les '.$flux.'s.';
169
		$aso_infos['pubdate'] = strftime('%d %b %Y %H:%M:%S GMT', strtotime(str_replace('$', '', str_replace('Date: ', '', '$Date: 2006-10-31 15:33:15 $'))));
169
		$aso_infos['pubdate'] = strftime('%d %b %Y %H:%M:%S GMT', strtotime(str_replace('$', '', str_replace('Date: ', '', '$Date: 2006-10-31 16:03:42 $'))));
170
		$tab_infos[] = $aso_infos;
170
		$tab_infos[] = $aso_infos;
171
	} 
171
	} 
172
}
172
}
173
// En fonction, de l'appel depuis Papyrus ou pas nous affichons du XML ou du XHTML
173
// En fonction, de l'appel depuis Papyrus ou pas nous affichons du XML ou du XHTML
174
if (!defined('PAP_VERSION')) {
174
if (!defined('PAP_VERSION')) {
Line 185... Line 185...
185
* @return  string La liste des flux RSS
185
* @return  string La liste des flux RSS
186
*/
186
*/
187
function gen_XHTML($meta = '', $infos = '')
187
function gen_XHTML($meta = '', $infos = '')
188
{
188
{
189
	$xhtml = '<h1>'.$meta['titre'].'</h1>'."\n";
189
	$xhtml = '<h1>'.$meta['titre'].'</h1>'."\n";
190
	$xhtml = '<p>'.$meta['description'].'</p>'."\n";
190
	$xhtml .= '<p>'.$meta['description'].'</p>'."\n";
191
	$xhtml .= '<ul>'."\n";
191
	$xhtml .= '<ul>'."\n";
192
	foreach ($infos as $info) {
192
	foreach ($infos as $info) {
193
		$xhtml .= '<li>'."\n";
193
		$xhtml .= '<li>'."\n";
194
		$xhtml .= '<a href="'.$meta['link'].'"><strong>'.$info['title'].'</strong></a><br />'."\n";
194
		$xhtml .= '<a href="'.$info['link'].'"><strong>'.$info['title'].'</strong></a><br />'."\n";
195
		$xhtml .= $info['description']."\n";
195
		$xhtml .= $info['description']."\n";
196
		$xhtml .= '</li>'."\n";
196
		$xhtml .= '</li>'."\n";
197
	}
197
	}
198
	$xhtml .= '</ul>'."\n";
198
	$xhtml .= '</ul>'."\n";
199
	return $xhtml;
199
	return $xhtml;
Line 255... Line 255...
255
	return $xml;
255
	return $xml;
256
}
256
}
257
/* +--Fin du code ----------------------------------------------------------------------------------------+
257
/* +--Fin du code ----------------------------------------------------------------------------------------+
258
*
258
*
259
* $Log: not supported by cvs2svn $
259
* $Log: not supported by cvs2svn $
-
 
260
* Revision 1.6  2006/10/31 15:33:15  jp_milcent
-
 
261
* Gestion d'un rendu XHTML pour Papyrus.
-
 
262
*
260
* Revision 1.5  2006/10/31 15:06:44  jp_milcent
263
* Revision 1.5  2006/10/31 15:06:44  jp_milcent
261
* Fin de gestion des flux rss.
264
* Fin de gestion des flux rss.
262
*
265
*
263
* Revision 1.4  2006/10/31 12:42:00  jp_milcent
266
* Revision 1.4  2006/10/31 12:42:00  jp_milcent
264
* Amélioration de la gestion de la date des flux via les infos cvs.
267
* Amélioration de la gestion de la date des flux via les infos cvs.