4 |
david |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/***************************************************************************\
|
|
|
4 |
* SPIP, Systeme de publication pour l'internet *
|
|
|
5 |
* *
|
|
|
6 |
* Copyright (c) 2001-2005 *
|
|
|
7 |
* Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
|
|
|
8 |
* *
|
|
|
9 |
* Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
|
|
|
10 |
* Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
|
|
|
11 |
\***************************************************************************/
|
|
|
12 |
|
|
|
13 |
|
|
|
14 |
include ("inc.php3");
|
|
|
15 |
include_ecrire ("inc_logos.php3");
|
|
|
16 |
include_ecrire ("inc_mots.php3");
|
|
|
17 |
include_ecrire ("inc_date.php3");
|
|
|
18 |
include_ecrire ("inc_abstract_sql.php3");
|
|
|
19 |
|
|
|
20 |
if (!$id_breve) $id_breve=0;
|
|
|
21 |
|
|
|
22 |
$flag_mots = lire_meta("articles_mots");
|
|
|
23 |
|
|
|
24 |
if (($id_breve == 0) AND ($new == "oui")) {
|
|
|
25 |
$id_rubrique = intval($id_rubrique);
|
|
|
26 |
$langue_new = '';
|
|
|
27 |
$result_lang_rub = spip_query("SELECT lang FROM spip_rubriques WHERE id_rubrique=$id_rubrique");
|
|
|
28 |
if ($row = spip_fetch_array($result_lang_rub)) {
|
|
|
29 |
$langue_new = $row["lang"];
|
|
|
30 |
}
|
|
|
31 |
if (!$langue_new) $langue_new = lire_meta('langue_site');
|
|
|
32 |
$langue_choisie_new = 'non';
|
|
|
33 |
|
|
|
34 |
$id_breve = spip_abstract_insert("spip_breves",
|
|
|
35 |
"(titre, date_heure, id_rubrique, statut, lang, langue_choisie)",
|
|
|
36 |
"('"._T('item_nouvelle_breve')."', NOW(), '$id_rubrique', 'refuse', '$langue_new', '$langue_choisie_new')");
|
|
|
37 |
|
|
|
38 |
// Modifier le lien de base pour qu'il prenne en compte le nouvel id
|
|
|
39 |
unset($_POST['id_rubrique']);
|
|
|
40 |
$_POST['id_breve'] = $id_breve;
|
|
|
41 |
$clean_link = new Link();
|
|
|
42 |
}
|
|
|
43 |
|
|
|
44 |
|
|
|
45 |
if ($titre AND $modifier_breve) {
|
|
|
46 |
$titre = addslashes($titre);
|
|
|
47 |
$texte = addslashes($texte);
|
|
|
48 |
$lien_titre = addslashes($lien_titre);
|
|
|
49 |
|
|
|
50 |
// recoller les champs du extra
|
|
|
51 |
if ($champs_extra) {
|
|
|
52 |
include_ecrire("inc_extra.php3");
|
|
|
53 |
$add_extra = ", extra = '".addslashes(extra_recup_saisie("breves"))."'";
|
|
|
54 |
} else
|
|
|
55 |
$add_extra = '';
|
|
|
56 |
|
|
|
57 |
$query = "UPDATE spip_breves SET titre='$titre', texte='$texte', lien_titre='$lien_titre', lien_url='$lien_url', statut='$statut', id_rubrique='$id_rubrique' $add_extra WHERE id_breve=$id_breve";
|
|
|
58 |
$result = spip_query($query);
|
|
|
59 |
|
|
|
60 |
// invalider et reindexer
|
|
|
61 |
if ($invalider_caches) {
|
|
|
62 |
include_ecrire ("inc_invalideur.php3");
|
|
|
63 |
suivre_invalideur("id='id_breve/$id_breve'");
|
|
|
64 |
}
|
|
|
65 |
if (lire_meta('activer_moteur') == 'oui') {
|
|
|
66 |
include_ecrire ("inc_index.php3");
|
|
|
67 |
marquer_indexer('breve', $id_breve);
|
|
|
68 |
}
|
|
|
69 |
calculer_rubriques();
|
|
|
70 |
|
|
|
71 |
|
|
|
72 |
// Changer la langue heritee
|
|
|
73 |
if ($id_rubrique != id_rubrique_old) {
|
|
|
74 |
$row = spip_fetch_array(spip_query("SELECT lang, langue_choisie FROM spip_breves WHERE id_breve=$id_breve"));
|
|
|
75 |
$langue_old = $row['lang'];
|
|
|
76 |
$langue_choisie_old = $row['langue_choisie'];
|
|
|
77 |
|
|
|
78 |
if ($langue_choisie_old != "oui") {
|
|
|
79 |
$row = spip_fetch_array(spip_query("SELECT lang FROM spip_rubriques WHERE id_rubrique=$id_rubrique"));
|
|
|
80 |
$langue_new = $row['lang'];
|
|
|
81 |
|
|
|
82 |
if ($langue_new != $langue_old) {
|
|
|
83 |
spip_query("UPDATE spip_breves SET lang = '$langue_new' WHERE id_breve = $id_breve");
|
|
|
84 |
}
|
|
|
85 |
}
|
|
|
86 |
}
|
|
|
87 |
|
|
|
88 |
}
|
|
|
89 |
|
|
|
90 |
|
|
|
91 |
if ($jour AND $connect_statut == '0minirezo') {
|
|
|
92 |
if ($annee == "0000") $mois = "00";
|
|
|
93 |
if ($mois == "00") $jour = "00";
|
|
|
94 |
$query = "UPDATE spip_breves SET date_heure='$annee-$mois-$jour' WHERE id_breve=$id_breve";
|
|
|
95 |
$result = spip_query($query);
|
|
|
96 |
calculer_rubriques();
|
|
|
97 |
}
|
|
|
98 |
|
|
|
99 |
|
|
|
100 |
$query = "SELECT * FROM spip_breves WHERE id_breve='$id_breve'";
|
|
|
101 |
$result = spip_query($query);
|
|
|
102 |
|
|
|
103 |
while ($row = spip_fetch_array($result)) {
|
|
|
104 |
$id_breve=$row['id_breve'];
|
|
|
105 |
$date_heure=$row['date_heure'];
|
|
|
106 |
$titre_breve=$row['titre'];
|
|
|
107 |
$titre=$row['titre'];
|
|
|
108 |
$texte=$row['texte'];
|
|
|
109 |
$extra=$row['extra'];
|
|
|
110 |
$lien_titre=$row['lien_titre'];
|
|
|
111 |
$lien_url=$row['lien_url'];
|
|
|
112 |
$statut=$row['statut'];
|
|
|
113 |
$id_rubrique=$row['id_rubrique'];
|
|
|
114 |
}
|
|
|
115 |
|
|
|
116 |
$flag_editable = (($connect_statut == '0minirezo' AND acces_rubrique($id_rubrique)) OR $statut == 'prop');
|
|
|
117 |
|
|
|
118 |
|
|
|
119 |
|
|
|
120 |
debut_page("« $titre_breve »", "documents", "breves");
|
|
|
121 |
|
|
|
122 |
|
|
|
123 |
debut_grand_cadre();
|
|
|
124 |
|
|
|
125 |
afficher_hierarchie($id_rubrique);
|
|
|
126 |
|
|
|
127 |
fin_grand_cadre();
|
|
|
128 |
|
|
|
129 |
|
|
|
130 |
debut_gauche();
|
|
|
131 |
|
|
|
132 |
|
|
|
133 |
debut_boite_info();
|
|
|
134 |
|
|
|
135 |
echo "<CENTER>";
|
|
|
136 |
echo "<FONT FACE='Verdana,Arial,Sans,sans-serif' SIZE=1><B>"._T('info_gauche_numero_breve')." :</B></FONT>";
|
|
|
137 |
echo "<BR><FONT FACE='Verdana,Arial,Sans,sans-serif' SIZE=6><B>$id_breve</B></FONT>";
|
|
|
138 |
echo "</CENTER>";
|
|
|
139 |
|
|
|
140 |
voir_en_ligne ('breve', $id_breve, $statut);
|
|
|
141 |
|
|
|
142 |
fin_boite_info();
|
|
|
143 |
|
|
|
144 |
|
|
|
145 |
//////////////////////////////////////////////////////
|
|
|
146 |
// Logos de la breve
|
|
|
147 |
//
|
|
|
148 |
|
|
|
149 |
if ($id_breve>0 AND ($connect_statut == '0minirezo' AND acces_rubrique($id_rubrique)))
|
|
|
150 |
afficher_boite_logo('breve', 'id_breve', $id_breve,
|
|
|
151 |
_T('logo_breve').aide ("breveslogo"), _T('logo_survol'));
|
|
|
152 |
|
|
|
153 |
debut_raccourcis();
|
|
|
154 |
icone_horizontale(_T('icone_nouvelle_breve'), "breves_edit.php3?new=oui", "breve-24.gif","creer.gif");
|
|
|
155 |
fin_raccourcis();
|
|
|
156 |
|
|
|
157 |
debut_droite();
|
|
|
158 |
|
|
|
159 |
debut_cadre_relief("breve-24.gif");
|
|
|
160 |
echo "<TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0 BORDER=0>";
|
|
|
161 |
echo "<TR><td class='serif'>";
|
|
|
162 |
|
|
|
163 |
|
|
|
164 |
|
|
|
165 |
echo "\n<table cellpadding=0 cellspacing=0 border=0 width='100%'>";
|
|
|
166 |
echo "<tr width='100%'><td width='100%' valign='top'>";
|
|
|
167 |
gros_titre($titre);
|
|
|
168 |
echo "</td>";
|
|
|
169 |
|
|
|
170 |
if ($flag_editable) {
|
|
|
171 |
echo "<td>", http_img_pack("rien.gif", ' ', "width='5'") ."</td>\n";
|
|
|
172 |
echo "<td align='right'>";
|
|
|
173 |
icone(_T('icone_modifier_breve'), "breves_edit.php3?id_breve=$id_breve&retour=nav", "breve-24.gif", "edit.gif");
|
|
|
174 |
echo "</td>";
|
|
|
175 |
}
|
|
|
176 |
echo "</tr></table>\n";
|
|
|
177 |
|
|
|
178 |
if ($flag_editable AND ($options == 'avancees' OR $statut == 'publie')) {
|
|
|
179 |
|
|
|
180 |
if ($statut == 'publie') {
|
|
|
181 |
echo "<p>";
|
|
|
182 |
|
|
|
183 |
if (ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})", $date_heure, $regs)) {
|
|
|
184 |
$mois = $regs[2];
|
|
|
185 |
$jour = $regs[3];
|
|
|
186 |
$annee = $regs[1];
|
|
|
187 |
}
|
|
|
188 |
|
|
|
189 |
|
|
|
190 |
debut_cadre_enfonce();
|
|
|
191 |
echo afficher_formulaire_date("breves_voir.php3?id_breve=$id_breve&options=$options", _T('texte_date_publication_article'), $jour, $mois, $annee);
|
|
|
192 |
fin_cadre_enfonce();
|
|
|
193 |
}
|
|
|
194 |
else {
|
|
|
195 |
echo "<BR><FONT FACE='Verdana,Arial,Sans,sans-serif' SIZE=3><B>".affdate($date_heure)." </B></FONT><P>";
|
|
|
196 |
}
|
|
|
197 |
}
|
|
|
198 |
|
|
|
199 |
|
|
|
200 |
|
|
|
201 |
if ($flag_mots!='non' AND $flag_editable AND $options == 'avancees') {
|
|
|
202 |
formulaire_mots('breves', $id_breve, $nouv_mot, $supp_mot, $cherche_mot, $flag_editable);
|
|
|
203 |
}
|
|
|
204 |
|
|
|
205 |
|
|
|
206 |
//
|
|
|
207 |
// Langue de la breve
|
|
|
208 |
//
|
|
|
209 |
if ((lire_meta('multi_articles') == 'oui') AND ($flag_editable)) {
|
|
|
210 |
$row = spip_fetch_array(spip_query("SELECT lang FROM spip_rubriques WHERE id_rubrique=$id_rubrique"));
|
|
|
211 |
$langue_parent = $row['lang'];
|
|
|
212 |
|
|
|
213 |
if ($changer_lang) {
|
|
|
214 |
if ($changer_lang != "herit")
|
|
|
215 |
spip_query("UPDATE spip_breves SET lang='".addslashes($changer_lang)."', langue_choisie='oui' WHERE id_breve=$id_breve");
|
|
|
216 |
else {
|
|
|
217 |
spip_query("UPDATE spip_breves SET lang='".addslashes($langue_parent)."', langue_choisie='non' WHERE id_breve=$id_breve");
|
|
|
218 |
}
|
|
|
219 |
}
|
|
|
220 |
|
|
|
221 |
$row = spip_fetch_array(spip_query("SELECT lang, langue_choisie FROM spip_breves WHERE id_breve=$id_breve"));
|
|
|
222 |
$langue_breve = $row['lang'];
|
|
|
223 |
$langue_choisie_breve = $row['langue_choisie'];
|
|
|
224 |
|
|
|
225 |
if ($langue_choisie_breve == 'oui') $herit = false;
|
|
|
226 |
else $herit = true;
|
|
|
227 |
|
|
|
228 |
debut_cadre_enfonce('langues-24.gif');
|
|
|
229 |
|
|
|
230 |
echo "<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=3 WIDTH=100% BACKGROUND=''><TR><TD BGCOLOR='#EEEECC' class='serif2'>";
|
|
|
231 |
echo bouton_block_invisible('languesbreve');
|
|
|
232 |
echo "<B>";
|
|
|
233 |
echo _T('titre_langue_breve');
|
|
|
234 |
echo " (".traduire_nom_langue($langue_breve).")";
|
|
|
235 |
echo "</B>";
|
|
|
236 |
echo "</TD></TR></TABLE>";
|
|
|
237 |
|
|
|
238 |
echo debut_block_invisible('languesbreve');
|
|
|
239 |
echo "<center><font face='Verdana,Arial,Sans,sans-serif' size='2'>";
|
|
|
240 |
echo menu_langues('changer_lang', $langue_breve, '', $langue_parent);
|
|
|
241 |
echo "</font></center>\n";
|
|
|
242 |
echo fin_block();
|
|
|
243 |
|
|
|
244 |
fin_cadre_enfonce();
|
|
|
245 |
}
|
|
|
246 |
|
|
|
247 |
|
|
|
248 |
|
|
|
249 |
|
|
|
250 |
echo justifier(propre($texte))."\n";
|
|
|
251 |
|
|
|
252 |
if (strlen($lien_url)>7 AND strlen($lien_titre)>2){
|
|
|
253 |
echo "<P><font size=1>"._T('lien_voir_en_ligne')."</font> <A HREF='$lien_url'><B>".typo($lien_titre)."</B></A>\n";
|
|
|
254 |
} else if (strlen($lien_titre)>2) {
|
|
|
255 |
echo "<P><font size=1>"._T('lien_nom_site')."</font> ".typo($lien_titre)."</B></A>\n";
|
|
|
256 |
} else if (strlen($lien_url)>7) {
|
|
|
257 |
echo "<P><font size=1>"._T('info_url_site')."</font> <tt>$lien_url</tt>\n";
|
|
|
258 |
}
|
|
|
259 |
|
|
|
260 |
if ($les_notes) {
|
|
|
261 |
echo "<hr width='70%' height=1 align='left'><font size=2>$les_notes</font>\n";
|
|
|
262 |
}
|
|
|
263 |
|
|
|
264 |
// afficher les extra
|
|
|
265 |
if ($champs_extra AND $extra) {
|
|
|
266 |
include_ecrire("inc_extra.php3");
|
|
|
267 |
extra_affichage($extra, "breves");
|
|
|
268 |
}
|
|
|
269 |
|
|
|
270 |
if ($connect_statut=="0minirezo" AND acces_rubrique($id_rubrique) AND ($statut=="prop" OR $statut=="prepa")){
|
|
|
271 |
echo "<div align='right'>";
|
|
|
272 |
|
|
|
273 |
echo "<table>";
|
|
|
274 |
echo "<td align='right'>";
|
|
|
275 |
icone(_T('icone_publier_breve'), "breves.php3?id_breve=$id_breve&statut=publie", "breve-24.gif", "racine-24.gif");
|
|
|
276 |
echo "</td>";
|
|
|
277 |
|
|
|
278 |
echo "<td>", http_img_pack("rien.gif", ' ', "width='5'") ."</td>\n";
|
|
|
279 |
echo "<td align='right'>";
|
|
|
280 |
icone(_T('icone_refuser_breve'), "breves.php3?id_breve=$id_breve&statut=refuse", "breve-24.gif", "supprimer.gif");
|
|
|
281 |
echo "</td>";
|
|
|
282 |
|
|
|
283 |
|
|
|
284 |
echo "</table>";
|
|
|
285 |
echo "</div>";
|
|
|
286 |
|
|
|
287 |
}
|
|
|
288 |
|
|
|
289 |
echo "</TD></TR></TABLE>";
|
|
|
290 |
|
|
|
291 |
fin_cadre_relief();
|
|
|
292 |
|
|
|
293 |
//////////////////////////////////////////////////////
|
|
|
294 |
// Forums
|
|
|
295 |
//
|
|
|
296 |
|
|
|
297 |
echo "<BR><BR>";
|
|
|
298 |
|
|
|
299 |
$forum_retour = urlencode("breves_voir.php3?id_breve=$id_breve");
|
|
|
300 |
|
|
|
301 |
|
|
|
302 |
|
|
|
303 |
echo "\n<div align='center'>";
|
|
|
304 |
icone(_T('icone_poster_message'), "forum_envoi.php3?statut=prive&adresse_retour=".$forum_retour."&id_breve=$id_breve&titre_message=".urlencode($titre), "forum-interne-24.gif", "creer.gif");
|
|
|
305 |
echo "</div>";
|
|
|
306 |
|
|
|
307 |
|
|
|
308 |
echo "<P align='left'>";
|
|
|
309 |
|
|
|
310 |
|
|
|
311 |
$query_forum = "SELECT * FROM spip_forum WHERE statut='prive' AND id_breve='$id_breve' AND id_parent=0 ORDER BY date_heure DESC LIMIT 0,20";
|
|
|
312 |
$result_forum = spip_query($query_forum);
|
|
|
313 |
afficher_forum($result_forum, $forum_retour);
|
|
|
314 |
|
|
|
315 |
|
|
|
316 |
|
|
|
317 |
|
|
|
318 |
|
|
|
319 |
|
|
|
320 |
fin_page();
|
|
|
321 |
|
|
|
322 |
?>
|