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.9 2007-02-27 15:32:40 alexandre_tb Exp $ |
// CVS : $Id: bazar.fonct.rss.php,v 1.60.2.10 2007-03-06 09:41:15 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.9 $ |
*@version $Revision: 1.60.2.10 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
228,8 → 228,8 |
$val=$tableau[$i]['nom_bdd']; |
if (!in_array($val, array ('bf_titre', 'bf_description'))) { |
if ($ligne[$val] != '' and $ligne[$val] != BAZ_CHOISIR and $ligne[$val] != BAZ_NON_PRECISE) { |
$res .= '<span class="rubrique">'.$tableau[$i]['label'].':</span>'."\n"; |
$res .= '<span class="description"> '.nl2br($ligne[$val]).'</span>'."\n".'<br />'."\n"; |
$res .= '<span class="rubrique" id="'.$tableau[$i]['nom_bdd'].'_rubrique">'.$tableau[$i]['label'].':</span>'."\n"; |
$res .= '<span class="description" id="'.$tableau[$i]['nom_bdd'].'_description"> '.nl2br($ligne[$val]).'</span>'."\n".'<br />'."\n"; |
} |
} |
} |
248,8 → 248,8 |
$nb++; |
} |
if ($val != '' and $val != BAZ_CHOISIR and $val != BAZ_NON_PRECISE) { |
$res .= '<span class="rubrique">'.$tableau[$i]['label'].':</span>'."\n"; |
$res .= '<span class="description"> '.$val.'</span>'."\n".'<br />'."\n"; |
$res .= '<span class="rubrique" id="rubrique_'.$tableau[$i]['nom_bdd'].'">'.$tableau[$i]['label'].':</span>'."\n"; |
$res .= '<span class="description" id="description_'.$tableau[$i]['nom_bdd'].'"> '.$val.'</span>'."\n".'<br />'."\n"; |
} |
} |
elseif ( $tableau[$i]['type']=='listedatedeb' || $tableau[$i]['type']=='listedatefin' ) { |
256,8 → 256,8 |
$val=$tableau[$i]['nom_bdd']; |
if (!in_array($val, array ('bf_date_debut_validite_fiche', 'bf_date_fin_validite_fiche'))) { |
if ($ligne[$val] != '' && $ligne[$val] != '0000-00-00') { |
$res .= '<span class="rubrique">'.$tableau[$i]['label'].':</span>'."\n"; |
$res .= '<span class="description"> '.strftime('%d.%m.%Y',strtotime($ligne[$val])).'</span>'."\n".'<br />'."\n"; |
$res .= '<span class="rubrique" id="'.$tableau[$i]['nom_bdd'].'_rubrique">'.$tableau[$i]['label'].':</span>'."\n"; |
$res .= '<span class="description" id="'.$tableau[$i]['nom_bdd'].'_description"> '.strftime('%d.%m.%Y',strtotime($ligne[$val])).'</span>'."\n".'<br />'."\n"; |
} |
} |
} |
565,7 → 565,7 |
$chaine = ''; |
foreach ($typeannonce as $valeur) $chaine .= '"'.$valeur.'",' ; |
$requete .= substr ($chaine, 0, strlen ($chaine)-1) ; |
$requete .= ') '; |
$requete .= ') and bf_ce_nature=bn_id_nature '; |
} |
$utilisateur = new Administrateur_bazar ($GLOBALS['AUTH']) ; |
if ($valide!=0) { |
602,7 → 602,7 |
} |
if ($categorie_nature!='') { |
if ($req_where==1) {$requete .= ' AND ';} |
$requete .= 'bn_ce_id_menu IN ('.$categorie_nature.') '; |
$requete .= 'bn_ce_id_menu IN ('.$categorie_nature.') and bf_ce_nature=bn_id_nature '; |
$req_where=1; |
} |
|
655,9 → 655,10 |
// Creation des items : titre + lien + description + date de publication |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
$xml .= XML_Util::createStartElement ('item'); |
|
$xml .= XML_Util::createTag ('title', null, xmlEntities($ligne['bf_titre'])); |
|
$caractere = array('/\x92/', '/\x85/', '/\x80/', '/\x97/', '/\x96/'); |
$caractere_remplacement = array ('’', '…', '€', '—', '–'); |
$xml .= XML_Util::createTag ('title', null, preg_replace ($caractere, $caractere_remplacement, |
XML_Util::replaceEntities($ligne['bf_titre']))); |
$lien=$GLOBALS['_BAZAR_']['url']; |
$lien->addQueryString('action', BAZ_VOIR_FICHE); |
$lien->addQueryString('id_fiche', $ligne['bf_id_fiche']); |
665,7 → 666,7 |
$xml .= XML_Util::createTag ('guid', null, $lien->getURL()); |
$xml .= XML_Util::createStartElement ('description'); |
if ($_GET['action'] != BAZ_VOIR_TOUTES_ANNONCES) { |
$xml .= XML_Util::createCDataSection ($ligne['bf_description']); |
$xml .= XML_Util::createCDataSection (preg_replace ($caractere, $caractere_remplacement, $ligne['bf_description'])); |
} |
$xml .= XML_Util::createEndElement ('description'); |
if ($ligne['bf_date_debut_validite_fiche'] == '0000-00-00') $date_pub = $ligne[' bf_date_creation_fiche'] ; else |
681,7 → 682,7 |
$xml .= XML_Util::createTag ('description', null, BAZ_PAS_D_ANNONCES); |
$xml .= XML_Util::createTag ('pubDate', null, strftime('%d %b %Y %H:%M:%S GMT',strtotime('12/12/2004'))); |
$xml .= XML_Util::createEndElement ('item'); |
$xml .= '</item>'."\n"; |
|
} |
$xml .= XML_Util::createEndElement ('channel'); |
$xml .= XML_Util::createEndElement('rss') ; |
1053,6 → 1054,10 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.60.2.9 2007/02/27 15:32:40 alexandre_tb |
* utilisation de la fonction xmlEntities pour transformer les & en &#...; |
* fixe les plantages des flux rss lorsque des guillemets ou des esperluettes étaient présents |
* |
* 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 |