19,7 → 19,7 |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: bazar.fonct.rss.php,v 1.60.2.8 2007-02-27 15:11:00 alexandre_tb Exp $ |
// CVS : $Id: bazar.fonct.rss.php,v 1.60.2.9 2007-02-27 15:32:40 alexandre_tb Exp $ |
/** |
* |
*@package bazar |
28,7 → 28,7 |
*@author Florian Schmitt <florian@ecole-et-nature.org> |
//Autres auteurs : |
*@copyright Tela-Botanica 2000-2006 |
*@version $Revision: 1.60.2.8 $ |
*@version $Revision: 1.60.2.9 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
612,7 → 612,24 |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
|
|
function xmlEntities($s){ |
//build first an assoc. array with the entities we want to match |
$table1 = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES); |
|
//now build another assoc. array with the entities we want to replace (numeric entities) |
foreach ($table1 as $k=>$v){ |
$table1[$k] = "/$v/"; |
$c = htmlentities($k,ENT_QUOTES,"UTF-8"); |
$table2[$c] = "&#".ord($k).";"; |
} |
|
//now perform a replacement using preg_replace |
//each matched value in array 1 will be replaced with the corresponding value in array 2 |
$s = preg_replace($table1,$table2,$s); |
return $s; |
} |
|
include_once 'XML/Util.php' ; |
|
$xml = XML_Util::getXMLDeclaration('1.0', 'ISO-8859-1', 'no') ; |
639,7 → 656,7 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
$xml .= XML_Util::createStartElement ('item'); |
|
$xml .= XML_Util::createTag ('title', null, $ligne['bf_titre']); |
$xml .= XML_Util::createTag ('title', null, xmlEntities($ligne['bf_titre'])); |
|
$lien=$GLOBALS['_BAZAR_']['url']; |
$lien->addQueryString('action', BAZ_VOIR_FICHE); |
1036,6 → 1053,10 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.60.2.8 2007/02/27 15:11:00 alexandre_tb |
* correction d une jointure dans la requete pour les flux rss |
* utilisation de la librairie XML_Util de pear pour generer le flux RSS -> plus clair |
* |
* Revision 1.60.2.7 2007/02/15 17:39:00 jp_milcent |
* Remise dans le code d'un bogue... |
* A corriger! |