2 |
ddelon |
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 library is free software; you can redistribute it and/or |
|
|
|
9 |
// | modify it under the terms of the GNU General Public |
|
|
|
10 |
// | License as published by the Free Software Foundation; either |
|
|
|
11 |
// | version 2.1 of the License, or (at your option) any later version. |
|
|
|
12 |
// | |
|
|
|
13 |
// | This library is distributed in the hope that it will be useful, |
|
|
|
14 |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
15 |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
|
|
16 |
// | General Public License for more details. |
|
|
|
17 |
// | |
|
|
|
18 |
// | You should have received a copy of the GNU General Public |
|
|
|
19 |
// | License along with this library; if not, write to the Free Software |
|
|
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
|
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
22 |
// CVS : $Id: forums-lst.php,v 1.1 2005-09-22 14:02:48 ddelon Exp $
|
|
|
23 |
/**
|
|
|
24 |
* Application détail d'un forum
|
|
|
25 |
*
|
|
|
26 |
* Fichier d'appel pour papyrus
|
|
|
27 |
*
|
|
|
28 |
*@package projet
|
|
|
29 |
//Auteur original :
|
|
|
30 |
*@author Alexandre Granier <alexandre@tela-botanica.org>
|
|
|
31 |
//Autres auteurs :
|
|
|
32 |
*@author Aucun
|
|
|
33 |
*@copyright Tela-Botanica 2000-2004
|
|
|
34 |
*@version $Revision: 1.1 $
|
|
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
36 |
*/
|
|
|
37 |
|
|
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
39 |
// | ENTETE du PROGRAMME |
|
|
|
40 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
41 |
|
|
|
42 |
include_once PROJET_CHEMIN_APPLI.'forums.functions.php' ;
|
|
|
43 |
define ('PROJET_CHEMIN_IMAGES', 'client/projet/images/') ;
|
|
|
44 |
/* DEBUT APPLI */
|
|
|
45 |
|
|
|
46 |
function putFrame () {
|
|
|
47 |
/* Inclusion des paramètres généraux spécifiques au programme */
|
|
|
48 |
|
|
|
49 |
include_once PROJET_CHEMIN_APPLI.'forums.param.php' ;
|
|
|
50 |
|
|
|
51 |
|
|
|
52 |
/* Global des variables */
|
|
|
53 |
|
|
|
54 |
|
|
|
55 |
if (isset($_GET['forum'])) $forum = $_GET['forum'];
|
|
|
56 |
else $forum = "";
|
|
|
57 |
|
|
|
58 |
global $sel_rub;
|
|
|
59 |
|
|
|
60 |
|
|
|
61 |
/* initialisation des variables */
|
|
|
62 |
|
|
|
63 |
if (!empty($GS_ARGUMENTS['sel_rub'])) $sel_rub = $GS_ARGUMENTS['sel_rub'];
|
|
|
64 |
|
|
|
65 |
$sous_titre = "";
|
|
|
66 |
$sel_query = "";
|
|
|
67 |
$sel_from = "";
|
|
|
68 |
|
|
|
69 |
$ret = "<!-- DEBUT -->\n\n";
|
|
|
70 |
$ret .= "<div>";
|
|
|
71 |
$ret .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" summary=\"\">";
|
|
|
72 |
|
|
|
73 |
// formatage des colonnes
|
|
|
74 |
$ret .= "<tr><td> </td><td> </td></tr>\n";
|
|
|
75 |
|
|
|
76 |
/* ligne de titre */
|
|
|
77 |
|
|
|
78 |
$ret .= "<tr><td colspan=\"2\" align=\"center\" class=\"insMsg\">\n";
|
|
|
79 |
|
|
|
80 |
if (isset($forum)&&($forum != ""))
|
|
|
81 |
{
|
|
|
82 |
$ret .= "Détail du forum $forum";
|
|
|
83 |
|
|
|
84 |
$query = "select * from ".$tbl['forums']." where AGO_A_NOMGRP like '$forum'";
|
|
|
85 |
$result = mysql_query($query) or die ("Erreur de query : $query");
|
|
|
86 |
$num = mysql_num_rows($result);
|
|
|
87 |
|
|
|
88 |
if ($num != 1)
|
|
|
89 |
{
|
|
|
90 |
die("<B>ERREUR dans la requête</B> : $query retourne $num.");
|
|
|
91 |
}
|
|
|
92 |
|
|
|
93 |
else
|
|
|
94 |
{
|
|
|
95 |
$row = mysql_fetch_object($result);
|
|
|
96 |
|
|
|
97 |
$left_image['id'] = $row->AGO_A_IMAGE;
|
|
|
98 |
$left_image['image'] = "";
|
|
|
99 |
$left_image['alt'] = "";
|
|
|
100 |
|
|
|
101 |
$id_grp = $row->AGO_A_ID;
|
|
|
102 |
$nomgrplg = $row->AGO_A_NOMGRPLG;
|
|
|
103 |
$nomgrp = $row->AGO_A_NOMGRP;
|
|
|
104 |
$alias = $row->AGO_A_ALIAS;
|
|
|
105 |
$date_creation = $row->AGO_A_DATE_CREATION;
|
|
|
106 |
$date_ajout = $row->AGO_A_DATE_AJOUT;
|
|
|
107 |
$mailabo = $row->AGO_A_MAILABO;
|
|
|
108 |
$mailsend = $row->AGO_A_MAILSEND;
|
|
|
109 |
$maildesa = $row->AGO_A_MAILDESA;
|
|
|
110 |
$urlgrp = $row->AGO_A_URLGRP;
|
|
|
111 |
$resum = $row->AGO_A_RESUM;
|
|
|
112 |
$resumlg = $row->AGO_A_RESUMLG;
|
|
|
113 |
$mode_n = $row->AGO_A_MODERATEUR_N;
|
|
|
114 |
$mode_e = $row->AGO_A_MODERATEUR_E;
|
|
|
115 |
$prop_n = $row->AGO_A_PROP_N;
|
|
|
116 |
$prop_e = $row->AGO_A_PROP_E;
|
|
|
117 |
$cekoi = $row->AGO_A_CEKOI;
|
|
|
118 |
$grptype = $row->AGO_A_GRPTYPE;
|
|
|
119 |
$public = $row->AGO_A_PUBLIC;
|
|
|
120 |
$modere = $row->AGO_A_MODERE;
|
|
|
121 |
$grp_tb = $row->AGO_A_GRP_TB;
|
|
|
122 |
$plusinfo = $row->AGO_A_PLUSINFO;
|
|
|
123 |
$helper = $row->AGO_A_HELPER;
|
|
|
124 |
$nb_adherents = $row->AGO_A_NB_ADH;
|
|
|
125 |
$nb_messages = $row->AGO_A_NB_MES;
|
|
|
126 |
|
|
|
127 |
mysql_free_result($result);
|
|
|
128 |
}
|
|
|
129 |
}
|
|
|
130 |
|
|
|
131 |
else
|
|
|
132 |
{
|
|
|
133 |
if (isset($sel_rub) && ($sel_rub != ""))
|
|
|
134 |
{
|
|
|
135 |
$query_c = "select * from ".$tbl['forums_cat']." where AGO_CAT_IDCAT = '$sel_rub'";
|
|
|
136 |
$resu_c = mysql_query($query_c) or die ("<B>Erreur de query :</B> $query_c");
|
|
|
137 |
$nb_c = mysql_num_rows($resu_c);
|
|
|
138 |
|
|
|
139 |
if ($nb_c != 1)
|
|
|
140 |
{
|
|
|
141 |
die("<B>ERREUR dans la requête</B> : $query_c retourne $nb_c.");
|
|
|
142 |
}
|
|
|
143 |
|
|
|
144 |
else
|
|
|
145 |
{
|
|
|
146 |
$row_c = mysql_fetch_object($resu_c);
|
|
|
147 |
|
|
|
148 |
$sous_titre = $row_c->AGO_CAT_TITRE;
|
|
|
149 |
$left_image['id'] = $row_c->AGO_CAT_IMAGE;
|
|
|
150 |
$left_image['image'] = "";
|
|
|
151 |
$left_image['alt'] = "";
|
|
|
152 |
}
|
|
|
153 |
|
|
|
154 |
mysql_free_result($resu_c);
|
|
|
155 |
|
|
|
156 |
$sel_from = ", ".$tbl['forums_cat'].", ".$tbl['forums_join'];
|
|
|
157 |
$sel_query = "AND AGO_CAT_IDCAT = '$sel_rub' AND (AGO_A_ID = AGO_J_IDFORUM) AND (AGO_J_IDCATEG = AGO_CAT_IDCAT)";
|
|
|
158 |
}
|
|
|
159 |
|
|
|
160 |
$ret .= "Liste des forums";
|
|
|
161 |
if ($sous_titre != "") $ret .= " "$sous_titre"";
|
|
|
162 |
}
|
|
|
163 |
|
|
|
164 |
$ret .= "</td></tr>";
|
|
|
165 |
|
|
|
166 |
$ret .= "<tr><td> </td><td> </td></tr>\n";
|
|
|
167 |
|
|
|
168 |
/* fin de la ligne de titre */
|
|
|
169 |
|
|
|
170 |
|
|
|
171 |
/* ouverture de la ligne contenu */
|
|
|
172 |
|
|
|
173 |
$ret .= "<tr>";
|
|
|
174 |
|
|
|
175 |
/* ouverture de la colonne de gauche (placer une image) ; il s'agit de $left_image */
|
|
|
176 |
|
|
|
177 |
$ret .= '<td width="125" valign="top">';
|
|
|
178 |
|
|
|
179 |
get_image(&$left_image);
|
|
|
180 |
|
|
|
181 |
$ret .= '<img src="'.PROJET_CHEMIN_IMAGES.$left_image['image'].'" width="100" height="100" alt="'.$left_image['alt'].'" />'."\n";
|
|
|
182 |
|
|
|
183 |
$ret .= "</td>";
|
|
|
184 |
|
|
|
185 |
/* fin de la colonne de gauche */
|
|
|
186 |
|
|
|
187 |
|
|
|
188 |
/* colonne de droite */
|
|
|
189 |
|
|
|
190 |
$ret .= "<td>";
|
|
|
191 |
|
|
|
192 |
if ($forum != "")
|
|
|
193 |
{
|
|
|
194 |
/* ********** Affichage du détail d'un forum ************ */
|
|
|
195 |
|
|
|
196 |
$ret .= "<table summary=\"\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
|
|
|
197 |
|
|
|
198 |
$ret .= "<tr><td>";
|
|
|
199 |
$ret .= '<hr size="1" />';
|
|
|
200 |
|
|
|
201 |
if ($plusinfo != "")
|
|
|
202 |
{
|
|
|
203 |
$ret .= "$plusinfo";
|
|
|
204 |
$ret .= '<hr size="1" />';
|
|
|
205 |
}
|
|
|
206 |
|
|
|
207 |
$ret .= "<b>Nom complet :</b> $nomgrplg";
|
|
|
208 |
if (($alias != "")&&($alias != $nomgrplg)) $ret .= " (<i>alias</i> $alias)";
|
|
|
209 |
|
|
|
210 |
/* Ici on met le résumé court */
|
|
|
211 |
|
|
|
212 |
if ($resum != "") $ret .= "<br /><b>Description :</b> $resum";
|
|
|
213 |
|
|
|
214 |
/* Ici on met la date de création de la liste si l'info est connue */
|
|
|
215 |
|
|
|
216 |
if ($date_creation != "")
|
|
|
217 |
{
|
|
|
218 |
$ret .= "<br /><b>Date de création :</b> ";
|
|
|
219 |
$var_date = explode("-",$date_creation);
|
|
|
220 |
$yr = $var_date[0];
|
|
|
221 |
$mt = $var_date[1];
|
|
|
222 |
$day = $var_date[2];
|
|
|
223 |
$ret .= "$day/$mt/$yr";
|
|
|
224 |
}
|
|
|
225 |
|
|
|
226 |
$ret .= '<hr size="1" />';
|
|
|
227 |
|
|
|
228 |
if ($nb_adherents > 0) $ret .= "<b>Nombre d'abonnés :</b> $nb_adherents";
|
|
|
229 |
if (($nb_adherents > 0)&&($nb_messages > 0)) $ret .= "<br />";
|
|
|
230 |
if ($nb_messages > 0) $ret .= "<b>Nombre de messages :</b> $nb_messages";
|
|
|
231 |
|
|
|
232 |
if (($nb_adherents > 0)||($nb_messages > 0)) $ret .= '<hr size="1" />';
|
|
|
233 |
|
|
|
234 |
$ret .= "</td></tr>";
|
|
|
235 |
|
|
|
236 |
/* Ici on met le résumé long */
|
|
|
237 |
|
|
|
238 |
if ($resumlg != "")
|
|
|
239 |
{
|
|
|
240 |
$ret .= "<tr><td>";
|
|
|
241 |
$ret .= "<b>Résumé :</b> $resumlg";
|
|
|
242 |
$ret .= '<hr size="1" />';
|
|
|
243 |
$ret .= "</td></tr>";
|
|
|
244 |
}
|
|
|
245 |
|
|
|
246 |
/* Ici on met les adresses mails de la liste */
|
|
|
247 |
|
|
|
248 |
if ($urlgrp == "http://") $urlgrp = "";
|
|
|
249 |
|
|
|
250 |
if (($mailabo != "")||($mailsend != "")||($maildesa != "")||($urlgrp != ""))
|
|
|
251 |
{
|
|
|
252 |
$ret .= "<tr><td>";
|
|
|
253 |
if ($mailabo != "") $ret .= "<b>Abonnement :</b> <a href=\"mailto:$mailabo\">$mailabo</a>";
|
|
|
254 |
if (($mailabo != "")&&($mailsend != "")) $ret .= "<br />";
|
|
|
255 |
if ($mailsend != "") $ret .= "<b>Envoyer un message :</b> <a href=\"mailto:$mailsend\">$mailsend</a>";
|
|
|
256 |
if (($mailsend != "")&&($maildesa != "")) $ret .= "<br />";
|
|
|
257 |
if ($maildesa != "") $ret .= "<b>Désabonnement :</b> <a href=\"mailto:$maildesa\">$maildesa</a>";
|
|
|
258 |
|
|
|
259 |
/* Ici on met l'URL */
|
|
|
260 |
|
|
|
261 |
if ($urlgrp != "") $ret .= "<br /><b>Adresse web :</b> <a href=\"$urlgrp\" target=\"_blank\">$urlgrp</a>";
|
|
|
262 |
|
|
|
263 |
$ret .= '<hr size="1" />';
|
|
|
264 |
$ret .= "</td></tr>";
|
|
|
265 |
}
|
|
|
266 |
|
|
|
267 |
/* Ici on met les infos de propriétaire et de modérateur */
|
|
|
268 |
|
|
|
269 |
if ($mode_n == "Anonyme") $mode_n = "";
|
|
|
270 |
if ($mode_e == "Anonyme") $mode_e = "";
|
|
|
271 |
if ($prop_n == "Anonyme") $prop_n = "";
|
|
|
272 |
if ($prop_e == "Anonyme") $prop_e = "";
|
|
|
273 |
|
|
|
274 |
if (($mode_n != "")||($mode_e != "")||($prop_n != "")||($prop_e != ""))
|
|
|
275 |
{
|
|
|
276 |
$ret .= "<tr><td>";
|
|
|
277 |
|
|
|
278 |
if (($mode_n != "")&&($mode_e != "")) $mode_aff = "<a href=\"mailto:$mode_e\">$mode_n</a>";
|
|
|
279 |
else if (($mode_n == "")&&($mode_e != "")) $mode_aff = "<a href=\"mailto:$mode_e\">$mode_e</a>";
|
|
|
280 |
else if (($mode_n != "")&&($mode_e == "")) $mode_aff = "$mode_n";
|
|
|
281 |
else $mode_aff = "";
|
|
|
282 |
|
|
|
283 |
if (($prop_n != "")&&($prop_e != "")) $prop_aff = "<a href=\"mailto:$prop_e\">$prop_n</a>";
|
|
|
284 |
else if (($prop_n == "")&&($prop_e != "")) $prop_aff = "<a href=\"mailto:$prop_e\">$prop_e</a>";
|
|
|
285 |
else if (($prop_n != "")&&($prop_e == "")) $prop_aff = "$prop_n";
|
|
|
286 |
else $prop_aff = "";
|
|
|
287 |
|
|
|
288 |
if ($mode_aff != "") $ret .= "<b>Modérateur :</b> $mode_aff";
|
|
|
289 |
if (($mode_aff != "")&&($prop_aff != "")) $ret .= "<br />";
|
|
|
290 |
if ($prop_aff != "") $ret .= "<b>Propriétaire :</b> $prop_aff";
|
|
|
291 |
|
|
|
292 |
$ret .= '<hr size="1" />';
|
|
|
293 |
$ret .= "</td></tr>";
|
|
|
294 |
}
|
|
|
295 |
|
|
|
296 |
/* Ici on met la typologie des forums */
|
|
|
297 |
|
|
|
298 |
$ret .= "<tr><td>";
|
|
|
299 |
|
|
|
300 |
$ret .= "<b>Type :</b> ".ucfirst($cekoi)." de ".ucfirst($grptype)."<br />";
|
|
|
301 |
|
|
|
302 |
if ($public == 1) $public = "Public";
|
|
|
303 |
else $public = "Privé";
|
|
|
304 |
|
|
|
305 |
if ($modere == 1) $modere = "Modéré";
|
|
|
306 |
else $modere = "Non modéré";
|
|
|
307 |
|
|
|
308 |
$ret .= "<b>Statut :</b> $public - $modere";
|
|
|
309 |
|
|
|
310 |
$ret .= '<hr size="1" />';
|
|
|
311 |
$ret .= "</td></tr>";
|
|
|
312 |
|
|
|
313 |
/* Ici on met le plus important ! */
|
|
|
314 |
|
|
|
315 |
if ($grp_tb == 1) $grp_tb = "Créé et géré par Tela Botanica.";
|
|
|
316 |
else $grp_tb = "Ce forum n'est pas géré par Tela Botanica.";
|
|
|
317 |
|
|
|
318 |
$ret .= "<tr><td align=\"right\">";
|
|
|
319 |
$ret .= "$grp_tb";
|
|
|
320 |
$ret .= "</td></tr>";
|
|
|
321 |
|
|
|
322 |
$ret .= "</table>";
|
|
|
323 |
|
|
|
324 |
/* ********** Fin Affichage forum ************ */
|
|
|
325 |
}
|
|
|
326 |
|
|
|
327 |
else
|
|
|
328 |
{
|
|
|
329 |
/* ********** Affichage de la liste des forums, avec éventuellement un raffinement par catégorie ************ */
|
|
|
330 |
|
|
|
331 |
$query = "select AGO_A_NOMGRP, AGO_A_NOMGRPLG, AGO_A_ALIAS, AGO_A_DATE_AJOUT, AGO_A_RESUM, AGO_A_GRP_TB from ".$tbl['forums']." $sel_from where AGO_A_VISIBLE = 1 $sel_query ORDER BY AGO_A_PRIORITE, AGO_A_NOMGRP";
|
|
|
332 |
$result = mysql_query($query) or die ("Erreur de query : $query");
|
|
|
333 |
|
|
|
334 |
$num = mysql_num_rows($result);
|
|
|
335 |
if ($num > 1) $pluriel = "s";
|
|
|
336 |
$ret .= "<b>$num</b> résultat$pluriel :<br /><br />\n";
|
|
|
337 |
|
|
|
338 |
while ($row = mysql_fetch_object($result))
|
|
|
339 |
{
|
|
|
340 |
$nomgrp = $row->AGO_A_NOMGRP;
|
|
|
341 |
$nomgrplg = $row->AGO_A_NOMGRPLG;
|
|
|
342 |
$alias = $row->AGO_A_ALIAS;
|
|
|
343 |
$date_ajout = $row->AGO_A_DATE_AJOUT;
|
|
|
344 |
$resum = $row->AGO_A_RESUM;
|
|
|
345 |
$grp_tb = $row->AGO_A_GRP_TB;
|
|
|
346 |
|
|
|
347 |
if ($alias == "") $what_aff = "$nomgrp";
|
|
|
348 |
else $what_aff = "$alias";
|
|
|
349 |
|
|
|
350 |
if ($grp_tb == '1') $ret .= "<img src=\"Local/".$GS_GLOBAL['project']."/".$GS_GLOBAL['locale']."/feuille20-16.gif\" width=\"20\" height=\"16\" alt=\"\"> \n";
|
|
|
351 |
else $ret .= "<img src=\"Local/".$GS_GLOBAL['project']."/".$GS_GLOBAL['locale']."/feuille20-16r.gif\" width=\"20\" height=\"16\" alt=\"\"> \n";
|
|
|
352 |
|
|
|
353 |
$ret .= "<b><a href=\"Javascript:openDocumentPopup ('".$GS_GLOBAL['project']."', '".$GS_GLOBAL['locale']."', 'pop-forums-info', '".$GS_GLOBAL['set']."', '&forum=$nomgrp&arg_0=forum%3D$nomgrp&arg_1=forum%3D$nomgrp', 780, 450)\">$what_aff</a></B>\n\n";
|
|
|
354 |
if ($alias != "") $ret .= " ($nomgrp)";
|
|
|
355 |
|
|
|
356 |
/* calcul qui affiche "nouveau" si le forum a moins d'un certain temps */
|
|
|
357 |
$how_long_stp = $how_long * 24 * 60 * 60;
|
|
|
358 |
|
|
|
359 |
$today_is = time();
|
|
|
360 |
if (($date_ajout+$how_long_stp)>=$today_is) $ret .= " <img src=\"Local/".$GS_GLOBAL['project']."/".$GS_GLOBAL['locale']."/nouveau.gif\" alt=\"\">\n";
|
|
|
361 |
|
|
|
362 |
$ret .= "<br />$resum";
|
|
|
363 |
|
|
|
364 |
$ret .= "<br /><br />";
|
|
|
365 |
}
|
|
|
366 |
|
|
|
367 |
|
|
|
368 |
$ret .= "</td></tr>\n";
|
|
|
369 |
$ret .= "<tr><td colspan=\"2\" valign=\"top\">\n";
|
|
|
370 |
$ret .= '<hr size="1" />';
|
|
|
371 |
$ret .= "<img src=\"Local/".$GS_GLOBAL['project']."/".$GS_GLOBAL['locale']."/feuille20-16.gif\" width=\"20\" height=\"16\" alt=\"\" /> forum Tela Botanica<br />\n";
|
|
|
372 |
$ret .= "<img src=\"Local/".$GS_GLOBAL['project']."/".$GS_GLOBAL['locale']."/feuille20-16r.gif\" width=\"20\" height=\"16\" alt=\"\" /> forum indépendant\n";
|
|
|
373 |
|
|
|
374 |
/* *************** Fin affichage liste ***************** */
|
|
|
375 |
}
|
|
|
376 |
|
|
|
377 |
|
|
|
378 |
/* fin de la colonne d'information */
|
|
|
379 |
|
|
|
380 |
$ret .= "</td>";
|
|
|
381 |
|
|
|
382 |
/* fin de la ligne d'information */
|
|
|
383 |
|
|
|
384 |
$ret .= "</tr>";
|
|
|
385 |
|
|
|
386 |
$ret .= "</table>\n";
|
|
|
387 |
$ret .= "</div>\n";
|
|
|
388 |
$ret .= "<!-- FIN -->";
|
|
|
389 |
|
|
|
390 |
return $ret;
|
|
|
391 |
}
|
|
|
392 |
|
|
|
393 |
?>
|