Subversion Repositories Applications.bazar

Rev

Rev 381 | Rev 392 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 381 Rev 382
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.105 2008-03-17 11:02:59 jp_milcent Exp $
22
// CVS : $Id: bazar.fonct.rss.php,v 1.106 2008-03-17 14:02:07 jp_milcent 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.105 $
31
*@version       $Revision: 1.106 $
32
// +------------------------------------------------------------------------------------------------------+
32
// +------------------------------------------------------------------------------------------------------+
33
*/
33
*/
Line 34... Line 34...
34
 
34
 
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
Line 457... Line 457...
457
			$requete = 'SELECT * FROM bazar_commentaires WHERE bc_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' ORDER BY bc_date ASC';
457
			$requete = 'SELECT * FROM bazar_commentaires WHERE bc_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' ORDER BY bc_date ASC';
458
			$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
458
			$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
459
			if (DB::isError ($resultat)) {
459
			if (DB::isError ($resultat)) {
460
				return $resultat->getMessage().'<br />'.$resultat->getDebugInfo();
460
				return $resultat->getMessage().'<br />'.$resultat->getDebugInfo();
461
			}
461
			}
462
			if ($resultat->numRows()>0) {
462
			if ($resultat->numRows() > 0) {
-
 
463
				// Titre avec nombre de commentaires
463
				$res .= BAZ_IL_Y_A.$resultat->numRows().' ';
464
				$res .= '<p>'.BAZ_IL_Y_A.$resultat->numRows().' ';
-
 
465
				// Ajout du "s" ou pas
464
				if ($resultat->numRows()==1) $res .= BAZ_COMMENTAIRE.'<br />'."\n";
466
				$res .= ($resultat->numRows() == 1) ? BAZ_COMMENTAIRE : BAZ_COMMENTAIRES;
465
				else $res .= BAZ_COMMENTAIRES.'<br />'."\n";
467
				$res .= '</p>'."\n";
-
 
468
				
-
 
469
				// Info pour ajotuer ces commentaires si on n'est pas identifié
-
 
470
				if (!$GLOBALS['AUTH']->getAuth()) {
-
 
471
					$res .= '<p class="information">'.BAZ_COMMENTAIRE_AUTH.'</p>';
-
 
472
				}
-
 
473
 
-
 
474
				// Affichages des commentaires
466
				while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
475
				while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
467
					$res .= '<div class="BAZ_bulle_corps BAZ_bulle_corps_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
476
					$res .= '<p class="BAZ_bulle_corps BAZ_bulle_corps_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
468
					//affichage du commentaire
477
					//affichage du commentaire
469
					$res .= $ligne['bc_commentaire'].'<br />'."\n";
478
					$res .= $ligne['bc_commentaire'].'<br />'."\n";
470
					$res .= '<div class="BAZ_commentaire_admin">'.BAZ_PAR.' : <strong>'.$ligne['bc_nom'].'</strong>'.BAZ_ECRIT_LE.strftime('%d.%m.%Y %H:%M',strtotime($ligne['bc_date']));
479
					$res .= '<span class="BAZ_commentaire_admin">'.BAZ_PAR.' : <strong>'.$ligne['bc_nom'].'</strong>'.BAZ_ECRIT_LE.strftime('%d.%m.%Y %H:%M',strtotime($ligne['bc_date']));
471
					//pour les identifies seulement, administrateurs de la rubrique ou superadmins
480
					//pour les identifies seulement, administrateurs de la rubrique ou superadmins
472
					if ($est_admin==1) {
481
					if ($est_admin == 1) {
473
						$url_comment= $GLOBALS['_BAZAR_']['url'];
482
						$url_comment= $GLOBALS['_BAZAR_']['url'];
474
						$url_comment->addQueryString('action', BAZ_VOIR_FICHE);
483
						$url_comment->addQueryString('action', BAZ_VOIR_FICHE);
475
						$url_comment->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
484
						$url_comment->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
476
						$url_comment->addQueryString('id_commentaire', $ligne['bc_id_commentaire']);
485
						$url_comment->addQueryString('id_commentaire', $ligne['bc_id_commentaire']);
477
						$res .= '&nbsp;&nbsp;<a href="'.$url_comment->getURL().'">'.BAZ_SUPPRIMER.'</a>'."\n";
486
						$res .= '&nbsp;&nbsp;<a href="'.$url_comment->getURL().'">'.BAZ_SUPPRIMER.'</a>'."\n";
478
					}
487
					}
479
					$res .= '</div>'."\n";
488
					$res .= '</span>'."\n";
480
					$res .= '</div>'."\n";			
489
					$res .= '</p>'."\n";			
481
				}
490
				}
-
 
491
			} else {
-
 
492
				$res .= '<p>'.BAZ_PAS_DE_COMMENTAIRES.'</p>'."\n";
482
			}
493
			}
483
			else $res .= BAZ_PAS_DE_COMMENTAIRES.'<br /><br />'."\n";
-
 
Line 484... Line 494...
484
			
494
			
485
			//formulaire des commentaires
495
			//formulaire des commentaires
486
			if ($GLOBALS['AUTH']->getAuth()) {
496
			if ($GLOBALS['AUTH']->getAuth()) {
487
				$form_commentaire = new HTML_QuickForm('bazar_commentaire', 'post', $url);
497
				$form_commentaire = new HTML_QuickForm('bazar_commentaire', 'post', $url);
Line 802... Line 812...
802
		$xml .= "\r\n          ";
812
		$xml .= "\r\n          ";
803
		$xml .= XML_Util::createTag ('guid', null, utf8_encode(html_entity_decode($GLOBALS['_BAZAR_']['url']->getUrl())));
813
		$xml .= XML_Util::createTag ('guid', null, utf8_encode(html_entity_decode($GLOBALS['_BAZAR_']['url']->getUrl())));
804
		$xml .= "\r\n          ";
814
		$xml .= "\r\n          ";
805
		$xml .= XML_Util::createTag ('description', null, utf8_encode(html_entity_decode(BAZ_PAS_D_ANNONCES)));
815
		$xml .= XML_Util::createTag ('description', null, utf8_encode(html_entity_decode(BAZ_PAS_D_ANNONCES)));
806
		$xml .= "\r\n          ";
816
		$xml .= "\r\n          ";
807
		$xml .= XML_Util::createTag ('pubDate', null, strftime('%a, %d %b %Y %H:%M:%S GMT',strtotime("01/01/%Y")));
817
		$xml .= XML_Util::createTag ('pubDate', null, strftime('%a, %d %b %Y %H:%M:%S GMT', time()));
808
		$xml .= "\r\n      ";
818
		$xml .= "\r\n      ";
809
		$xml .= XML_Util::createEndElement ('item');
819
		$xml .= XML_Util::createEndElement ('item');
810
	}
820
	}
811
	$xml .= "\r\n    ";
821
	$xml .= "\r\n    ";
812
	$xml .= XML_Util::createEndElement ('channel');
822
	$xml .= XML_Util::createEndElement ('channel');
Line 1247... Line 1257...
1247
}
1257
}
Line 1248... Line 1258...
1248
 
1258
 
1249
/* +--Fin du code ----------------------------------------------------------------------------------------+
1259
/* +--Fin du code ----------------------------------------------------------------------------------------+
1250
*
1260
*
-
 
1261
* $Log: not supported by cvs2svn $
-
 
1262
* Revision 1.105  2008-03-17 11:02:59  jp_milcent
-
 
1263
* Ajout de l'authentification nécessaire pour déposer des commentaires.
-
 
1264
* Corrections sur la gestion des paramêtres dans les urls (compatibilité applette Identification et Moteur de Recherche).
1251
* $Log: not supported by cvs2svn $
1265
*
1252
* Revision 1.104  2007-12-14 15:58:39  alexandre_tb
1266
* Revision 1.104  2007-12-14 15:58:39  alexandre_tb
1253
* Fusion avec la livraison AHA : 14 decembre 2007
1267
* Fusion avec la livraison AHA : 14 decembre 2007
1254
*
1268
*
1255
* Revision 1.103  2007-12-10 12:59:34  jp_milcent
1269
* Revision 1.103  2007-12-10 12:59:34  jp_milcent