Line 17... |
Line 17... |
17 |
// | |
|
17 |
// | |
|
18 |
// | You should have received a copy of the GNU Lesser General Public |
|
18 |
// | You should have received a copy of the GNU Lesser General Public |
|
19 |
// | License along with this library; if not, write to the Free Software |
|
19 |
// | License along with this library; if not, write to the Free Software |
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
22 |
// CVS : $Id: bazar.fonct.rss.php,v 1.68 2007-03-05 10:27:06 alexandre_tb Exp $
|
22 |
// CVS : $Id: bazar.fonct.rss.php,v 1.69 2007-03-06 09:39:00 alexandre_tb Exp $
|
23 |
/**
|
23 |
/**
|
24 |
*
|
24 |
*
|
25 |
*@package bazar
|
25 |
*@package bazar
|
26 |
//Auteur original :
|
26 |
//Auteur original :
|
27 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
|
27 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
|
28 |
*@author Florian Schmitt <florian@ecole-et-nature.org>
|
28 |
*@author Florian Schmitt <florian@ecole-et-nature.org>
|
29 |
//Autres auteurs :
|
29 |
//Autres auteurs :
|
30 |
*@copyright Tela-Botanica 2000-2006
|
30 |
*@copyright Tela-Botanica 2000-2006
|
31 |
*@version $Revision: 1.68 $
|
31 |
*@version $Revision: 1.69 $
|
32 |
// +------------------------------------------------------------------------------------------------------+
|
32 |
// +------------------------------------------------------------------------------------------------------+
|
33 |
*/
|
33 |
*/
|
Line 34... |
Line 34... |
34 |
|
34 |
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
Line 562... |
Line 562... |
562 |
if ($req_where==1) {$requete .= ' AND ';}
|
562 |
if ($req_where==1) {$requete .= ' AND ';}
|
563 |
$requete .= 'bf_ce_nature IN (' ;
|
563 |
$requete .= 'bf_ce_nature IN (' ;
|
564 |
$chaine = '';
|
564 |
$chaine = '';
|
565 |
foreach ($typeannonce as $valeur) $chaine .= '"'.$valeur.'",' ;
|
565 |
foreach ($typeannonce as $valeur) $chaine .= '"'.$valeur.'",' ;
|
566 |
$requete .= substr ($chaine, 0, strlen ($chaine)-1) ;
|
566 |
$requete .= substr ($chaine, 0, strlen ($chaine)-1) ;
|
567 |
$requete .= ') ';
|
567 |
$requete .= ') and bf_ce_nature=bn_id_nature ';
|
568 |
}
|
568 |
}
|
569 |
$utilisateur = new Administrateur_bazar ($GLOBALS['AUTH']) ;
|
569 |
$utilisateur = new Administrateur_bazar ($GLOBALS['AUTH']) ;
|
570 |
if ($valide!=0) {
|
570 |
if ($valide!=0) {
|
Line 571... |
Line 571... |
571 |
|
571 |
|
Line 599... |
Line 599... |
599 |
$requete .= '('.$requeteSQL.')';
|
599 |
$requete .= '('.$requeteSQL.')';
|
600 |
$req_where=1;
|
600 |
$req_where=1;
|
601 |
}
|
601 |
}
|
602 |
if ($categorie_nature!='') {
|
602 |
if ($categorie_nature!='') {
|
603 |
if ($req_where==1) {$requete .= ' AND ';}
|
603 |
if ($req_where==1) {$requete .= ' AND ';}
|
604 |
$requete .= 'bn_ce_id_menu IN ('.$categorie_nature.') ';
|
604 |
$requete .= 'bn_ce_id_menu IN ('.$categorie_nature.') and bf_ce_nature=bn_id_nature ';
|
605 |
$req_where=1;
|
605 |
$req_where=1;
|
606 |
}
|
606 |
}
|
Line 607... |
Line 607... |
607 |
|
607 |
|
608 |
$requete .= ' ORDER BY bf_date_creation_fiche DESC, bf_date_fin_validite_fiche DESC, bf_date_maj_fiche DESC';
|
608 |
$requete .= ' ORDER BY bf_date_creation_fiche DESC, bf_date_fin_validite_fiche DESC, bf_date_maj_fiche DESC';
|
Line 652... |
Line 652... |
652 |
$xml .= XML_Util::createEndElement ('image');
|
652 |
$xml .= XML_Util::createEndElement ('image');
|
653 |
if ($resultat->numRows()>0) {
|
653 |
if ($resultat->numRows()>0) {
|
654 |
// Creation des items : titre + lien + description + date de publication
|
654 |
// Creation des items : titre + lien + description + date de publication
|
655 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
655 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
656 |
$xml .= XML_Util::createStartElement ('item');
|
656 |
$xml .= XML_Util::createStartElement ('item');
|
657 |
|
- |
|
- |
|
657 |
$caractere = array('/\x92/', '/\x85/', '/\x80/', '/\x97/', '/\x96/');
|
- |
|
658 |
$caractere_remplacement = array ('’', '…', '€', '—', '–');
|
658 |
$xml .= XML_Util::createTag ('title', null, xmlEntities($ligne['bf_titre']));
|
659 |
$xml .= XML_Util::createTag ('title', null, preg_replace ($caractere, $caractere_remplacement,
|
659 |
|
- |
|
- |
|
660 |
XML_Util::replaceEntities($ligne['bf_titre'])));
|
660 |
$lien=$GLOBALS['_BAZAR_']['url'];
|
661 |
$lien=$GLOBALS['_BAZAR_']['url'];
|
661 |
$lien->addQueryString('action', BAZ_VOIR_FICHE);
|
662 |
$lien->addQueryString('action', BAZ_VOIR_FICHE);
|
662 |
$lien->addQueryString('id_fiche', $ligne['bf_id_fiche']);
|
663 |
$lien->addQueryString('id_fiche', $ligne['bf_id_fiche']);
|
663 |
$xml .= XML_Util::createTag ('link', null, $lien->getURL());
|
664 |
$xml .= XML_Util::createTag ('link', null, $lien->getURL());
|
664 |
$xml .= XML_Util::createTag ('guid', null, $lien->getURL());
|
665 |
$xml .= XML_Util::createTag ('guid', null, $lien->getURL());
|
665 |
$xml .= XML_Util::createStartElement ('description');
|
666 |
$xml .= XML_Util::createStartElement ('description');
|
666 |
if ($_GET['action'] != BAZ_VOIR_TOUTES_ANNONCES) {
|
667 |
if ($_GET['action'] != BAZ_VOIR_TOUTES_ANNONCES) {
|
667 |
$xml .= XML_Util::createCDataSection ($ligne['bf_description']);
|
668 |
$xml .= XML_Util::createCDataSection (preg_replace ($caractere, $caractere_remplacement, $ligne['bf_description']));
|
668 |
}
|
669 |
}
|
669 |
$xml .= XML_Util::createEndElement ('description');
|
670 |
$xml .= XML_Util::createEndElement ('description');
|
670 |
if ($ligne['bf_date_debut_validite_fiche'] == '0000-00-00') $date_pub = $ligne[' bf_date_creation_fiche'] ; else
|
671 |
if ($ligne['bf_date_debut_validite_fiche'] == '0000-00-00') $date_pub = $ligne[' bf_date_creation_fiche'] ; else
|
671 |
$date_pub = $ligne['bf_date_debut_validite_fiche'];
|
672 |
$date_pub = $ligne['bf_date_debut_validite_fiche'];
|
672 |
$xml .= XML_Util::createTag ('pubDate', null, strftime('%d %b %Y %H:%M:%S GMT',strtotime($date_pub)));
|
673 |
$xml .= XML_Util::createTag ('pubDate', null, strftime('%d %b %Y %H:%M:%S GMT',strtotime($date_pub)));
|
Line 1046... |
Line 1047... |
1046 |
}
|
1047 |
}
|
Line 1047... |
Line 1048... |
1047 |
|
1048 |
|
1048 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
1049 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
1049 |
*
|
1050 |
*
|
- |
|
1051 |
* $Log: not supported by cvs2svn $
|
- |
|
1052 |
* Revision 1.68 2007/03/05 10:27:06 alexandre_tb
|
- |
|
1053 |
* ajout d identifiant dans les span qui affiche le detail d une fiche.
|
- |
|
1054 |
* ajout d un modele pour les fiches -> du code a ete deplace dans
|
- |
|
1055 |
* bazar_template
|
1050 |
* $Log: not supported by cvs2svn $
|
1056 |
*
|
1051 |
* Revision 1.67 2007/02/28 10:18:56 alexandre_tb
|
1057 |
* Revision 1.67 2007/02/28 10:18:56 alexandre_tb
|
1052 |
* backport de bug depuis la 1.60 de menes
|
1058 |
* backport de bug depuis la 1.60 de menes
|
1053 |
*
|
1059 |
*
|
1054 |
* Revision 1.64 2007/02/02 14:00:41 alexandre_tb
|
1060 |
* Revision 1.64 2007/02/02 14:00:41 alexandre_tb
|