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.107 2008-09-17 14:08:45 alexandre_tb Exp $ |
// CVS : $Id: bazar.fonct.rss.php,v 1.108 2008-10-29 14:44:52 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.107 $ |
*@version $Revision: 1.108 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
197,7 → 197,7 |
} |
//affiche le texte sinon |
else { |
$res .= '<h2 class="BAZ_titre BAZ_titre_'.$GLOBALS['_BAZAR_']['class'].'">'.$ligne['bn_label_nature'].'</h2>'."\n"; |
//$res .= '<h2 class="BAZ_titre BAZ_titre_'.$GLOBALS['_BAZAR_']['class'].'">'.$ligne['bn_label_nature'].'</h2>'."\n"; |
} |
$GLOBALS['_BAZAR_']['annonceur'] = $ligne['bf_ce_utilisateur'] ; |
//si le template existe, on genere le template |
208,7 → 208,7 |
//on affiche ligne par ligne sinon |
else { |
// Le titre |
$res .= '<h1 class="BAZ_fiche_titre BAZ_fiche_titre_'.$GLOBALS['_BAZAR_']['class'].'">'.$ligne['bf_titre'].'</h1>'."\n"; |
//$res .= '<h1 class="BAZ_fiche_titre BAZ_fiche_titre_'.$GLOBALS['_BAZAR_']['class'].'">'.$ligne['bf_titre'].'</h1>'."\n"; |
// cas d'une image personalisee |
if (isset($ligne['bf_url_image'])) { |
$res .= '<div class="BAZ_fiche_image BAZ_fiche_image_'.$GLOBALS['_BAZAR_']['class'].'">'."\n"; |
222,7 → 222,7 |
$res .= '</div>'."\n"; |
} |
|
$res .= '<div class="BAZ_description BAZ_description_'.$GLOBALS['_BAZAR_']['class'].'">'.nl2br($ligne['bf_description']).'</div>'."\n"; |
//$res .= '<div class="BAZ_description BAZ_description_'.$GLOBALS['_BAZAR_']['class'].'">'.nl2br($ligne['bf_description']).'</div>'."\n"; |
$tableau=baz_valeurs_template($GLOBALS['_BAZAR_']['template']); |
|
/** Boucle d affichage des resultats |
620,8 → 620,10 |
function gen_RSS($typeannonce='', $nbitem='', $emetteur='', $valide=1, $requeteSQL='', $requeteSQLFrom = '', $requeteWhereListe = '', $categorie_nature='', $order = '') { |
// generation de la requete MySQL personnalisee |
$req_where=0; |
$requete = 'SELECT DISTINCT bf_id_fiche, bf_titre, bf_date_debut_validite_fiche, bf_description, bn_label_nature, bf_date_creation_fiche '. |
'FROM bazar_fiche, bazar_nature '.$requeteSQLFrom.' WHERE '.$requeteWhereListe; |
$requete = 'SELECT DISTINCT bf_id_fiche, bf_titre, bf_date_debut_validite_fiche, bf_description, bn_label_nature, '. |
'bf_date_creation_fiche, bf_date_debut_evenement, '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM. |
' FROM bazar_fiche, bazar_nature, '.BAZ_ANNUAIRE.' '.$requeteSQLFrom.' WHERE bf_ce_utilisateur='.BAZ_CHAMPS_ID.' and ' |
.$requeteWhereListe; |
if ($valide!=2) { |
$requete .= 'bf_statut_fiche='.$valide; |
$req_where=1; |
653,11 → 655,20 |
if ($req_where==1) { |
$requete .= ' AND '; |
} |
|
if (isset($_POST['date_debut']) && $_POST['date_debut'] != '') { |
|
$requete = '((bf_date_debut_evenement <= "'.date('Y-m-d', strtotime($_POST['date_fin'])).'" and bf_date_debut_evenement >="'.date('Y-m-d', strtotime($_POST['date_debut'])).'" )' . |
' or (bf_date_fin_evenement >="'.date('Y-m-d', strtotime($_POST['date_debut'])).'" and bf_date_fin_evenement <="'.date('Y-m-d', strtotime($_POST['date_fin'])).'")' . |
' or bf_date_debut_evenement <= "'.date('Y-m-d', strtotime($_POST['date_debut'])).'" and bf_date_fin_evenement >= "'.date('Y-m-d', strtotime($_POST['date_fin'])).'") '; |
} else { |
$requete .= '(bf_date_debut_validite_fiche<=NOW() or bf_date_debut_validite_fiche="0000-00-00")'. |
' AND (bf_date_fin_validite_fiche>=NOW() or bf_date_fin_validite_fiche="0000-00-00") AND bn_id_nature=bf_ce_nature'; |
} |
} |
} |
else $nomflux .= BAZ_A_MODERER; |
$requete .= ' and bf_date_debut_evenement > NOW() '; |
if ($emetteur!='' && $emetteur!='tous') { |
if ($req_where==1) {$requete .= ' AND ';} |
$requete .= 'bf_ce_utilisateur='.$emetteur; |
685,7 → 696,7 |
|
$requete .= ' ORDER BY bf_date_creation_fiche DESC, bf_date_fin_validite_fiche DESC, bf_date_maj_fiche DESC'; |
if ($nbitem!='') {$requete .= ' LIMIT 0,'.$nbitem;} |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;//mail ('alexandre@tela-botanica.org', 'bazar', $requete); |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().$resultat->getDebugInfo()) ; |
} |
750,6 → 761,10 |
$xml .= "\r\n "; |
$xml .= XML_Util::createTag ('guid', null, $lien->getURL()); |
$xml .= "\r\n "; |
$xml .= XML_Util::createTag ('category', null, encoder_en_utf8($ligne['bn_label_nature'])); |
$xml .= "\r\n "; |
$xml .= XML_Util::createTag ('author', null, encoder_en_utf8($ligne['U_NAME'].' '.$ligne['U_SURNAME'])); |
$xml .= "\r\n "; |
$xml .= XML_Util::createStartElement ('description'); |
$xml .= "\r\n "; |
if ($_GET[BAZ_VARIABLE_ACTION] != BAZ_VOIR_TOUTES_ANNONCES) { |
760,9 → 775,9 |
$xml .= "\r\n "; |
if ($ligne['bf_date_debut_validite_fiche'] != '0000-00-00' && |
$ligne['bf_date_debut_validite_fiche']>$ligne['bf_date_creation_fiche']) { |
$date_pub = $ligne['bf_date_debut_validite_fiche']; |
} else $date_pub = $ligne['bf_date_creation_fiche'] ; |
$xml .= XML_Util::createTag ('pubDate', null, strftime('%a, %d %b %Y %H:%M:%S GMT',strtotime($date_pub))); |
$date_pub = strftime('%a, %d %b %Y %H:%M:%S +0200',strtotime($ligne['bf_date_debut_validite_fiche'])); |
} else $date_pub = strftime('%a, %d %b %Y %H:%M:%S +0200',strtotime($ligne['bf_date_debut_evenement'])) ; |
$xml .= XML_Util::createTag ('pubDate', null, $date_pub); |
$xml .= "\r\n "; |
$xml .= XML_Util::createEndElement ('item'); |
} |
944,7 → 959,14 |
$tableau[$i]['type']($formtemplate, $tableau[$i]['nom_bdd'], $tableau[$i]['label'], $tableau[$i]['limite1'], |
$tableau[$i]['limite2'], $tableau[$i]['defaut'], $tableau[$i]['table_source'], $tableau[$i]['obligatoire'], 1, 'bazar') ; |
} |
if ($tableau[$i]['type'] == 'listedatedeb' && $tableau[$i]['recherche'] == 1) { |
GEN_stockerFichierScript('jquery', 'http://code.jquery.com/jquery-latest.js'); |
GEN_stockerFichierScript('jquery_date_picker', 'api/js/jquery/ui.datepicker.js'); |
GEN_stockerFichierScript('jquery_date_picker_fr', 'api/js/jquery/ui.datepicker-fr.js'); |
GEN_stockerStyleExterne( 'jquery_date_picker_style', 'api/js/jquery/ui.datepicker.css'); |
$formtemplate->addElement('html', '<tr><td>Plage de dates: </td><td>'.bazar::getFiltrePlageDeDate().'</td></tr>'); |
} |
} |
|
} |
else { |
1114,7 → 1136,7 |
// generation de la requete MySQL personnalisee |
$req_where=0; |
$requete = 'SELECT * '. |
'FROM bazar_fiche, bazar_nature '.$requeteFrom.' WHERE '.$requeteWhere; |
'FROM bazar_fiche, bazar_nature, '.BAZ_ANNUAIRE.' '.$requeteFrom.' WHERE '.$requeteWhere; |
if ($valide!=2) { |
if ($req_where==1) {$requete .= ' AND ';} |
$req_where=1; |
1127,12 → 1149,18 |
if ($valide!=0) { |
if ($utilisateur->isSuperAdmin()) { |
$req_where=1; |
} |
if ($req_where==1) {$requete .= ' AND ';} |
if (isset($_POST['date_debut']) && $_POST['date_debut'] != '') { |
$requete .= '((bf_date_debut_evenement <= "'.date('Y-m-d', strtotime($_POST['date_fin'])).'" and bf_date_debut_evenement >="'.date('Y-m-d', strtotime($_POST['date_debut'])).'" )' . |
' or (bf_date_fin_evenement >="'.date('Y-m-d', strtotime($_POST['date_debut'])).'" and bf_date_fin_evenement <="'.date('Y-m-d', strtotime($_POST['date_fin'])).'")' . |
' or bf_date_debut_evenement <= "'.date('Y-m-d', strtotime($_POST['date_debut'])).'" and bf_date_fin_evenement >= "'.date('Y-m-d', strtotime($_POST['date_fin'])).'") '; |
} else { |
if ($req_where==1) {$requete .= ' AND ';} |
$requete .= '(bf_date_debut_validite_fiche<=NOW() or bf_date_debut_validite_fiche="0000-00-00")'. |
' AND (bf_date_fin_validite_fiche>=NOW() or bf_date_fin_validite_fiche="0000-00-00") AND bn_id_nature=bf_ce_nature'; |
$req_where=1; |
} |
|
} |
if ($emetteur!='' && $emetteur!='tous') { |
if ($req_where==1) {$requete .= ' AND ';} |
1144,6 → 1172,7 |
$requete .= '('.$requeteSQL.')'; |
$req_where=1; |
} |
$requete .= ' and bf_ce_utilisateur='.BAZ_CHAMPS_ID; |
$requete .= ' ORDER BY bf_date_debut_validite_fiche DESC, bf_date_fin_validite_fiche DESC, bf_date_maj_fiche DESC'; |
if ($nbitem!='') {$requete .= ' LIMIT 0,'.$nbitem;} |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ; |
1232,6 → 1261,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.107 2008-09-17 14:08:45 alexandre_tb |
* merge depuis aha |
* |
* Revision 1.106 2008-03-17 14:02:07 jp_milcent |
* Ajout d'un message demandant de s'identifiez pour poser des commentaires. |
* Amélioration du XHTML (me prévenir en cas de pb). |