Subversion Repositories Applications.papyrus

Rev

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

Rev 1283 Rev 1359
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: syndication.php,v 1.4 2007-03-28 15:53:27 florian Exp $
24
// CVS : $Id: syndication.php,v 1.5 2007-04-20 12:50:18 florian Exp $
25
/**
25
/**
26
* papyrus_bp - syndication.php
26
* papyrus_bp - syndication.php
27
*
27
*
28
* Description :
28
* Description :
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 1999-2006
35
*@copyright     Tela-Botanica 1999-2006
36
*@version       $Revision: 1.4 $ $Date: 2007-03-28 15:53:27 $
36
*@version       $Revision: 1.5 $ $Date: 2007-04-20 12:50:18 $
37
// +------------------------------------------------------------------------------------------------------+
37
// +------------------------------------------------------------------------------------------------------+
38
*/
38
*/
Line 39... Line 39...
39
 
39
 
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
Line 133... Line 133...
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
				$url = str_replace('&amp;', '&', $url) ;
138
				$rss =& new XML_RSS(str_replace('&amp;', '&', $url));
139
				$rss =& new XML_RSS($url);
-
 
140
				$rss->parse();
139
				$rss->parse();
141
				if ($options['template'] != '' && !file_exists($options['template'])) {
140
				if ($options['template'] != '' && !file_exists($options['template'])) {
142
					$i = 0 ;
141
					$i = 0 ;
143
					$res= '';
142
					$res= '';
144
					foreach ($rss->getItems() as $item) {
143
					foreach ($rss->getItems() as $item) {
Line 177... Line 176...
177
						}
176
						}
178
					}
177
					}
179
					return $res;
178
					return $res;
180
				}
179
				}
181
				$channel=$rss->getChannelInfo();
180
				$channel=$rss->getChannelInfo();
-
 
181
				//var_dump($channel);
182
				// Gestion du titre
182
				// Gestion du titre
183
				if ( $options['titre'] == '' ) {
183
				if ( $options['titre'] == '' ) {
184
					$aso_site['titre'] = utf8_decode($channel['title']);
184
					$aso_site['titre'] = utf8_decode($channel['title']);
185
				} else if ( $options['titre'] != '0' ) {
185
				} else if ( $options['titre'] != '0' ) {
186
					$aso_site['titre'] = utf8_decode($options['titre']);
186
					$aso_site['titre'] = utf8_decode($options['titre']);
Line 256... Line 256...
256
				$GLOBALS['_SYNDICATION_']['sites'][] = $aso_site;
256
				$GLOBALS['_SYNDICATION_']['sites'][] = $aso_site;
257
			}
257
			}
258
        }
258
        }
259
    }
259
    }
260
	// Trie des pages par date
260
	// Trie des pages par date
261
	//var_dump($GLOBALS['_SYNDICATION_']);
261
	//var_dump($GLOBALS['_SYNDICATION_']['pages']);
262
	krsort($GLOBALS['_SYNDICATION_']['pages']);
262
	krsort($GLOBALS['_SYNDICATION_']['pages']);
Line 263... Line 263...
263
	 
263
	 
264
	//+----------------------------------------------------------------------------------------------------------------+
264
	//+----------------------------------------------------------------------------------------------------------------+
265
    // Extrait les variables et les ajoutes a l'espace de noms local
265
    // Extrait les variables et les ajoutes a l'espace de noms local
Line 280... Line 280...
280
}
280
}
Line 281... Line 281...
281
 
281
 
282
/* +--Fin du code ----------------------------------------------------------------------------------------+
282
/* +--Fin du code ----------------------------------------------------------------------------------------+
283
*
283
*
-
 
284
* $Log: not supported by cvs2svn $
-
 
285
* Revision 1.4  2007/03/28 15:53:27  florian
-
 
286
* correction pb date, encodage utf-8
284
* $Log: not supported by cvs2svn $
287
*
285
* Revision 1.3  2007/01/23 14:17:19  alexandre_tb
288
* Revision 1.3  2007/01/23 14:17:19  alexandre_tb
286
* backport : hack pour rattraper les dates du type 01012005 parsees par magpie
289
* backport : hack pour rattraper les dates du type 01012005 parsees par magpie
287
* lorsque les flux donne des dates au format iso
290
* lorsque les flux donne des dates au format iso
288
*
291
*