Subversion Repositories Applications.papyrus

Rev

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

Rev 1526 Rev 1528
1
<?php
1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */
3
// +------------------------------------------------------------------------------------------------------+
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 5.1                                                                                      |
4
// | PHP version 5.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 1999-2006 Tela Botanica (accueil@tela-botanica.org)                                    |
6
// | Copyright (C) 1999-2006 Tela Botanica (accueil@tela-botanica.org)                                    |
7
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
8
// | This file is part of papyrus_bp.                                                                     |
8
// | This file is part of papyrus_bp.                                                                     |
9
// |                                                                                                      |
9
// |                                                                                                      |
10
// | Foobar is free software; you can redistribute it and/or modify                                       |
10
// | Foobar is free software; you can redistribute it and/or modify                                       |
11
// | it under the terms of the GNU General Public License as published by                                 |
11
// | it under the terms of the GNU General Public License as published by                                 |
12
// | the Free Software Foundation; either version 2 of the License, or                                    |
12
// | the Free Software Foundation; either version 2 of the License, or                                    |
13
// | (at your option) any later version.                                                                  |
13
// | (at your option) any later version.                                                                  |
14
// |                                                                                                      |
14
// |                                                                                                      |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
18
// | GNU General Public License for more details.                                                         |
18
// | GNU General Public License for more details.                                                         |
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: syndication.php,v 1.5.2.3 2007-07-25 14:50:21 jp_milcent Exp $
24
// CVS : $Id: syndication.php,v 1.5.2.4 2007-07-25 15:07:52 jp_milcent Exp $
25
/**
25
/**
26
* papyrus_bp - syndication.php
26
* papyrus_bp - syndication.php
27
*
27
*
28
* Description :
28
* Description :
29
*
29
*
30
*@package papyrus_bp
30
*@package papyrus_bp
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 1999-2006
35
*@copyright     Tela-Botanica 1999-2006
36
*@version       $Revision: 1.5.2.3 $ $Date: 2007-07-25 14:50:21 $
36
*@version       $Revision: 1.5.2.4 $ $Date: 2007-07-25 15:07:52 $
37
// +------------------------------------------------------------------------------------------------------+
37
// +------------------------------------------------------------------------------------------------------+
38
*/
38
*/
39
 
39
 
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
41
// |                                            ENTÊTE du PROGRAMME                                       |
41
// |                                            ENTÊTE du PROGRAMME                                       |
42
// +------------------------------------------------------------------------------------------------------+
42
// +------------------------------------------------------------------------------------------------------+
43
$GLOBALS['_GEN_commun']['info_applette_nom_fonction'] = 'afficherSyndication';
43
$GLOBALS['_GEN_commun']['info_applette_nom_fonction'] = 'afficherSyndication';
44
$GLOBALS['_GEN_commun']['info_applette_balise'] = 	'\{\{[Ss]yndication'.
44
$GLOBALS['_GEN_commun']['info_applette_balise'] = 	'\{\{[Ss]yndication'.
45
													'(?:\s*'.
45
													'(?:\s*'.
46
														'(?:'.
46
														'(?:'.
47
															'(url="[^"]*")|'.
47
															'(url="[^"]*")|'.
48
															'(titre="[^"]*")|'.
48
															'(titre="[^"]*")|'.
49
															'(nb="?\d+"?)|'.
49
															'(nb="?\d+"?)|'.
50
															'(nouvellefenetre="?(?:0|1)"?)|'.
50
															'(nouvellefenetre="?(?:0|1)"?)|'.
51
															'(formatdate="[^"]*")|'.
51
															'(formatdate="[^"]*")|'.
52
															'(formatdatepro="[^"]*")|'.
52
															'(formatdatepro="[^"]*")|'.
53
															'(template=".*")|'.
53
															'(template=".*")|'.
54
														')'.
54
														')'.
55
													')+'.
55
													')+'.
56
													'\s*\}\}';
56
													'\s*\}\}';
57
// +------------------------------------------------------------------------------------------------------+
57
// +------------------------------------------------------------------------------------------------------+
58
/** Inclusion du fichier de configuration de cette application.*/
58
/** Inclusion du fichier de configuration de cette application.*/
59
require_once GEN_CHEMIN_APPLETTE.'syndication'.GEN_SEP.'configuration'.GEN_SEP.'synd_configuration.inc.php';
59
require_once GEN_CHEMIN_APPLETTE.'syndication'.GEN_SEP.'configuration'.GEN_SEP.'synd_configuration.inc.php';
60
 
60
 
61
// Inclusion des fichiers de traduction de l'applette SYND de Papyrus
61
// Inclusion des fichiers de traduction de l'applette SYND de Papyrus
62
if (file_exists(SYND_CHEMIN_LANGUE.'synd_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php')) {
62
if (file_exists(SYND_CHEMIN_LANGUE.'synd_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php')) {
63
    /** Inclusion du fichier de traduction suite à la transaction avec le navigateur.*/
63
    /** Inclusion du fichier de traduction suite à la transaction avec le navigateur.*/
64
    require_once SYND_CHEMIN_LANGUE.'synd_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php';
64
    require_once SYND_CHEMIN_LANGUE.'synd_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php';
65
} else {
65
} else {
66
    /** Inclusion du fichier de traduction par défaut.*/
66
    /** Inclusion du fichier de traduction par défaut.*/
67
    require_once SYND_CHEMIN_LANGUE.'synd_langue_'.SYND_I18N_DEFAUT.'.inc.php';
67
    require_once SYND_CHEMIN_LANGUE.'synd_langue_'.SYND_I18N_DEFAUT.'.inc.php';
68
}
68
}
69
/** Inclusion du fichier de la bibliotheque permettant de manipuler les flux RSS.*/
69
/** Inclusion du fichier de la bibliotheque permettant de manipuler les flux RSS.*/
70
//require_once(MAGPIE_DIR.'rss_fetch.inc');
70
//require_once(MAGPIE_DIR.'rss_fetch.inc');
71
require_once PAP_CHEMIN_API_PEAR.'XML/Feed/Parser.php';
71
require_once PAP_CHEMIN_API_PEAR.'XML/Feed/Parser.php';
72
// +------------------------------------------------------------------------------------------------------+
72
// +------------------------------------------------------------------------------------------------------+
73
// |                                            CORPS du PROGRAMME                                        |
73
// |                                            CORPS du PROGRAMME                                        |
74
// +------------------------------------------------------------------------------------------------------+
74
// +------------------------------------------------------------------------------------------------------+
75
/** Fonction afficherSyndication() - Retourne la liste des pages des sites syndiqués.
75
/** Fonction afficherSyndication() - Retourne la liste des pages des sites syndiqués.
76
*
76
*
77
* Cette fonction retourne la liste des pages des sites syndiqués.
77
* Cette fonction retourne la liste des pages des sites syndiqués.
78
*
78
*
79
* @param  array contient les arguments de la fonction.
79
* @param  array contient les arguments de la fonction.
80
* @param  array  tableau global de Papyrus.
80
* @param  array  tableau global de Papyrus.
81
* @return string XHTML la liste des pages.
81
* @return string XHTML la liste des pages.
82
*/
82
*/
83
function afficherSyndication($tab_applette_arguments, $_GEN_commun)
83
function afficherSyndication($tab_applette_arguments, $_GEN_commun)
84
{
84
{
85
	// Initialisation des variables
85
	// Initialisation des variables
86
    $sortie = '';
86
    $sortie = '';
87
	$GLOBALS['_SYNDICATION_']['erreurs'] = array();
87
	$GLOBALS['_SYNDICATION_']['erreurs'] = array();
88
	$GLOBALS['_SYNDICATION_']['informations'] = array();
88
	$GLOBALS['_SYNDICATION_']['informations'] = array();
89
	$GLOBALS['_SYNDICATION_']['sites'] = array();
89
	$GLOBALS['_SYNDICATION_']['sites'] = array();
90
	
90
	
91
	//+----------------------------------------------------------------------------------------------------------------+
91
	//+----------------------------------------------------------------------------------------------------------------+
92
	// Gestion des arguments
92
	// Gestion des arguments
93
	$balise = $tab_applette_arguments[0];
93
	$balise = $tab_applette_arguments[0];
94
    $tab_arguments = $tab_applette_arguments;
94
    $tab_arguments = $tab_applette_arguments;
95
	unset($tab_arguments[0]);
95
	unset($tab_arguments[0]);
96
    foreach($tab_arguments as $argument) {
96
    foreach($tab_arguments as $argument) {
97
    	if ($argument != '') {
97
    	if ($argument != '') {
98
	    	$tab_parametres = explode('=', $argument, 2);
98
	    	$tab_parametres = explode('=', $argument, 2);
99
	    	$options[$tab_parametres[0]] = trim($tab_parametres[1], '"');
99
	    	$options[$tab_parametres[0]] = trim($tab_parametres[1], '"');
100
    	}
100
    	}
101
    }
101
    }
102
	
102
	
103
	//+----------------------------------------------------------------------------------------------------------------+
103
	//+----------------------------------------------------------------------------------------------------------------+
104
    // Gestion des erreurs de paramétrage
104
    // Gestion des erreurs de paramétrage
105
	if (!isset($options['url'])) {
105
	if (!isset($options['url'])) {
106
		$GLOBALS['_SYNDICATION_']['erreurs'][] = sprintf(SYND_LG_ERREUR_URL, $balise);
106
		$GLOBALS['_SYNDICATION_']['erreurs'][] = sprintf(SYND_LG_ERREUR_URL, $balise);
107
	}
107
	}
108
	if (!isset($options['titre'])) {
108
	if (!isset($options['titre'])) {
109
		$options['titre'] = '';
109
		$options['titre'] = '';
110
	}
110
	}
111
	if (!isset($options['nb'])) {
111
	if (!isset($options['nb'])) {
112
		$options['nb'] = SYND_NOMBRE;
112
		$options['nb'] = SYND_NOMBRE;
113
	}
113
	}
114
    if (!isset($options['nouvellefenetre'])) {
114
    if (!isset($options['nouvellefenetre'])) {
115
		$options['nouvellefenetre'] = SYND_OUVRIR_LIEN_RSS_NOUVELLE_FENETRE;
115
		$options['nouvellefenetre'] = SYND_OUVRIR_LIEN_RSS_NOUVELLE_FENETRE;
116
	}
116
	}
117
	if (!isset($options['formatdate'])) {
117
	if (!isset($options['formatdate'])) {
118
		$options['formatdate'] = SYND_FORMAT_DATE;
118
		$options['formatdate'] = SYND_FORMAT_DATE;
119
	}
119
	}
120
	if (!isset($options['formatdatepro'])) {
120
	if (!isset($options['formatdatepro'])) {
121
		$options['formatdatepro'] = false;
121
		$options['formatdatepro'] = false;
122
	}
122
	}
123
	if (!isset($options['template'])) {
123
	if (!isset($options['template'])) {
124
		$options['template'] = SYND_CHEMIN_SQUELETTE.SYND_SQUELETTE_LISTE;
124
		$options['template'] = SYND_CHEMIN_SQUELETTE.SYND_SQUELETTE_LISTE;
125
	} else {
125
	} else {
126
		if (file_exists(SYND_CHEMIN_SQUELETTE.$options['template'])) {
126
		if (file_exists(SYND_CHEMIN_SQUELETTE.$options['template'])) {
127
			$options['template'] = SYND_CHEMIN_SQUELETTE.$options['template'];
127
			$options['template'] = SYND_CHEMIN_SQUELETTE.$options['template'];
128
		}
128
		}
129
	}
129
	}
130
	
130
	
131
    //+----------------------------------------------------------------------------------------------------------------+
131
    //+----------------------------------------------------------------------------------------------------------------+
132
    // Recuperation des donnees
132
    // Recuperation des donnees
133
    if (count($GLOBALS['_SYNDICATION_']['erreurs']) == 0) {
133
    if (count($GLOBALS['_SYNDICATION_']['erreurs']) == 0) {
134
		$tab_url = array_map('trim', explode(',', $options['url']));
134
		$tab_url = array_map('trim', explode(',', $options['url']));
135
        foreach ($tab_url as $cle => $url) {
135
        foreach ($tab_url as $cle => $url) {
136
			if ($url != '') {
136
			if ($url != '') {
137
				$aso_site = array();
137
				$aso_site = array();
138
				try {
138
				try {
139
					$feed = new XML_Feed_Parser(file_get_contents($url));
139
					$feed = new XML_Feed_Parser(file_get_contents($url));
140
				} catch (XML_Feed_Parser_Exception $e) {
140
				} catch (XML_Feed_Parser_Exception $e) {
141
					die('Le flux RSS est invalide : ' . $e->getMessage());
141
					die('Le flux RSS est invalide : ' . $e->getMessage());
142
				}
142
				}
143
				
143
				
144
				if ($options['template'] != '' && !file_exists($options['template'])) {
144
				if ($options['template'] != '' && !file_exists($options['template'])) {
145
					$i = 0 ;
145
					$i = 0 ;
146
					$res= '';
146
					$res= '';
147
					foreach ($feed as $item) {
147
					foreach ($feed as $item) {
148
						// Le test suivant pour savoir s il faut reduire l excendent de description
148
						// Le test suivant pour savoir s il faut reduire l excendent de description
149
						// Si {all} est present dans le template on ne reduit pas
149
						// Si {all} est present dans le template on ne reduit pas
150
						if (preg_match ('/{all}/', $options['template'])) {
150
						if (preg_match ('/{all}/', $options['template'])) {
151
							$template = str_replace('{all}', '', $options['template']);
151
							$template = str_replace('{all}', '', $options['template']);
152
							$all = true ;
152
							$all = true ;
153
						} else {
153
						} else {
154
							$all = false;
154
							$all = false;
155
						}
155
						}
156
						if (isset($item->summary)) {
156
						if (isset($item->summary)) {
157
							$item->description = $item->summary; 
157
							$item->description = $item->summary; 
158
						} else {
158
						} else {
159
							if (strlen($item->description) > 200 && !$all) {
159
							if (strlen($item->description) > 200 && !$all) {
160
								$item->description = 	substr ($item->description , 0, 300).
160
								$item->description = 	substr ($item->description , 0, 300).
161
														'... <a href="'.$item->link.'">Lire la suite</a>';
161
														'... <a href="'.$item->link.'">Lire la suite</a>';
162
							}
162
							}
163
						}
163
						}
164
						if (!isset($item->pubdate)) {
164
						if (!isset($item->pubdate)) {
165
							$item->pubdate = date('dmY');
165
							$item->pubdate = date('dmY');
166
						}
166
						}
167
						// Le code ci-apres est pour rattraper les dates du type 01012005 parsees par magpie
167
						// Le code ci-apres est pour rattraper les dates du type 01012005 parsees par magpie
168
						// lorsque les flux donne des dates au format iso
168
						// lorsque les flux donne des dates au format iso
169
						if (preg_match('/^([0-3][0-9])([0-1][0-9])([0-9][0-9][0-9][0-9])$/', $item->pubdate, $match)) {
169
						if (preg_match('/^([0-3][0-9])([0-1][0-9])([0-9][0-9][0-9][0-9])$/', $item->pubdate, $match)) {
170
							$item->pubdate = $match[3].'-'.$match[2].'-'.$match[1];
170
							$item->pubdate = $match[3].'-'.$match[2].'-'.$match[1];
171
							//echo $item['pubdate'];
171
							//echo $item['pubdate'];
172
						}
172
						}
173
						$res .= str_replace ('{num}', ++$i, 
173
						$res .= str_replace ('{num}', ++$i, 
174
								str_replace ('{item}', '<a href="'.$item->link.'" target="_top">'.htmlentities($item->title).'</a>', 
174
								str_replace ('{item}', '<a href="'.$item->link.'" target="_top">'.htmlentities($item->title).'</a>', 
175
								str_replace ('{date}', strftime('%d.%m.%Y',strtotime($item->pubdate)),
175
								str_replace ('{date}', strftime('%d.%m.%Y',strtotime($item->pubdate)),
176
								str_replace ('{description}', $item->description, $options['template'])))) ;
176
								str_replace ('{description}', $item->description, $options['template'])))) ;
177
						$res .= "\n";
177
						$res .= "\n";
178
						if ($i > $options['nb']) {
178
						if ($i > $options['nb']) {
179
							break;
179
							break;
180
						}
180
						}
181
					}
181
					}
182
					return $res;
182
					return $res;
183
				}
183
				}
184
				// Gestion du titre
184
				// Gestion du titre
185
				if ( $options['titre'] == '' ) {
185
				if ( $options['titre'] == '' ) {
186
					$aso_site['titre'] = utf8_decode($feed->title);
186
					$aso_site['titre'] = utf8_decode($feed->title);
187
				} else if ( $options['titre'] != '0' ) {
187
				} else if ( $options['titre'] != '0' ) {
188
					$aso_site['titre'] = $options['titre'];
188
					$aso_site['titre'] = $options['titre'];
189
				}
189
				}
190
				// Gestion de l'url du site
190
				// Gestion de l'url du site
191
				if (isset($feed->link)) {
-
 
192
					$aso_site['url'] = htmlentities($feed->link);
191
				$aso_site['url'] = htmlentities($feed->link);
193
				}
192
 
194
				// Ouverture du lien dans une nouvelle fenetre
193
				// Ouverture du lien dans une nouvelle fenetre
195
				$aso_site['ext'] = false;
194
				$aso_site['ext'] = false;
196
				if ($options['nouvellefenetre'] == 1) {
195
				if ($options['nouvellefenetre'] == 1) {
197
					$aso_site['ext'] = true;
196
					$aso_site['ext'] = true;
198
				}
197
				}
199
				// Gestion des pages syndiquees
198
				// Gestion des pages syndiquees
200
				$i = 0;
199
				$i = 0;
201
			    $nb_item = $feed->numberEntries;
200
			    $nb_item = $feed->numberEntries;
202
				foreach ($feed as $item) {
201
				foreach ($feed as $item) {
203
					//echo '<pre>'.print_r($item, true).'</pre>';
202
					//echo '<pre>'.print_r($item, true).'</pre>';
204
					if ($options['nb'] != 0 && $nb_item >= $options['nb'] && $i >= $options['nb']) {
203
					if ($options['nb'] != 0 && $nb_item >= $options['nb'] && $i >= $options['nb']) {
205
						break;
204
						break;
206
					}
205
					}
207
					$i++;
206
					$i++;
208
					$aso_page = array();
207
					$aso_page = array();
209
					$aso_page['site'] = $aso_site;
208
					$aso_page['site'] = $aso_site;
210
					$aso_page['url'] = $item->link;
209
					$aso_page['url'] = $item->link;
211
					$aso_page['titre'] = utf8_decode($item->title);
210
					$aso_page['titre'] = utf8_decode($item->title);
212
					$aso_page['date'] = $item->pubDate;	
211
					$aso_page['date'] = $item->pubDate;	
213
					if ($options['formatdatepro']) {
212
					if ($options['formatdatepro']) {
214
						switch ($options['formatdatepro']) {
213
						switch ($options['formatdatepro']) {
215
							case 'jm' :
214
							case 'jm' :
216
								$aso_page['date'] = strftime('%d.%m', $aso_page['date']);
215
								$aso_page['date'] = strftime('%d.%m', $aso_page['date']);
217
								break;
216
								break;
218
							case 'jma' :
217
							case 'jma' :
219
								$aso_page['date'] = strftime('%d.%m.%Y', $aso_page['date']);
218
								$aso_page['date'] = strftime('%d.%m.%Y', $aso_page['date']);
220
								break;
219
								break;
221
							case 'jmh' :
220
							case 'jmh' :
222
								$aso_page['date'] = strftime('%d.%m %H:%M', $aso_page['date']);
221
								$aso_page['date'] = strftime('%d.%m %H:%M', $aso_page['date']);
223
								break;
222
								break;
224
							case 'jmah' :
223
							case 'jmah' :
225
								$aso_page['date'] = strftime('%d.%m.%Y %H:%M', $aso_page['date']);
224
								$aso_page['date'] = strftime('%d.%m.%Y %H:%M', $aso_page['date']);
226
								break;
225
								break;
227
							default :
226
							default :
228
								$aso_page['date'] = strftime('%d.%m.%Y %H:%M', $aso_page['date']);
227
								$aso_page['date'] = strftime('%d.%m.%Y %H:%M', $aso_page['date']);
229
						}
228
						}
230
					} else {
229
					} else {
231
						switch ($options['formatdate']) {
230
						switch ($options['formatdate']) {
232
							case 'jm' :
231
							case 'jm' :
233
								$aso_page['date'] = strftime('%d.%m', $aso_page['date']);
232
								$aso_page['date'] = strftime('%d.%m', $aso_page['date']);
234
								break;
233
								break;
235
							case 'jma' :
234
							case 'jma' :
236
								$aso_page['date'] = strftime('%d.%m.%Y', $aso_page['date']);
235
								$aso_page['date'] = strftime('%d.%m.%Y', $aso_page['date']);
237
								break;
236
								break;
238
							case 'jmh' :
237
							case 'jmh' :
239
								$aso_page['date'] = strftime('%d.%m %H:%M', $aso_page['date']);
238
								$aso_page['date'] = strftime('%d.%m %H:%M', $aso_page['date']);
240
								break;
239
								break;
241
							case 'jmah' :
240
							case 'jmah' :
242
								$aso_page['date'] = strftime('%d.%m.%Y %H:%M', $aso_page['date']);
241
								$aso_page['date'] = strftime('%d.%m.%Y %H:%M', $aso_page['date']);
243
								break;
242
								break;
244
							default :
243
							default :
245
								$aso_page['date'] = strftime('%d.%m.%Y %H:%M', $aso_page['date']);
244
								$aso_page['date'] = strftime('%d.%m.%Y %H:%M', $aso_page['date']);
246
						}
245
						}
247
					}
246
					}
248
					$aso_site['pages'][] = $aso_page;
247
					$aso_site['pages'][] = $aso_page;
249
					$GLOBALS['_SYNDICATION_']['pages'][strtotime($aso_page['date'])] = $aso_page;
248
					$GLOBALS['_SYNDICATION_']['pages'][strtotime($aso_page['date'])] = $aso_page;
250
				}
249
				}
251
				$GLOBALS['_SYNDICATION_']['sites'][] = $aso_site;
250
				$GLOBALS['_SYNDICATION_']['sites'][] = $aso_site;
252
			}
251
			}
253
        }
252
        }
254
    }
253
    }
255
	// Trie des pages par date
254
	// Trie des pages par date
256
	//var_dump($GLOBALS['_SYNDICATION_']['pages']);
255
	//var_dump($GLOBALS['_SYNDICATION_']['pages']);
257
	krsort($GLOBALS['_SYNDICATION_']['pages']);
256
	krsort($GLOBALS['_SYNDICATION_']['pages']);
258
	 
257
	 
259
	//+----------------------------------------------------------------------------------------------------------------+
258
	//+----------------------------------------------------------------------------------------------------------------+
260
    // Extrait les variables et les ajoutes a l'espace de noms local
259
    // Extrait les variables et les ajoutes a l'espace de noms local
261
	// Gestion des squelettes
260
	// Gestion des squelettes
262
	extract($GLOBALS['_SYNDICATION_']);
261
	extract($GLOBALS['_SYNDICATION_']);
263
	// Demarre le buffer
262
	// Demarre le buffer
264
	ob_start();
263
	ob_start();
265
	// Inclusion du fichier
264
	// Inclusion du fichier
266
	include($options['template']);
265
	include($options['template']);
267
	// Recuperer le  contenu du buffer
266
	// Recuperer le  contenu du buffer
268
	$sortie = ob_get_contents();
267
	$sortie = ob_get_contents();
269
	// Arrete et detruit le buffer
268
	// Arrete et detruit le buffer
270
	ob_end_clean();
269
	ob_end_clean();
271
	
270
	
272
	//+----------------------------------------------------------------------------------------------------------------+
271
	//+----------------------------------------------------------------------------------------------------------------+
273
	// Sortie
272
	// Sortie
274
    return $sortie;
273
    return $sortie;
275
}
274
}
276
 
275
 
277
/* +--Fin du code ----------------------------------------------------------------------------------------+
276
/* +--Fin du code ----------------------------------------------------------------------------------------+
278
*
277
*
279
* $Log: not supported by cvs2svn $
278
* $Log: not supported by cvs2svn $
-
 
279
* Revision 1.5.2.3  2007-07-25 14:50:21  jp_milcent
-
 
280
* Corrections, meilleure utilisation de XML_Feed_Parser.
-
 
281
*
280
* Revision 1.5.2.2  2007-07-25 09:45:07  jp_milcent
282
* Revision 1.5.2.2  2007-07-25 09:45:07  jp_milcent
281
* Utilisation de XML_Feed_Parser de Pear pour l'applette Syndication.
283
* Utilisation de XML_Feed_Parser de Pear pour l'applette Syndication.
282
*
284
*
283
* Revision 1.5.2.1  2007-06-06 15:24:37  jp_milcent
285
* Revision 1.5.2.1  2007-06-06 15:24:37  jp_milcent
284
* Amélioration de la compatibilité avec les anciennes version des balises de l'applette syndication.
286
* Amélioration de la compatibilité avec les anciennes version des balises de l'applette syndication.
285
*
287
*
286
* Revision 1.5  2007-04-20 12:50:18  florian
288
* Revision 1.5  2007-04-20 12:50:18  florian
287
* correction bugs suite au merge
289
* correction bugs suite au merge
288
*
290
*
289
* Revision 1.4  2007/03/28 15:53:27  florian
291
* Revision 1.4  2007/03/28 15:53:27  florian
290
* correction pb date, encodage utf-8
292
* correction pb date, encodage utf-8
291
*
293
*
292
* Revision 1.3  2007/01/23 14:17:19  alexandre_tb
294
* Revision 1.3  2007/01/23 14:17:19  alexandre_tb
293
* backport : hack pour rattraper les dates du type 01012005 parsees par magpie
295
* backport : hack pour rattraper les dates du type 01012005 parsees par magpie
294
* lorsque les flux donne des dates au format iso
296
* lorsque les flux donne des dates au format iso
295
*
297
*
296
* Revision 1.2  2006/12/13 17:20:51  jp_milcent
298
* Revision 1.2  2006/12/13 17:20:51  jp_milcent
297
* Correction bogue : paramètre nb non pris en compte
299
* Correction bogue : paramètre nb non pris en compte
298
*
300
*
299
* Revision 1.1  2006/12/13 17:06:36  jp_milcent
301
* Revision 1.1  2006/12/13 17:06:36  jp_milcent
300
* Ajout de l'applette Syndication.
302
* Ajout de l'applette Syndication.
301
*
303
*
302
*
304
*
303
* +-- Fin du code ----------------------------------------------------------------------------------------+
305
* +-- Fin du code ----------------------------------------------------------------------------------------+
304
*/
306
*/
305
?>
307
?>