Subversion Repositories Applications.bazar

Compare Revisions

Ignore whitespace Rev 345 → Rev 346

/trunk/bibliotheque/bazar.fonct.php
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.php,v 1.74 2007-10-25 09:41:31 alexandre_tb Exp $
// CVS : $Id: bazar.fonct.php,v 1.75 2007-12-04 09:07:21 alexandre_tb Exp $
/**
*
* Fonctions du module bazar
31,7 → 31,7
*@author Florian Schmitt <florian@ecole-et-nature.org>
//Autres auteurs :
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.74 $ $Date: 2007-10-25 09:41:31 $
*@version $Revision: 1.75 $ $Date: 2007-12-04 09:07:21 $
// +------------------------------------------------------------------------------------------------------+
*/
 
1222,73 → 1222,74
}
if ($GLOBALS['AUTH']->getAuth()) {
$res .= '<p id="laius_abonnement">'.BAZ_LAIUS_S_ABONNER.'</p>'."\n";
//requete pour obtenir l'id et le label des types d'annonces
$requete = 'SELECT bn_id_nature, bn_label_nature, bn_image_titre '.
'FROM bazar_nature WHERE 1'; /*bn_ce_id_menu='.$GLOBALS['_BAZAR_']['categorie_nature'];*/
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
if (DB::isError($resultat)) {
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
}
$table = new HTML_Table(array ('width' => '100%', 'class' => 'table_bazar'));
$table->addRow(array(BAZ_TYPE_ANNONCES, BAZ_STATUT, BAZ_PASSER_EN, BAZ_RSS));
$table->setRowType(0, 'th');
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
$tab_parametres_GET = explode ("&", $_SERVER["argv"][0]) ;
foreach ($tab_parametres_GET as $cle_param => $valeur_param) {
$tab_valeur = explode ('=', $valeur_param) ;
$GLOBALS['_BAZAR_']['url']->addQueryString($tab_valeur[0], $tab_valeur[1]);
$res .= '<p id="laius_abonnement">'.BAZ_LAIUS_S_ABONNER.'</p>'."\n";
//requete pour obtenir l'id et le label des types d'annonces
$requete = 'SELECT bn_id_nature, bn_label_nature, bn_image_titre '.
'FROM bazar_nature WHERE 1'; /*bn_ce_id_menu='.$GLOBALS['_BAZAR_']['categorie_nature'];*/
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
if (DB::isError($resultat)) {
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
}
$lien_s_abonner=$GLOBALS['_BAZAR_']['url'];
$lien_s_abonner->addQueryString('action', BAZ_S_INSCRIRE);
$lien_s_abonner->addQueryString('idtypeannonce', $ligne['bn_id_nature']);
$lien_s_abonner->addQueryString('inscrip', 1);
$lien_se_desabonner=$GLOBALS['_BAZAR_']['url'];
$lien_se_desabonner->addQueryString('action', BAZ_S_INSCRIRE);
$lien_se_desabonner->addQueryString('idtypeannonce', $ligne['bn_id_nature']);
$lien_se_desabonner->addQueryString('inscrip', 0);
// Nettoyage de l url
$GLOBALS['_BAZAR_']['url']->removeQueryString(BAZ_VARIABLE_VOIR);
$lien_RSS=$GLOBALS['_BAZAR_']['url'];
$lien_RSS->addQueryString('action', BAZ_VOIR_FLUX_RSS);
$table = new HTML_Table(array ('width' => '100%', 'class' => 'table_bazar'));
$table->addRow(array(BAZ_TYPE_ANNONCES,/* BAZ_STATUT, BAZ_PASSER_EN, */ BAZ_RSS));
$table->setRowType(0, 'th');
//requete pour savoir si la personne est inscrite a ce type d'annonce
$requete = 'SELECT ba_id_utilisateur '.
'FROM bazar_abonnement '.
'WHERE ba_id_utilisateur='.$GLOBALS['id_user'].' AND ba_id_rubrique='.$ligne['bn_id_nature'];
$resultat2 = $GLOBALS['_BAZAR_']['db']->query($requete) ;
if (DB::isError($resultat2)) {
die ($resultat2->getMessage().$resultat2->getDebugInfo()) ;
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
/*
$tab_parametres_GET = explode ("&", $_SERVER["argv"][0]) ;
foreach ($tab_parametres_GET as $cle_param => $valeur_param) {
$tab_valeur = explode ('=', $valeur_param) ;
$GLOBALS['_BAZAR_']['url']->addQueryString($tab_valeur[0], $tab_valeur[1]);
}
*/
$lien_s_abonner=$GLOBALS['_BAZAR_']['url'];
$lien_s_abonner->addQueryString('action', BAZ_S_INSCRIRE);
$lien_s_abonner->addQueryString('annonce', $ligne['bn_id_nature']);
$lien_s_abonner->addQueryString('inscrip', 1);
$lien_se_desabonner=$GLOBALS['_BAZAR_']['url'];
$lien_se_desabonner->addQueryString('action', BAZ_S_INSCRIRE);
$lien_se_desabonner->addQueryString('annonce', $ligne['bn_id_nature']);
$lien_se_desabonner->addQueryString('inscrip', 0);
$lien_RSS=$GLOBALS['_BAZAR_']['url'];
$lien_RSS->addQueryString('action', BAZ_VOIR_FLUX_RSS);
//requete pour savoir si la personne est inscrite a ce type d'annonce
$requete = 'SELECT ba_id_utilisateur '.
'FROM bazar_abonnement '.
'WHERE ba_id_utilisateur='.$GLOBALS['id_user'].' AND ba_id_rubrique='.$ligne['bn_id_nature'];
$resultat2 = $GLOBALS['_BAZAR_']['db']->query($requete) ;
if (DB::isError($resultat2)) {
die ($resultat2->getMessage().$resultat2->getDebugInfo()) ;
}
if (isset($ligne['bn_image_titre'])) {$titre='&nbsp;<img src="client/bazar/images/'.$ligne['bn_image_titre'].'" alt="'.$ligne['bn_label_nature'].'" />'."\n";}
else {$titre='<strong>&nbsp;'.$ligne['bn_label_nature'].'</strong>'."\n";}
if ($resultat2->numRows()>0) {
//$lien_RSS->addQueryString('annonce', $ligne['bn_id_nature']);
$table->addRow(array($titre,
/* BAZ_ABONNE,
'<a href='.$lien_se_desabonner->getURL().'>'.BAZ_SE_DESABONNER.'</a>', */
'<a href="'.$lien_RSS->getURL().'"><img src="client/bazar/images/BAZ_rss.png" alt="'.BAZ_RSS.'"></a>'));
$lien_RSS->removeQueryString('annonce');
}
else {
$lien_RSS->removeQueryString('inscrip');
$table->addRow(array($titre,
/* BAZ_PAS_ABONNE,
'<a href='.$lien_s_abonner->getURL().'>'.BAZ_S_ABONNER.'</a>', */
'<a href="'.$lien_RSS->getURL().'"><img src="client/bazar/images/BAZ_rss.png" alt="'.BAZ_RSS.'" /></a>'));
}
}
if (isset($ligne['bn_image_titre'])) {$titre='&nbsp;<img src="client/bazar/images/'.$ligne['bn_image_titre'].'" alt="'.$ligne['bn_label_nature'].'" />'."\n";}
else {$titre='<strong>&nbsp;'.$ligne['bn_label_nature'].'</strong>'."\n";}
if ($resultat2->numRows()>0) {
$lien_RSS->addQueryString('annonce', $ligne['bn_id_nature']);
$table->addRow(array($titre,
BAZ_ABONNE,
'<a href='.$lien_se_desabonner->getURL().'>'.BAZ_SE_DESABONNER.'</a>',
'<a href='.$lien_RSS->getURL().'><img src="client/bazar/images/BAZ_rss.png" alt="'.BAZ_RSS.'"></a>'));
$lien_RSS->removeQueryString('annonce');
}
else {
$lien_RSS->addQueryString('annonce', $ligne['bn_id_nature']);
$table->addRow(array($titre,
BAZ_PAS_ABONNE,
'<a href='.$lien_s_abonner->getURL().'>'.BAZ_S_ABONNER.'</a>',
'<a href='.$lien_RSS->getURL().'><img src="client/bazar/images/BAZ_rss.png" alt="'.BAZ_RSS.'" /></a>'));
$lien_RSS->removeQueryString('annonce');
}
$table->altRowAttributes(1, array('class' => 'ligne_impaire'), array('class' => 'ligne_paire'));
$table->updateColAttributes(0, array('class' => 'col1'));
$table->updateColAttributes(1, array('class' => 'col2'));
$res.=$table->toHTML() ;
}
$table->altRowAttributes(1, array('class' => 'ligne_impaire'), array('class' => 'ligne_paire'));
$table->updateColAttributes(0, array('id' => 'col1'));
$table->updateColAttributes(1, array('id' => 'col2'));
$table->updateColAttributes(2, array('id' => 'col3'));
$table->updateColAttributes(3, array('id' => 'col4'));
$res.=$table->toHTML() ;
}
else {
$res .= '<p class="zone_info">'.BAZ_IDENTIFIEZ_VOUS_POUR_SAISIR.'</p>'."\n" ;
$res .= '<form id="form_connexion" style="clear:both;" class="form_identification" action="' ;
1398,6 → 1399,9
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.74 2007-10-25 09:41:31 alexandre_tb
* mise en place de variable de session pour eviter que les formulaires soit valider 2 fois, pour les url, fichiers et image
*
* Revision 1.73 2007-10-24 13:27:00 alexandre_tb
* bug : double saisie d url
* suppression de warning sur variable