Subversion Repositories eFlore/Applications.bibliobota

Rev

Rev 2 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 30
1
<?php
1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
3
// +------------------------------------------------------------------------------------------------------+
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
8
// | This file is part of BiblioBota - Lien Favoris.                                                      |
8
// | This file is part of BiblioBota - Lien Favoris.                                                      |
9
// |                                                                                                      |
9
// |                                                                                                      |
10
// | Foobar is free software; you can redistribute it and/or modify                                       |
10
// | Foobar is free software; you can redistribute it and/or modify                                       |
11
// | it under the terms of the GNU General Public License as published by                                 |
11
// | it under the terms of the GNU General Public License as published by                                 |
12
// | the Free Software Foundation; either version 2 of the License, or                                    |
12
// | the Free Software Foundation; either version 2 of the License, or                                    |
13
// | (at your option) any later version.                                                                  |
13
// | (at your option) any later version.                                                                  |
14
// |                                                                                                      |
14
// |                                                                                                      |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
18
// | GNU General Public License for more details.                                                         |
18
// | GNU General Public License for more details.                                                         |
19
// |                                                                                                      |
19
// |                                                                                                      |
20
// | You should have received a copy of the GNU General Public License                                    |
20
// | You should have received a copy of the GNU General Public License                                    |
21
// | along with Foobar; if not, write to the Free Software                                                |
21
// | along with Foobar; if not, write to the Free Software                                                |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
23
// +------------------------------------------------------------------------------------------------------+
23
// +------------------------------------------------------------------------------------------------------+
24
// CVS : $Id: bb_lien_favoris.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
24
// CVS : $Id: bb_lien_favoris.php,v 1.1 2005/02/28 14:23:51 jpm Exp $
25
/**
25
/**
26
* Application affichant des listes des sites web
26
* Application affichant des listes des sites web
27
*
27
*
28
* Fournit la liste des sites web favoris de Tela Botanica.
28
* Fournit la liste des sites web favoris de Tela Botanica.
29
* Il est possible d'afficher une liste de sites web :
29
* Il est possible d'afficher une liste de sites web :
30
* - partenaires
30
* - partenaires
31
* - références
31
* - références
32
*
32
*
33
*@package BiblioBota-LienFavoris
33
*@package BiblioBota-LienFavoris
34
//Auteur original :
34
//Auteur original :
35
*@author        Jean-Charles GRANGER <tela@vecteur.org>
35
*@author        Jean-Charles GRANGER <tela@vecteur.org>
36
//Autres auteurs :
36
//Autres auteurs :
37
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
37
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
38
*@copyright     Tela-Botanica 2000-2004
38
*@copyright     Tela-Botanica 2000-2004
39
*@version       $Revision: 1.1 $ $Date: 2005-11-23 10:22:25 $
39
*@version       $Revision: 1.1 $ $Date: 2005/02/28 14:23:51 $
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
41
*/
41
*/
42
 
42
 
43
// +------------------------------------------------------------------------------------------------------+
43
// +------------------------------------------------------------------------------------------------------+
44
// |                                            ENTETE du PROGRAMME                                       |
44
// |                                            ENTETE du PROGRAMME                                       |
45
// +------------------------------------------------------------------------------------------------------+
45
// +------------------------------------------------------------------------------------------------------+
46
/** Inclusion du fichier de configuration de l'application Lien Favoris. */
46
/** Inclusion du fichier de configuration de l'application Lien Favoris. */
47
require_once BB_CHEMIN_APPLI.'bb_lien_favoris/configuration/bblf_config.inc.php';
47
require_once BB_CHEMIN_APPLI.'bb_lien_favoris/configuration/bblf_config.inc.php';
48
 
48
 
49
// Appel du fichier de traduction des textes de l'application Lien Favoris   de Biblio Bota
49
// Appel du fichier de traduction des textes de l'application Lien Favoris   de Biblio Bota
50
if (file_exists(BBLF_CHEMIN_LANGUES.'bblf_langue_'.BB_URL_I18N.'.inc.php')) {
50
if (file_exists(BBLF_CHEMIN_LANGUES.'bblf_langue_'.BB_URL_I18N.'.inc.php')) {
51
    /** Inclusion du fichier de traduction de l'application Lien Favoris. */
51
    /** Inclusion du fichier de traduction de l'application Lien Favoris. */
52
    include_once BBLF_CHEMIN_LANGUES.'bblf_langue_'.BB_URL_I18N.'.inc.php';
52
    include_once BBLF_CHEMIN_LANGUES.'bblf_langue_'.BB_URL_I18N.'.inc.php';
53
} else {
53
} else {
54
    /** Inclusion du fichier de traduction fr par défaut. */
54
    /** Inclusion du fichier de traduction fr par défaut. */
55
    include_once BBLF_CHEMIN_LANGUES.'bblf_langue_fr.inc.php';
55
    include_once BBLF_CHEMIN_LANGUES.'bblf_langue_fr.inc.php';
56
}
56
}
57
 
-
 
58
// Initialisation de la variable à retourner
-
 
59
$var_to_ret = '';
-
 
60
$var_to_ret .= '<!-- BiblioBota - Partenaire : DEBUT -->'."\n";
-
 
61
 
57
 
62
// +------------------------------------------------------------------------------------------------------+
58
// +------------------------------------------------------------------------------------------------------+
63
// |                                            CORPS du PROGRAMME                                        |
59
// |                                            CORPS du PROGRAMME                                        |
64
// +------------------------------------------------------------------------------------------------------+
60
// +------------------------------------------------------------------------------------------------------+
65
global $GS_GLOBAL, $TransTab;
61
global $GS_GLOBAL;
-
 
62
 
-
 
63
global $TransTab;
66
 
64
 
67
if ((isset($TransTab)) && ($TransTab != '')) {
65
if ((isset($TransTab)) && ($TransTab != '')) {
68
    $tableau = FRAG_decoupageChaine($TransTab);
66
    $tableau = FRAG_decoupageChaine($TransTab);
69
}
67
}
70
if (empty($tableau['pstart'])) {
68
if (empty($tableau['pstart'])) {
71
    $tableau['pstart'] = 0;
69
    $tableau['pstart'] = 0;
72
}
70
}
73
if (empty($tableau['step'])) {
71
if (empty($tableau['step'])) {
74
    $tableau['step'] = $how_bloc;
72
    $tableau['step'] = $how_bloc;
75
}
73
}
76
$tableau['libelle'] = 'lien';
74
$tableau['libelle'] = 'lien';
77
$tableau['feminin'] = 0;
75
$tableau['feminin'] = 0;
78
 
76
 
79
// Récupèration des arguments de l'application pour la page donnée
77
// Récupèration des arguments de l'application pour la page donnée
80
$tableau['selecteur'] = $GLOBALS['_GEN_commun']['info_application']->selecteur;
78
$tableau['selecteur'] = $GLOBALS['_GEN_commun']['info_application']->selecteur;
81
 
79
 
82
// +------------------------------------------------------------------------------------------------------+
80
// +------------------------------------------------------------------------------------------------------+
83
// Création du contenu
81
// Création du contenu
-
 
82
 
-
 
83
// Initialisation de la variable à retourner
-
 
84
$var_to_ret = '';
-
 
85
 
84
if ($tableau['selecteur'] == 'ref') {
86
if ($tableau['selecteur'] == 'ref') {
85
    $add_to_query = 'B_L_REFERENCE';
87
    $add_to_query = 'B_L_REFERENCE';
86
    $le_titre = ' de référence';
88
    $le_titre = ' de référence';
87
    $le_texte = '&nbsp;';
89
    $le_texte = '&nbsp;';
88
} else if ($tableau['selecteur'] == 'part') {
90
} else if ($tableau['selecteur'] == 'part') {
89
    $add_to_query = 'B_L_PARTENAIRE';
91
    $add_to_query = 'B_L_PARTENAIRE';
90
    $le_titre = ' des partenaires de Tela Botanica';
92
    $le_titre = ' des partenaires de Tela Botanica';
91
    $le_texte = '&nbsp;';
93
    $le_texte = '&nbsp;';
92
} else {
94
} else {
93
    $le_titre = '';
95
    $le_titre = '';
94
    $le_texte = '';
96
    $le_texte = '';
95
}
97
}
-
 
98
 
-
 
99
$var_to_ret .= '<!-- BiblioBota - Partenaire : DEBUT -->';
96
 
100
 
97
// Titre de la page
101
// Titre de la page
98
$var_to_ret .= '<h1>'.'Sites '.$le_titre.'</h1>';
102
$var_to_ret .= '<h1>'.'Sites '.$le_titre.'</h1>';
99
// Petit descriptif
103
// Petit descriptif
100
$var_to_ret .= '<p>'.$le_texte.'</p>'."\n";
104
$var_to_ret .= '<p>'.$le_texte.'</p>'."\n";
101
 
105
 
102
if (($tableau['selecteur'] == 'ref') || ($tableau['selecteur'] == 'part')) {
106
if (($tableau['selecteur'] == 'ref') || ($tableau['selecteur'] == 'part')) {
103
    $query_tot =    'SELECT COUNT(*) AS cpt '.
107
    $query_tot =    'SELECT COUNT(*) AS cpt '.
104
                    'FROM '.$GLOBALS['tbl']['link'].' '.
108
                    'FROM '.$GLOBALS['tbl']['link'].' '.
105
                    'WHERE '.$add_to_query.' = 1 '.
109
                    'WHERE '.$add_to_query.' = 1 '.
106
                    'AND B_L_CACHER = 0';
110
                    'AND B_L_CACHER = 0';
107
    $do_query_tot = mysql_query($query_tot) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query_tot));
111
    $do_query_tot = mysql_query($query_tot) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query_tot));
108
    $tmp_total = mysql_fetch_object($do_query_tot);
112
    $tmp_total = mysql_fetch_object($do_query_tot);
109
    $nb_total = $tmp_total->cpt;
113
    $nb_total = $tmp_total->cpt;
110
    mysql_free_result($do_query_tot);
114
    mysql_free_result($do_query_tot);
111
    
115
    
112
    if ($nb_total == 0) {
116
    if ($nb_total == 0) {
113
        $var_to_ret .= '<p>'.'Pas encore de liens indexés...'.'</p>'."\n";
117
        $var_to_ret .= '<p>'.'Pas encore de liens indexés...'.'</p>'."\n";
114
    } else {
118
    } else {
115
        $query =    'SELECT '.$GLOBALS['tbl']['link'].'.* '.
119
        $query =    'SELECT '.$GLOBALS['tbl']['link'].'.* '.
116
                    'FROM '.$GLOBALS['tbl']['link'].' '.
120
                    'FROM '.$GLOBALS['tbl']['link'].' '.
117
                    'WHERE '.$add_to_query.' = 1 '.
121
                    'WHERE '.$add_to_query.' = 1 '.
118
                    'AND B_L_CACHER = 0 '.
122
                    'AND B_L_CACHER = 0 '.
119
                    'ORDER BY B_L_TITRE '.
123
                    'ORDER BY B_L_TITRE '.
120
                    'LIMIT '.$tableau['pstart'].', '.$tableau['step'];
124
                    'LIMIT '.$tableau['pstart'].', '.$tableau['step'];
121
        $do_query = mysql_query($query) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query));
125
        $do_query = mysql_query($query) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query));
122
        $nb_results = mysql_num_rows($do_query);
126
        $nb_results = mysql_num_rows($do_query);
123
        
127
        
124
        if (empty($tableau['pend'])) {
128
        if (empty($tableau['pend'])) {
125
            $tableau['pend'] = $nb_total;
129
            $tableau['pend'] = $nb_total;
126
        }
130
        }
127
        
131
        
128
        $var_to_ret .= '<p id="frag_nbre_resultat">'.FRAG_afficherTxtNbreResultat('synth', $tableau, $nb_results, $nb_total).'</p>'."\n";
132
        $var_to_ret .= '<p id="frag_nbre_resultat">'.FRAG_afficherTxtNbreResultat('synth', $tableau, $nb_results, $nb_total).'</p>'."\n";
129
        
133
        
130
        // Ici on fragmente en pages, pour une navigation plus facile
134
        // Ici on fragmente en pages, pour une navigation plus facile
131
        $frag = new fragmenteur();
135
        $frag = new fragmenteur();
132
        $frag_txt = $frag->fragmente($tableau, $nb_total);
136
        $frag_txt = $frag->fragmente($tableau, $nb_total);
133
        if (($frag->nb_pages) > 1) {
137
        if (($frag->nb_pages) > 1) {
134
            $var_to_ret .= '<p id="frag_navigation">';
138
            $var_to_ret .= '<p id="frag_navigation">';
135
            $var_to_ret .= $frag_txt;
139
            $var_to_ret .= $frag_txt;
136
            $var_to_ret .= '</p>'."\n";
140
            $var_to_ret .= '</p>'."\n";
137
        }
141
        }
138
        // Fin fragmentation
142
        // Fin fragmentation
139
        
143
        
140
        $o = 1;
144
        $o = 1;
141
        
145
        
142
        while ($row = mysql_fetch_object($do_query)) {
146
        while ($row = mysql_fetch_object($do_query)) {
143
            $idlink = $row->B_L_IDLINK;
147
            $idlink = $row->B_L_IDLINK;
144
            $titrelink = $row->B_L_TITRE;
148
            $titrelink = $row->B_L_TITRE;
145
            $urllink = $row->B_L_URL;
149
            $urllink = $row->B_L_URL;
146
            $resumlink = $row->B_L_RESUMCLE;
150
            $resumlink = $row->B_L_RESUMCLE;
147
            $comlink = $row->B_L_COMMENT;
151
            $comlink = $row->B_L_COMMENT;
148
            $get_part = $row->B_L_PARTENAIRE;
152
            $get_part = $row->B_L_PARTENAIRE;
149
            $get_ref = $row->B_L_REFERENCE;
153
            $get_ref = $row->B_L_REFERENCE;
150
            
154
            
151
            $var_to_ret .= '<img class="'.BB_CLASS_IMG_WEB.'" src="'.BB_IMG_WEB.'" alt="'.'Lien Web'.'"/>'."\n";
155
            $var_to_ret .= '<img class="'.BB_CLASS_IMG_WEB.'" src="'.BB_IMG_WEB.'" alt="'.'Lien Web'.'"/>'."\n";
152
            
156
            
153
            $var_to_ret .= '<a href="'.$urllink.'">';
157
            $var_to_ret .= '<a href="'.$urllink.'">';
154
            if ($titrelink != '') {
158
            if ($titrelink != '') {
155
                $var_to_ret .= $titrelink;
159
                $var_to_ret .= $titrelink;
156
            } else {
160
            } else {
157
                $var_to_ret .= $urllink;
161
                $var_to_ret .= $urllink;
158
            }
162
            }
159
            $var_to_ret .= '</a>'."\n";
163
            $var_to_ret .= '</a>'."\n";
160
            
164
            
161
            if ($resumlink != '') {
165
            if ($resumlink != '') {
162
                $var_to_ret .= ' - '.$resumlink;
166
                $var_to_ret .= ' - '.$resumlink;
163
            }
167
            }
164
            if ($comlink != '') {
168
            if ($comlink != '') {
165
                $var_to_ret .= ' - '.$comlink;
169
                $var_to_ret .= ' - '.$comlink;
166
            }
170
            }
167
            if (($get_ref == 1) && ($tableau['selecteur'] == 'part')) {
171
            if (($get_ref == 1) && ($tableau['selecteur'] == 'part')) {
168
                $var_to_ret .= ' <img class="'.BB_CLASS_IMG_REFERENCE.'" src="'.BB_IMG_REFERENCE.'" alt="'.'Site Référence'.'" /> '."\n";
172
                $var_to_ret .= ' <img class="'.BB_CLASS_IMG_REFERENCE.'" src="'.BB_IMG_REFERENCE.'" alt="'.'Site Référence'.'" /> '."\n";
169
            }
173
            }
170
            if (($get_part == 1) && ($tableau['selecteur'] == 'ref')) {
174
            if (($get_part == 1) && ($tableau['selecteur'] == 'ref')) {
171
                $var_to_ret .= ' <img class="'.BB_CLASS_IMG_PARTENAIRE.'" src="'.BB_IMG_PARTENAIRE.'" alt="'.'Site Partenaire de Tela Botanica'.'" /> '."\n";
175
                $var_to_ret .= ' <img class="'.BB_CLASS_IMG_PARTENAIRE.'" src="'.BB_IMG_PARTENAIRE.'" alt="'.'Site Partenaire de Tela Botanica'.'" /> '."\n";
172
            }
176
            }
173
            if ($comlink != '') {
177
            if ($comlink != '') {
174
                $var_to_ret .= ' - '.$comlink;
178
                $var_to_ret .= ' - '.$comlink;
175
            }
179
            }
176
            if ($o < $nb_results) {
180
            if ($o < $nb_results) {
177
                $var_to_ret .= '<br /><br />';
181
                $var_to_ret .= '<br /><br />';
178
            }
182
            }
179
            $o++;
183
            $o++;
180
        }
184
        }
181
        mysql_free_result($do_query);
185
        mysql_free_result($do_query);
182
    }
186
    }
183
} else {
187
} else {
184
    $var_to_ret .= '<p>'.'Echec d\'exécution du script : pas de paramètre valide [réf|part].'.'</p>'."\n";
188
    $var_to_ret .= '<p>'.'Echec d\'exécution du script : pas de paramètre valide [réf|part].'.'</p>'."\n";
185
}
189
}
-
 
190
 
-
 
191
$var_to_ret .= '<!-- BiblioBota - Partenaire : FIN -->';
-
 
192
 
-
 
193
$sortie .= $var_to_ret;
186
 
194
 
187
// +------------------------------------------------------------------------------------------------------+
195
// +------------------------------------------------------------------------------------------------------+
188
// |                                            PIED du PROGRAMME                                         |
196
// |                                            PIED du PROGRAMME                                         |
189
// +------------------------------------------------------------------------------------------------------+
197
// +------------------------------------------------------------------------------------------------------+
190
$var_to_ret .= '<!-- BiblioBota - Partenaire : FIN -->'."\n";
-
 
191
$sortie .= $var_to_ret;
-
 
-
 
198
 
192
 
199
 
193
/* +--Fin du code ----------------------------------------------------------------------------------------+
200
/* +--Fin du code ----------------------------------------------------------------------------------------+
194
*
201
*
195
* $Log: not supported by cvs2svn $
202
* $Log: bb_lien_favoris.php,v $
196
* Revision 1.3  2005/03/01 15:18:37  jpm
-
 
197
* Ajout de commentaire html de début et fin d'appli.
-
 
198
*
-
 
199
* Revision 1.2  2005/02/28 14:34:10  jpm
-
 
200
* Changement du nom de l'appli en Lien Favoris.
-
 
201
*
-
 
202
* Revision 1.1  2005/02/28 14:23:51  jpm
203
* Revision 1.1  2005/02/28 14:23:51  jpm
203
* Ajout des fichiers de l'application Lien Favoris.
204
* Ajout des fichiers de l'application Lien Favoris.
204
*
205
*
205
*
206
*
206
* +-- Fin du code ----------------------------------------------------------------------------------------+
207
* +-- Fin du code ----------------------------------------------------------------------------------------+
207
*/
208
*/
208
?>
209
?>