Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?php/*vim: set expandtab tabstop=4 shiftwidth=4: */// +------------------------------------------------------------------------------------------------------+// | PHP version 4.1 |// +------------------------------------------------------------------------------------------------------+// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |// +------------------------------------------------------------------------------------------------------+// | This file is part of BB-Synthèse. |// | |// | Foobar is free software; you can redistribute it and/or modify |// | it under the terms of the GNU General Public License as published by |// | the Free Software Foundation; either version 2 of the License, or |// | (at your option) any later version. |// | |// | Foobar is distributed in the hope that it will be useful, |// | but WITHOUT ANY WARRANTY; without even the implied warranty of |// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |// | GNU General Public License for more details. |// | |// | You should have received a copy of the GNU General Public License |// | along with Foobar; if not, write to the Free Software |// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |// +------------------------------------------------------------------------------------------------------+// CVS : $Id: bb_synthese.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $/*** Application affichant la liste des synthèses de Tela Botanica.** Fournit la liste des synthèses de Tela Botanica.**@package BiblioBota-Synthese//Auteur original :*@author Jean-Charles GRANGER <tela@vecteur.org>//Autres auteurs :*@author Jean-Pascal MILCENT <jpm@clapas.org>*@copyright Tela-Botanica 2000-2004*@version $Revision: 1.1 $ $Date: 2005-11-23 10:22:25 $// +------------------------------------------------------------------------------------------------------+*/// +------------------------------------------------------------------------------------------------------+// | ENTETE du PROGRAMME |// +------------------------------------------------------------------------------------------------------+/** Inclusion du fichier de configuration de l'application Synthèse. */require_once BB_CHEMIN_APPLI.'bb_synthese/configuration/bbsy_config.inc.php';// Appel du fichier de traduction des textes de l'application Synthèse de Biblio Botaif (file_exists(BBSY_CHEMIN_LANGUES.'bbsy_langue_'.BB_URL_I18N.'.inc.php')) {/** Inclusion du fichier de traduction de l'application Synthèse. */include_once BBSY_CHEMIN_LANGUES.'bbsy_langue_'.BB_URL_I18N.'.inc.php';} else {/** Inclusion du fichier de traduction fr par défaut. */include_once BBSY_CHEMIN_LANGUES.'bbsy_langue_fr.inc.php';}// +------------------------------------------------------------------------------------------------------+// Initialisation des variablesglobal $TransTab, $tbl;$ret = '';$ret .= '<!-- BiblioBota - Synthèse : DEBUT -->'."\n";// +------------------------------------------------------------------------------------------------------+// | CORPS du PROGRAMME |// +------------------------------------------------------------------------------------------------------+if ((isset($TransTab)) && ($TransTab != '')) {$tableau = FRAG_decoupageChaine($TransTab);}if (empty($tableau['pstart'])) {$tableau['pstart'] = 0;}// Début de l'applicatif$ret .= '<h1>'.BBSY_LG_PAGE_TITRE.'</h1>'."\n";$ret .= '<h2>'.BBSY_LG_PRESENTATION_TITRE.'</h2>'."\n";$ret .= '<p>'.BBSY_LG_PARA_01.'</p>'."\n";$ret .= '<p>'.BBSY_LG_PARA_02.'</p>'."\n";$ret .= '<h2>'.BBSY_LG_PARA_03.'</h2>'."\n";$ret .= '<h3>'.'<img src="'.BBSY_IMG_SYNTHESE.'" alt="'.BBSY_LG_SYNTH_IMG_ALT.'" /> '.BBSY_LG_SYNTH_NIV_01_TITRE.'</h3>'."\n";$ret .= '<p>'.BBSY_LG_SYNTH_NIV_01_INFO.'</p>'."\n";$ret .= '<h3>'.str_repeat('<img src="'.BBSY_IMG_SYNTHESE.'" alt="'.BBSY_LG_SYNTH_IMG_ALT.'" /> ', 2).BBSY_LG_SYNTH_NIV_02_TITRE.'</h3>'."\n";$ret .= '<p>'.BBSY_LG_SYNTH_NIV_02_INFO.'</p>'."\n";$ret .= '<h3>'.str_repeat('<img src="'.BBSY_IMG_SYNTHESE.'" alt="'.BBSY_LG_SYNTH_IMG_ALT.'" /> ', 3).BBSY_LG_SYNTH_NIV_03_TITRE.'</h3>'."\n";$ret .= '<p>'.BBSY_LG_SYNTH_NIV_03_INFO.'</p>'."\n";// (1) récupération des chaines id des synthèses$seeker = '';foreach ($var_biblio['seek_string'] as $key => $values) {if ($key != 0) {$seeker .= ' OR ';}$seeker .= ' B_A_CRAICOLL = "'.$values.'" ';}// (2) comptage du nombre de synthèses$requete = 'SELECT COUNT(*) AS comptage '.'FROM '.$tbl['article'].', '.$tbl['item'].' '.'WHERE '.$seeker.' '.'AND B_I_CACHER = 0 '.'AND B_I_IDITEM = B_A_IDART';$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));$tmp_nb = mysql_fetch_object($resultat);$nb = $tmp_nb->comptage;mysql_free_result($resultat);// Affichage du nombre de synthèses requisif ($nb == 0) {$ret .= '<p>'.'Pas de synthèses référencées.'.'</p>'."\n";}$requete = 'SELECT '.$tbl['article'].'.*, '.$tbl['item'].'.*, '.$tbl['item_typlog'].'.B_IL_LABEL, '.$tbl['item_typphy'].'.B_IP_LABEL '.'FROM '.$tbl['article'].', '.$tbl['item'].', '.$tbl['item_typlog'].', '.$tbl['item_typphy'].' '.'WHERE '.$seeker.' '.'AND B_I_CACHER = 0 '.'AND B_I_TYPLOG = B_IL_ID '.'AND B_I_TYPPHY = B_IP_ID '.'AND B_I_IDITEM = B_A_IDART '.'ORDER BY B_I_REM DESC '.'LIMIT '.$tableau['pstart'].', '.$var_biblio['how_bloc'];$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));$nb_s = mysql_num_rows($resultat);if (empty($tableau['pend'])) {$tableau['pend'] = $nb;}if (empty($tableau['pstep'])) {$tableau['step'] = $var_biblio['how_bloc'];}// Informations sur le nombre de synthèse.$ret .= '<p id="frag_nbre_resultat">'.FRAG_afficherTxtNbreResultat('synth', $tableau, $nb_s, $nb).'</p>'."\n";// Ici on fragmente en pages, pour une navigation plus facile$frag = new fragmenteur();$frag_txt = $frag->fragmente($tableau, $nb);if (($frag->nb_pages) > 1) {$ret .= '<p class="frag_navigation">'.$frag_txt.'</p>'."\n";}// Fin fragmentation// Affichage des résultats// 1- listing des synthèses// 2- dedans : listing des voir aussi$n = 1;$ret .= '<ul>'."\n";while ($ligne = mysql_fetch_object($resultat)) {$id_a = $ligne->B_A_IDART;$titre = $ligne->B_I_TITRE;$auteurs = $ligne->B_I_AUTEURS;$geo = $ligne->B_I_GEO;$langue = $ligne->B_I_LANGUE;$resum = $ligne->B_I_RESUMCLE;$image = $ligne->B_I_IMAGE;$comment = $ligne->B_I_COMMENT;$rem = $ligne->B_I_REM;$exp_rem = explode('+', $rem);$ret .= '<li>'."\n";if ($image != '') {$ret .= '<img src="'.BB_CHEMIN_IMAGES.$image.'" alt="" />';}// Récupération des données spécifiques stockées dans le champ REM// $exp_rem[0] : date aaaa.mm.jj// $exp_rem[1] : niveau de synthèse// $exp_rem[++] : adresses mails des auteurs// $exp_rem[2] : 1er auteur// $exp_rem[3] : 2ème auteur etc. ...if ($exp_rem[1] == '') {$exp_rem[1] = 0;}switch ($exp_rem[1]) {case 0 :$alt = BBSY_LG_SYNTH_NIV_00_TITRE;break;case 1 :$alt = BBSY_LG_SYNTH_NIV_01_TITRE;break;case 2 :$alt = BBSY_LG_SYNTH_NIV_02_TITRE;break;case 3 :$alt = BBSY_LG_SYNTH_NIV_03_TITRE;break;}$ret .= str_repeat('<img class="'.BBSY_CLASS_IMG_SYNTHESE.'" src="'.BBSY_IMG_SYNTHESE.'" alt="'.BBSY_LG_SYNTH_IMG_ALT.'" /> ', $exp_rem[1]);// Désactivation des de ma mise en tag des mails des auteurs./*// comptage du nombre d'auteurs$exp_auteurs = explode (", ",$auteurs);$tmp_count = count($exp_auteurs);// affichage des auteurs et de leur mail s'il est précisé$ct = 0; // variable de controle du nom de l'auteur$tc = 2; // variable de controle du mail de l'auteur (début du listing des auteurs)while ($ct <= $tmp_count) {if ($exp_rem[$tc] != '') {$ret .= "<zup href=\"mailto:$exp_rem[$tc]?subject=Synthèse $titre\">$exp_auteurs[$ct]</zup>";} else {$ret .= "$exp_auteurs[$ct]";}if ($ct < $tmp_count-1) {$ret .= ", ";}$ct++;$tc++;}*/$ret .= $auteurs;$ret .= ' - '.'<b>'.$titre.'</b>';if ($exp_rem[0] > 0) {$ret .= ' - '.FormateDateYYYYMMJJ($exp_rem[0]);}if ($resum != '') {$ret .= ' - '.'<i>'.$resum.'</i>';}if ($comment != '') {$ret .= ' - '.'<i>'.$comment.'</i>';}if ($geo != '') {$ret .= ' - '.'Départ./Région : '.'<i>'.$geo.'</i>';}if ($langue != '') {$ret .= ' - '.$langue;}// Recherche des liens vers la synthèse// Là on affiche les Voir Aussi Fascicules ... si y'en a$UnVoirAussi = new VoirAussi($id_a, $tbl['article']);if ($UnVoirAussi->NbVA > 0) {$liste_va = $UnVoirAussi->ListerVoirAussi();$ret .= ' - '.'Consulter : ';for ($i = 0; $i == (($UnVoirAussi->NbVA) - 1); $i++) {$ret .= '<img class="'.BB_CLASS_IMG_ICONE.'" src="'.$liste_va[$i]['icon_src'].'" alt="'.$liste_va[$i]['icon_alt'].'" /> ';$ret .= '<a '.$liste_va[$i]['target'].'>'.$liste_va[$i]['texte'].'</a>';if ($liste_va[$i]['desc'] != '') {$ret .= ' - '.'<i>'.$liste_va[$i]['desc'].'</i>';}}}// fin des Voir Aussi Fasciculeif ($n < $nb_s) {$ret .= '<br /><br />';}$ret .= "\n\n";$n++;$ret .= '</li>'."\n";}$ret .= '</ul>'."\n";mysql_free_result($resultat);// +------------------------------------------------------------------------------------------------------+// | PIED du PROGRAMME |// +------------------------------------------------------------------------------------------------------+$ret .= '<!-- BiblioBota - Synthèse : FIN -->'."\n";$sortie = $ret;/* +--Fin du code ----------------------------------------------------------------------------------------+** $Log: not supported by cvs2svn $* Revision 1.3 2005/04/25 13:58:15 jpm* Résolution de problèmes liés à la base de données et simplification de l'affichage des images représentant le niveau des synthèses.** Revision 1.2 2005/03/01 15:18:48 jpm* Ajout de commentaire html de début et fin d'appli.** Revision 1.1 2005/02/24 18:34:41 jpm* Ajout de l'application synthèse.*** +-- Fin du code ----------------------------------------------------------------------------------------+*/?>