21,7 → 21,7 |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: syndication.php,v 1.7.2.1 2007-11-30 14:15:02 jp_milcent Exp $ |
// CVS : $Id: syndication.php,v 1.7.2.2 2007-12-03 14:52:21 jp_milcent Exp $ |
/** |
* papyrus_bp - syndication.php |
* |
33,7 → 33,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 1999-2006 |
*@version $Revision: 1.7.2.1 $ $Date: 2007-11-30 14:15:02 $ |
*@version $Revision: 1.7.2.2 $ $Date: 2007-12-03 14:52:21 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
135,6 → 135,8 |
foreach ($tab_url as $cle => $url) { |
if ($url != '') { |
$aso_site = array(); |
// Liste des encodages acceptés pour les flux |
$encodages = 'UTF-8, ISO-8859-1, ISO-8859-15'; |
try { |
$feed = new XML_Feed_Parser(file_get_contents($url)); |
} catch (XML_Feed_Parser_Exception $e) { |
154,11 → 156,11 |
$all = false; |
} |
if (isset($item->summary)) { |
$item->description = $item->summary; |
$item->description = mb_convert_encoding($item->summary, 'HTML-ENTITIES', $encodages); |
} else { |
if (strlen($item->description) > 200 && !$all) { |
$item->description = substr ($item->description , 0, 300). |
'... <a href="'.$item->link.'">Lire la suite</a>'; |
$item->description = substr(mb_convert_encoding($item->description, 'HTML-ENTITIES', $encodages), 0, 300). |
'... <a href="'.htmlentities($item->link).'">Lire la suite</a>'; |
} |
} |
if (!isset($item->pubdate)) { |
171,9 → 173,9 |
//echo $item['pubdate']; |
} |
$res .= str_replace ('{num}', ++$i, |
str_replace ('{item}', '<a href="'.$item->link.'" target="_top">'.htmlentities($item->title).'</a>', |
str_replace ('{item}', '<a href="'.htmlentities($item->link).'" target="_top">'.mb_convert_encoding($item->title, 'HTML-ENTITIES', $encodages).'</a>', |
str_replace ('{date}', strftime('%d.%m.%Y',strtotime($item->pubdate)), |
str_replace ('{description}', $item->description, $options['template'])))) ; |
str_replace ('{description}', mb_convert_encoding($item->description, 'HTML-ENTITIES', $encodages), $options['template'])))) ; |
$res .= "\n"; |
if ($i > $options['nb']) { |
break; |
183,7 → 185,7 |
} |
// Gestion du titre |
if ( $options['titre'] == '' ) { |
$aso_site['titre'] = mb_convert_encoding($feed->title, 'HTML-ENTITIES', 'UTF-8'); |
$aso_site['titre'] = mb_convert_encoding($feed->title, 'HTML-ENTITIES', $encodages); |
} else if ( $options['titre'] != '0' ) { |
$aso_site['titre'] = $options['titre']; |
} |
206,8 → 208,8 |
$i++; |
$aso_page = array(); |
$aso_page['site'] = $aso_site; |
$aso_page['url'] = $item->link; |
$aso_page['titre'] = mb_convert_encoding($item->title, 'HTML-ENTITIES', 'UTF-8'); |
$aso_page['url'] = htmlentities($item->link); |
$aso_page['titre'] = mb_convert_encoding($item->title, 'HTML-ENTITIES', $encodages); |
$aso_page['date'] = $item->pubDate; |
if ($options['formatdatepro']) { |
switch ($options['formatdatepro']) { |
276,6 → 278,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.7.2.1 2007-11-30 14:15:02 jp_milcent |
* Amélioration du décodage utf8. |
* |
* Revision 1.7 2007-07-25 15:09:44 jp_milcent |
* Fusion avec la livraison Narmer. |
* |