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.99.2.13 2008-04-16 12:39:56 alexandre_tb Exp $
|
22 |
// CVS : $Id: bazar.fonct.rss.php,v 1.99.2.14 2008-11-19 09:30:18 aperonnet 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.99.2.13 $
|
31 |
*@version $Revision: 1.99.2.14 $
|
32 |
// +------------------------------------------------------------------------------------------------------+
|
32 |
// +------------------------------------------------------------------------------------------------------+
|
33 |
*/
|
33 |
*/
|
Line 34... |
Line 34... |
34 |
|
34 |
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
Line 615... |
Line 615... |
615 |
* @return string Le code du flux RSS
|
615 |
* @return string Le code du flux RSS
|
616 |
*/
|
616 |
*/
|
617 |
function gen_RSS($typeannonce='', $nbitem='', $emetteur='', $valide=1, $requeteSQL='', $requeteSQLFrom = '', $requeteWhereListe = '', $categorie_nature='', $order = '') {
|
617 |
function gen_RSS($typeannonce='', $nbitem='', $emetteur='', $valide=1, $requeteSQL='', $requeteSQLFrom = '', $requeteWhereListe = '', $categorie_nature='', $order = '') {
|
618 |
// generation de la requete MySQL personnalisee
|
618 |
// generation de la requete MySQL personnalisee
|
619 |
$req_where=0;
|
619 |
$req_where=0;
|
620 |
$requete = 'SELECT DISTINCT bf_id_fiche, bf_titre, bf_date_debut_validite_fiche, bf_description, bn_label_nature, bf_date_creation_fiche '.
|
620 |
$requete = 'SELECT DISTINCT bf_id_fiche, bf_titre, bf_date_debut_validite_fiche, bf_description, bn_label_nature, bf_date_creation_fiche, bf_ce_utilisateur '.
|
621 |
'FROM bazar_fiche, bazar_nature '.$requeteSQLFrom.' WHERE '.$requeteWhereListe;
|
621 |
'FROM bazar_fiche, bazar_nature '.$requeteSQLFrom.' WHERE '.$requeteWhereListe;
|
622 |
if ($valide!=2) {
|
622 |
if ($valide!=2) {
|
623 |
$requete .= 'bf_statut_fiche='.$valide;
|
623 |
$requete .= 'bf_statut_fiche='.$valide;
|
624 |
$req_where=1;
|
624 |
$req_where=1;
|
625 |
}
|
625 |
}
|
Line 733... |
Line 733... |
733 |
$xml .= "\r\n ";
|
733 |
$xml .= "\r\n ";
|
734 |
$xml .= XML_Util::createEndElement ('image');
|
734 |
$xml .= XML_Util::createEndElement ('image');
|
735 |
if ($resultat->numRows() > 0) {
|
735 |
if ($resultat->numRows() > 0) {
|
736 |
// Creation des items : titre + lien + description + date de publication
|
736 |
// Creation des items : titre + lien + description + date de publication
|
737 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
737 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
- |
|
738 |
|
- |
|
739 |
$requetenom = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' FROM '.
|
- |
|
740 |
BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$ligne['bf_ce_utilisateur'];
|
- |
|
741 |
$res = $GLOBALS['_BAZAR_']['db']->query($requetenom) ;
|
- |
|
742 |
if (DB::isError($res)) {
|
- |
|
743 |
die ($res->getMessage().$res->getDebugInfo()) ;
|
- |
|
744 |
}
|
- |
|
745 |
$nomprenom = $res->fetchRow(DB_FETCHMODE_ASSOC);
|
- |
|
746 |
|
738 |
$xml .= "\r\n ";
|
747 |
$xml .= "\r\n ";
|
739 |
$xml .= XML_Util::createStartElement ('item');
|
748 |
$xml .= XML_Util::createStartElement ('item');
|
740 |
$xml .= "\r\n ";
|
749 |
$xml .= "\r\n ";
|
741 |
$xml .= XML_Util::createTag('title', null, encoder_en_utf8($ligne['bf_titre']));
|
750 |
$xml .= XML_Util::createTag('title', null, encoder_en_utf8($ligne['bf_titre']));
|
742 |
$xml .= "\r\n ";
|
751 |
$xml .= "\r\n ";
|
Line 745... |
Line 754... |
745 |
$lien->addQueryString('id_fiche', $ligne['bf_id_fiche']);
|
754 |
$lien->addQueryString('id_fiche', $ligne['bf_id_fiche']);
|
746 |
$xml .= XML_Util::createTag ('link', null, $lien->getURL());
|
755 |
$xml .= XML_Util::createTag ('link', null, $lien->getURL());
|
747 |
$xml .= "\r\n ";
|
756 |
$xml .= "\r\n ";
|
748 |
$xml .= XML_Util::createTag ('guid', null, $lien->getURL());
|
757 |
$xml .= XML_Util::createTag ('guid', null, $lien->getURL());
|
749 |
$xml .= "\r\n ";
|
758 |
$xml .= "\r\n ";
|
- |
|
759 |
$xml .= XML_Util::createTag ('category', null, encoder_en_utf8($ligne['bn_label_nature']));
|
- |
|
760 |
$xml .= "\r\n ";
|
- |
|
761 |
$xml .= XML_Util::createTag ('author', null, encoder_en_utf8($nomprenom[BAZ_CHAMPS_NOM].' '.$nomprenom[BAZ_CHAMPS_PRENOM]));
|
- |
|
762 |
$xml .= "\r\n ";
|
750 |
$xml .= XML_Util::createStartElement ('description');
|
763 |
$xml .= XML_Util::createStartElement ('description');
|
751 |
$xml .= "\r\n ";
|
764 |
$xml .= "\r\n ";
|
752 |
if ($_GET[BAZ_VARIABLE_ACTION] != BAZ_VOIR_TOUTES_ANNONCES) {
|
765 |
if ($_GET[BAZ_VARIABLE_ACTION] != BAZ_VOIR_TOUTES_ANNONCES) {
|
753 |
$xml .= XML_Util::createCDataSection(encoder_en_utf8($ligne['bf_description']));
|
766 |
$xml .= XML_Util::createCDataSection(encoder_en_utf8($ligne['bf_description']));
|
754 |
}
|
767 |
}
|
Line 1226... |
Line 1239... |
1226 |
}
|
1239 |
}
|
Line 1227... |
Line 1240... |
1227 |
|
1240 |
|
1228 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
1241 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
1229 |
*
|
1242 |
*
|
- |
|
1243 |
* $Log: not supported by cvs2svn $
|
- |
|
1244 |
* Revision 1.99.2.13 2008-04-16 12:39:56 alexandre_tb
|
- |
|
1245 |
* simplification du code en utilisant la classe Bazar_element
|
1230 |
* $Log: not supported by cvs2svn $
|
1246 |
*
|
1231 |
* Revision 1.99.2.12 2008-03-17 14:02:53 jp_milcent
|
1247 |
* Revision 1.99.2.12 2008-03-17 14:02:53 jp_milcent
|
1232 |
* Ajout d'un message demandant de s'identifiez pour poser des commentaires.
|
1248 |
* Ajout d'un message demandant de s'identifiez pour poser des commentaires.
|
1233 |
* Amélioration du XHTML (me prévenir en cas de pb).
|
1249 |
* Amélioration du XHTML (me prévenir en cas de pb).
|
1234 |
*
|
1250 |
*
|