Bonjour et merci Koala64 de te pencher sur mon cas !
Le script de news c'est WBnews et je crois que le problème doit être lié ou aux caractères accentués ou aux bbcodes car l'auteur ne peut pas le reproduire en langue anglaise. Alors voilà la page PHP du script qui génère le flux :
* @author $Author: pmcilwaine $
* @version $Id: news.rss.php,v 1.3 2007/05/19 00:28:51 pmcilwaine Exp $
*/
if (!defined('wbnews'))
define('wbnews', true);
$installpath = substr(__FILE__, 0, (($pos = strpos(__FILE__, basename(__FILE__))) != -1 ? $pos : 0));
include $installpath . "../../global.php"; //get the global file
include $installpath . "../../includes/bbcode.php";
if ($newsConfig['rss_on'] == 1 && $newsConfig['systemstatus'] == 0)
{
// RSS Header
$display = '<?xml version="1.0" encoding="iso-8859-1" ?>' . "\n";
// XSL Header
if (file_exists($config['installdir'] . "/templates/" . $theme['THEME_DIRECTORY'] . "/rss/feed.xsl"))
{
$stylesheet = 'http://' . $_SERVER['HTTP_HOST'] . "/news";
$stylesheet .= '/templates/' . $theme['THEME_DIRECTORY'] . "/rss/feed.xsl";
$display .= '<?xml-stylesheet type="text/xsl" href="' . $stylesheet . '"?>' . "\n";
}
$display .= '<rss version="2.0">' . "\n";
$display .= '<channel>' . "\n";
$display .= '<title>' . (empty($newsConfig['sitename']) ? "WB News RSS Generated" : $newsConfig['sitename']) . '</title>' . "\n";
$display .= '<link>' . (empty($newsConfig['siteaddress']) ? "http://" . $_SERVER['HTTP_HOST'] . "/" : $newsConfig['siteaddress']) . '</link>' . "\n";
$display .= '<description>WB News Generated RSS File</description>' . "\n";
$display .= '<generator>WB News v1.0.0 - http://www.webmobo.com/</generator>' . "\n";
$display .= '<language>fr</language>' . "\n";
// news items
$getNews = $dbclass->db_query("SELECT *, DATE_FORMAT(FROM_UNIXTIME(n.timeposted), '%a, %e %b %Y %T " . date("O") . "') as timeposted
FROM " . TBL_NEWS . " n
ORDER BY n.timeposted DESC"
);
if ($dbclass->db_numrows($getNews))
while ($news = $dbclass->db_fetcharray($getNews))
{
$display .= '<item>' . "\n";
$replace = array("\n", "\r");
$news['news'] = bbcode(nl2br(htmldecode($news['news'])));
$news['news'] = str_replace($replace, "", $news['news']);
$display .= '<title>' . $news['title'] . '</title>' . "\n";
$link = $tpl->replace($newsConfig['newsdisplay'], array("newsid" => $news['id']));
$parse_link = parse_url( $link );
if ( !array_key_exists( "scheme", $parse_link ) )
{
$link = "http://" . $link;
}
if ( !array_key_exists( "host", $parse_link ) )
{
$link = substr( $link, 0, 7 ) . $_SERVER["HTTP_HOST"] . "/" . substr( $link, 7 );
}
$display .= '<link>' . $link . '</link>' . "\n";
$display .= '<description><![CDATA[' . $news['news'] . ']]></description>' . "\n";
$display .= '<guid isPermaLink="true">' . $link . '</guid>' . "\n";
$display .= '<pubDate>' . $news['timeposted'] . '</pubDate>' . "\n";
$display .= '</item>' . "\n";
}
// footer
$display .= '</channel>'."\n";
$display .= '</rss>';
header('Content-type: application/xml');
echo $display;
}
?>
Et voici le fichier .xsl :
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- XSL Transformation -->
<!-- Created By Webmobo.com for WB News -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" version="1.0" encoding="iso-8859-1" indent="yes"/>
<xsl:template match="/">
<html>
<head>
<title>WebMobo - News Feed</title>
<style type="text/css">
html {
background: #6CCEFF;
}
html>body {
margin: 0px;
}
body {
margin: 0px;
}
#head {
text-align: center;
background: #59AAD3;
border-bottom: 1px solid #417C9A;
font: .6em arial, verdana, helvectica, sans-serif;
color: #fff;
padding: 2px;
}
#main {
background: #fff;
border: 1px solid #417C9A;
width: 80%;
margin: 10px auto;
margin-top: 30px;
padding: 5px;
font: .8em arial, verdana, helvectica, sans-serif;
}
#header {
font: 2.2em arial, verdana, helvectica, sans-serif;
font-weight: bold;
}
.header {
font: 1.2em arial, verdana, helvectica, sans-serif;
font-weight: bold;
}
.small {
font: x-small arial, verdana, helvectica, sans-serif;
margin-bottom: 5px;
}
a:link, a:active, a:visited, a:hover {
color: #000;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div id="head">You are viewing a News feed generated by <a href="http://www.webmobo.com" style="color: #fff;">WB News</a></div>
<div id="main">
<xsl:apply-templates select="/rss/channel" />
</div>
</body>
</html>
</xsl:template>
<xsl:template match="/rss/channel">
<h1 id="header"><a><xsl:attribute name="href"><xsl:value-of select="link" /></xsl:attribute><xsl:value-of select="title" /></a></h1><p />
<xsl:apply-templates select="item" />
</xsl:template>
<xsl:template match="item">
<div class="header"><a><xsl:attribute name="href"><xsl:value-of select="link" /></xsl:attribute><xsl:value-of select="title" /></a></div>
<div class="small"><strong>Posted On:</strong> <xsl:value-of select="pubDate" /></div>
<!--<div><xsl:copy-of select="description" /><xsl:value-of select="description" disable-output-escaping="yes" /></div><p />-->
<xsl:apply-templates select="description" />
<xsl:if test="position()!=last()" />
</xsl:template>
<xsl:template match="description">
<div><xsl:copy-of select="." /></div><p />
</xsl:template>
</xsl:stylesheet>