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