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 |
include ("inc.php3");
|
|
|
14 |
@header("Cache-Control: no-store, no-cache, must-revalidate");
|
|
|
15 |
echo "";
|
|
|
16 |
|
|
|
17 |
if (($id > 0) && ($connect_statut == "0minirezo")) {
|
|
|
18 |
|
|
|
19 |
|
|
|
20 |
#### OUH LA, il faudrait passer ca et les modifs des articles.php3 etc
|
|
|
21 |
#### dans un seul fichier, sinon toute modif faite ici doit etre reportee
|
|
|
22 |
#### la, et inversement : l'enfer
|
|
|
23 |
|
|
|
24 |
if ($action == 'statut_article') {
|
|
|
25 |
|
|
|
26 |
$id_article = $id;
|
|
|
27 |
$query = "SELECT statut FROM spip_articles WHERE id_article=$id_article";
|
|
|
28 |
$result = spip_query($query);
|
|
|
29 |
if ($row = spip_fetch_array($result)) {
|
|
|
30 |
$statut_ancien = $row['statut'];
|
|
|
31 |
}
|
|
|
32 |
|
|
|
33 |
|
|
|
34 |
if ($statut != $statut_ancien) {
|
|
|
35 |
$query = "UPDATE spip_articles SET statut='$statut' WHERE id_article=$id_article";
|
|
|
36 |
$result = spip_query($query);
|
|
|
37 |
|
|
|
38 |
include_ecrire("inc_rubriques.php3");
|
|
|
39 |
|
|
|
40 |
if ($statut == 'publie') {
|
|
|
41 |
spip_query("UPDATE spip_articles SET date=NOW() WHERE id_article=$id_article");
|
|
|
42 |
include_ecrire ("inc_index.php3");
|
|
|
43 |
marquer_indexer('article', $id_article);
|
|
|
44 |
calculer_rubriques();
|
|
|
45 |
include_ecrire("inc_mail.php3");
|
|
|
46 |
envoyer_mail_publication($id_article);
|
|
|
47 |
}
|
|
|
48 |
if ($statut_ancien == 'publie' AND $invalider_caches) {
|
|
|
49 |
include_ecrire ("inc_invalideur.php3");
|
|
|
50 |
suivre_invalideur("id='id_article/$id_article'");
|
|
|
51 |
calculer_rubriques();
|
|
|
52 |
}
|
|
|
53 |
if ($statut == "prop" AND $statut_ancien != 'publie') {
|
|
|
54 |
include_ecrire("inc_mail.php3");
|
|
|
55 |
envoyer_mail_proposition($id_article);
|
|
|
56 |
}
|
|
|
57 |
}
|
|
|
58 |
}
|
|
|
59 |
|
|
|
60 |
elseif ($action == 'statut_breve') {
|
|
|
61 |
|
|
|
62 |
$id_breve = $id;
|
|
|
63 |
$query = "SELECT statut FROM spip_breves WHERE id_breve=$id_breve";
|
|
|
64 |
$result = spip_query($query);
|
|
|
65 |
if ($row = spip_fetch_array($result)) {
|
|
|
66 |
$statut_ancien = $row['statut'];
|
|
|
67 |
}
|
|
|
68 |
|
|
|
69 |
if ($statut != $statut_ancien) {
|
|
|
70 |
$query = "UPDATE spip_breves SET date_heure=NOW(), statut='$statut' WHERE id_breve=$id_breve";
|
|
|
71 |
$result = spip_query($query);
|
|
|
72 |
|
|
|
73 |
include_ecrire("inc_rubriques.php3");
|
|
|
74 |
calculer_rubriques();
|
|
|
75 |
}
|
|
|
76 |
}
|
|
|
77 |
}
|
|
|
78 |
?>
|